HydraCore
API by router

Credits

Credit Check

POST
/internal/v1/instances/{instance_id}/credit-check

Path Parameters

instance_id*Instance Id
Formatuuid

Request Body

application/json
  1. body

Pre-call credit check request from the VPS agent.

conversation_id?|null
estimated_tokens_in*Estimated Tokens In
Range0 <= value <= 200000
estimated_tokens_out*Estimated Tokens Out
Range0 <= value <= 200000
key_source?Key Source
Match^(platform|tenant|end_user)$
Default"platform"
model*Model
Length1 <= length <= 100
request_id*Request Id
Length1 <= length <= 64

Response Body

Successful Response

application/json
  1. response
allowed*Allowed
byok_exempt?Byok Exempt
Defaultfalse
credits_held?Credits Held
Default0
credits_remaining?Credits Remaining
Default0
hold_id?string|null
message?string|null
retry_after_seconds?integer|null
server_key_source?Server Key Source
Default"platform"
tier_limits?|null
Example Request
curl -X POST 'https://example.com/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/credit-check' \  -H 'Content-Type: application/json' \  -d '{  "estimated_tokens_in": 0,  "estimated_tokens_out": 0,  "model": "string",  "request_id": "string"}'
Example Response
{  "allowed": true,  "byok_exempt": false,  "credits_held": 0,  "credits_remaining": 0,  "hold_id": "string",  "message": "string",  "retry_after_seconds": 0,  "server_key_source": "platform",  "tier_limits": {    "api_calls_remaining_monthly": 0,    "max_tokens_per_request": 0,    "requests_remaining_this_minute": 0,    "requests_remaining_today": 0,    "token_allowance_remaining_monthly": 0  }}

Credit Release

POST
/internal/v1/instances/{instance_id}/credit-release

Path Parameters

instance_id*Instance Id
Formatuuid

Request Body

application/json
  1. body

Release a credit hold when an LLM call fails.

hold_id*Hold Id
Length1 <= length <= 64
request_id*Request Id
Length1 <= length <= 64

Response Body

Successful Response

application/json
  1. response
message?string|null
released*Released
Example Request
curl -X POST 'https://example.com/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/credit-release' \  -H 'Content-Type: application/json' \  -d '{  "hold_id": "string",  "request_id": "string"}'
Example Response
{  "message": "string",  "released": true}