Usage API

Last verified

A Usage API returns token counts — input, output, by model, project, key or user, at minute/hour/day granularity.

Use it to find _what_ is consuming tokens: which model, which service, which prompt got longer. For dollar figures, use the Costs API instead.

Requires an admin key. The OpenAI Usage API, with working examples.