Skip to main content
GET
/
usage
Token usage and scraper spend, aggregated by model and call type
curl --request GET \
  --url https://openlens.com/api/usage \
  --header 'Authorization: Bearer <token>'
{
  "totalInputTokens": 123,
  "totalOutputTokens": 123,
  "totalWebSearches": 123,
  "llmCostUsd": 123,
  "bdSpendUsd": 123,
  "totalSpendUsd": 123,
  "byModel": [
    {}
  ],
  "byCallType": [
    {}
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.openlens.com/llms.txt

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

Authorizations

Authorization
string
header
required

Clerk API key. Create one from your account settings under API Keys.

Query Parameters

startDate
string<date-time>
endDate
string<date-time>
promptRunId
string<uuid>

Response

Successful response

totalInputTokens
integer
totalOutputTokens
integer
totalWebSearches
integer
llmCostUsd
number
bdSpendUsd
number
totalSpendUsd
number
byModel
object[]
byCallType
object[]