curl --request POST \
--url https://api.example.com/cost/query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"fields": [
"id",
"llm_id",
"prompt_token_cost",
"completion_token_cost",
"prompt_token_cost_unit",
"completion_token_cost_unit",
"effective_date",
"provider_id"
],
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"sort_by": [
{
"field": "<string>",
"direction": "asc"
}
],
"limit": 10,
"offset": 0
}
'{
"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"
}
]
}curl --request POST \
--url https://api.example.com/cost/query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"fields": [
"id",
"llm_id",
"prompt_token_cost",
"completion_token_cost",
"prompt_token_cost_unit",
"completion_token_cost_unit",
"effective_date",
"provider_id"
],
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"sort_by": [
{
"field": "<string>",
"direction": "asc"
}
],
"limit": 10,
"offset": 0
}
'{
"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"
}
]
}Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
"entity/project"
[
"id",
"llm_id",
"prompt_token_cost",
"completion_token_cost",
"prompt_token_cost_unit",
"completion_token_cost_unit",
"effective_date",
"provider_id"
]Show child attributes
Show child attributes
10
0
Successful Response
Show child attributes
Was this page helpful?