HydraCore
API by router

Usage internal

Record Usage

Record a usage event from the agent runtime. Proxy-key auth.

POST
/internal/v1/instances/{instance_id}/usage

Path Parameters

instance_idInstance Id
Formatuuid
conversation_id?Conversation Id
cost_platform_usd?Cost Platform Usd
cost_tenant_usd?Cost Tenant Usd
duration_seconds?Duration Seconds
is_byok?Is Byok
Defaultfalse
key_source?Key Source
Default"platform"
Lengthlength <= 20
modalityModality
Lengthlength <= 30
model_slugModel Slug
Lengthlength <= 100
providerProvider
Lengthlength <= 50
request_id?Request Id
task?Task
tokens_cached?Tokens Cached
tokens_input?Tokens Input
tokens_output?Tokens Output
total_ms?Total Ms
ttft_ms?Ttft Ms
units?Units

Response Body

curl -X POST "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage" \  -H "Content-Type: application/json" \  -d '{    "modality": "string",    "model_slug": "string",    "provider": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Get Spend

Get real-time daily spend from Redis. Proxy-key auth.

GET
/internal/v1/instances/{instance_id}/usage/spend

Path Parameters

instance_idInstance Id
Formatuuid

Response Body

curl -X GET "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/spend"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}