Installation¶
openai-usage requires Python 3.11+.
The openai and openai-agents SDKs are installed as dependencies, so the usage
types you pass to Usage.from_openai are available out of
the box.
Verify¶
What gets installed¶
| Dependency | Purpose |
|---|---|
openai |
Source of the SDK usage types (CompletionUsage, ResponseUsage, …). |
openai-agents |
Agents SDK usage (agents.Usage, agents.RunContextWrapper). |
pydantic |
Usage is a Pydantic model. |
Model pricing is fetched from OpenRouter at runtime
when you opt in with realtime_pricing=True; otherwise a bundled snapshot is
used. See Estimating Costs.