GET /usage
Return the caller's usage dashboard data.
curl "https://api.ellipsis.dev/v1/usage" \
-H "Authorization: Bearer $ELLIPSIS_API_KEY"{
"by_model": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"model_id": "string",
"tokens": 0
}
],
"daily": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"date": "string",
"tokens": 0,
"tokens_cache_creation": 0,
"tokens_cache_read": 0,
"tokens_input": 0,
"tokens_output": 0
}
],
"period_end": "string",
"period_start": "string",
"prior_total_cost_millicents": 0,
"prior_total_tokens": 0,
"total_cost_millicents": 0,
"total_tokens": 0
}import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.usage()
print(result){
"by_model": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"model_id": "string",
"tokens": 0
}
],
"daily": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"date": "string",
"tokens": 0,
"tokens_cache_creation": 0,
"tokens_cache_read": 0,
"tokens_input": 0,
"tokens_output": 0
}
],
"period_end": "string",
"period_start": "string",
"prior_total_cost_millicents": 0,
"prior_total_tokens": 0,
"total_cost_millicents": 0,
"total_tokens": 0
}import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.usage();
console.log(result);{
"by_model": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"model_id": "string",
"tokens": 0
}
],
"daily": [
{
"cost_fee_millicents": 0,
"cost_sandbox_cpu_millicents": 0,
"cost_sandbox_memory_millicents": 0,
"cost_tokens_millicents": 0,
"date": "string",
"tokens": 0,
"tokens_cache_creation": 0,
"tokens_cache_read": 0,
"tokens_input": 0,
"tokens_output": 0
}
],
"period_end": "string",
"period_start": "string",
"prior_total_cost_millicents": 0,
"prior_total_tokens": 0,
"total_cost_millicents": 0,
"total_tokens": 0
}No request body.
{
"properties": {
"by_model": {
"items": {
"properties": {
"cost_fee_millicents": {
"type": "integer"
},
"cost_sandbox_cpu_millicents": {
"type": "integer"
},
"cost_sandbox_memory_millicents": {
"type": "integer"
},
"cost_tokens_millicents": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"tokens": {
"type": "integer"
}
},
"required": [
"model_id",
"tokens",
"cost_tokens_millicents",
"cost_sandbox_cpu_millicents",
"cost_sandbox_memory_millicents",
"cost_fee_millicents"
],
"type": "object"
},
"type": "array"
},
"daily": {
"items": {
"properties": {
"cost_fee_millicents": {
"type": "integer"
},
"cost_sandbox_cpu_millicents": {
"type": "integer"
},
"cost_sandbox_memory_millicents": {
"type": "integer"
},
"cost_tokens_millicents": {
"type": "integer"
},
"date": {
"type": "string"
},
"tokens": {
"type": "integer"
},
"tokens_cache_creation": {
"type": "integer"
},
"tokens_cache_read": {
"type": "integer"
},
"tokens_input": {
"type": "integer"
},
"tokens_output": {
"type": "integer"
}
},
"required": [
"date",
"tokens",
"tokens_input",
"tokens_output",
"tokens_cache_read",
"tokens_cache_creation",
"cost_tokens_millicents",
"cost_sandbox_cpu_millicents",
"cost_sandbox_memory_millicents",
"cost_fee_millicents"
],
"type": "object"
},
"type": "array"
},
"period_end": {
"type": "string"
},
"period_start": {
"type": "string"
},
"prior_total_cost_millicents": {
"type": "integer"
},
"prior_total_tokens": {
"type": "integer"
},
"total_cost_millicents": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
},
"required": [
"period_start",
"period_end",
"total_tokens",
"total_cost_millicents",
"prior_total_tokens",
"prior_total_cost_millicents",
"daily",
"by_model"
],
"type": "object"
}