Analytics
Get usage by model
post/usage/models
Request
- Base URLhttps://api.us-east-1.langdb.ai
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
X-Project-Idstring required
LangDB project ID
Request body
Example request
{
"start_time_us": 1693062345678,
"min_unit": "hour"
}Response
Successful response
Example response
{
"models": [
{
"hour": "2025-02-15 09:00:00",
"provider": "openai",
"model_name": "gpt-4o",
"total_input_tokens": 451235,
"total_output_tokens": 2553,
"total_cost": 1.3843410000000005
}
],
"period_start": 1737504000000000,
"period_end": 1740121147931000
}Changes
No recorded changes to this operation across all 1 revision of this API.