Openai Usage
OpenAI platform usage and cost reporting via the Organization Usage API — daily and total completion token counts, embeddings/moderations/images/audio usage, and USD spend, month-to-date by default, optionally grouped and filtered by project, model, API key, or cost line item. Vault-based Admin API key (the api.usage.read scope is required; a standard project key cannot read usage).
Adds group_by and project/model filters to usage and costs, and usageByType for the embeddings, images, audio speeches/transcriptions and moderations buckets. Results are never silently truncated: a pull that would exceed 100 pages, or a missing pagination cursor, fails loudly; periods are capped at 2,900 days with real-date validation. Retries one 429 honouring Retry-After.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| apiKey | string | OpenAI Admin API key (sk-admin-...) carrying the api.usage.read scope. Store it in a vault and pass via a CEL expression; a standard project key cannot read usage. |
Resources
Mark the Admin API key field sensitive (.meta sensitive:true) so it is masked in logs/output.
Added 1, removed 1 behaviors
Initial release. Query the OpenAI Organization Usage and Cost API for month-to-date completion token usage and USD spend, with daily breakdowns; vault-based Admin key (api.usage.read scope). Fills a gap no community extension covers: the OpenAI platform usage API (not Azure/Bedrock/Vertex).
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License1/2partial
no SPDX license declared
- Verified public repository2/2earned