Costs

Cost Query

post/cost/query

Request body

project_idstring required
fieldsstring[] nullable
limitinteger nullable
offsetinteger nullable

Example request

{
  "project_id": "entity/project",
  "fields": [
    "id",
    "llm_id",
    "prompt_token_cost",
    "completion_token_cost",
    "prompt_token_cost_unit",
    "completion_token_cost_unit",
    "effective_date",
    "provider_id"
  ],
  "limit": 10
}

Response

Successful Response

Example response

{
  "results": [
    {
      "id": "2341-asdf-asdf",
      "llm_id": "gpt4",
      "prompt_token_cost": 1,
      "completion_token_cost": 1,
      "prompt_token_cost_unit": "USD",
      "completion_token_cost_unit": "USD",
      "effective_date": "2024-01-01T00:00:00Z",
      "provider_id": "openai"
    }
  ]
}