Skip to main content
GET
/
api
/
v1
/
usage
/
cost
Get cost over time
curl --request GET \
  --url http://localhost:3051/api/v1/usage/cost \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "ts": "2023-11-07T05:31:56Z",
      "pre": 123,
      "post": 123,
      "prompt": 123,
      "image": 123,
      "video": 123
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.omnifence.ai/llms.txt

Use this file to discover all available pages before exploring further.

Requires the usage:read scope. Requests without this scope receive a 403 FORBIDDEN response. See authentication.
Returns total cost (USD) bucketed over time, split by modality (prompt, image, video). Each data point also includes legacy pre and post series for historical jobs created before the modality split. The period query parameter works the same way as GET /usage/volume.

Authorizations

Authorization
string
header
required

API key from the Stars dashboard

Query Parameters

period
enum<string>
default:week
Available options:
month,
week,
day,
hour

Response

200 - application/json

Default Response

period
enum<string>
required
Available options:
month,
week,
day,
hour
bucket
enum<string>
required
Available options:
minute,
hour,
day
data
object[]
required