Retrieve a customer

Retrieve a customer by their identifier. Returns usage stats, budgets, and metadata.

Path parameters

customer_identifierstringRequired
Your unique identifier for this customer.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Query parameters

environmentstringOptionalDefaults to prod

Specify environment if you are not using the default. Options: prod, test.

Response

Customer details.
idinteger
Internal customer ID.
customer_identifierstring
Your unique identifier for this customer.
emailstring
Customer email.
namestring
Customer display name.
environmentenum
Environment.
Allowed values:
period_budgetdouble or null
Budget for the current period in USD.
budget_durationenum or null
Budget reset period.
Allowed values:
total_period_usagedouble

Spending in the current budget period (USD).

period_startdatetime
Start of current budget period.
period_enddatetime or null
End of current budget period.
total_budgetdouble or null

Lifetime budget limit (USD).

total_usagedouble

Lifetime spending (USD).

total_requestsinteger
Total number of requests.
total_prompt_tokensinteger
Total prompt tokens.
total_completion_tokensinteger
Total completion tokens.
total_tokensinteger
Total tokens.
total_cache_hitsinteger
Total cache hits.
average_latencydouble
Average latency in seconds.
average_ttftdouble
Average time to first token in seconds.
average_monthly_costdouble

Average monthly cost (USD).

top_modelsobject
Most used models.
last_activedatetime
Last activity timestamp.
created_atdatetime
When the customer was created.
updated_atdatetime
Last update timestamp.
metadataobject or null
Custom metadata.
markup_percentagedouble
Markup percentage.

Errors

401
Unauthorized Error
429
Too Many Requests Error
500
Internal Server Error