API by router
Credits
POST
instance_id*Instance IdFormat
uuidapplication/json- body
Pre-call credit check request from the VPS agent.
conversation_id?|nullestimated_tokens_in*Estimated Tokens InRange
0 <= value <= 200000estimated_tokens_out*Estimated Tokens OutRange
0 <= value <= 200000key_source?Key SourceMatch
^(platform|tenant|end_user)$Default
"platform"model*ModelLength
1 <= length <= 100request_id*Request IdLength
1 <= length <= 64Successful Response
application/json- response
allowed*Allowedbyok_exempt?Byok ExemptDefault
falsecredits_held?Credits HeldDefault
0credits_remaining?Credits RemainingDefault
0hold_id?string|nullmessage?string|nullretry_after_seconds?integer|nullserver_key_source?Server Key SourceDefault
"platform"tier_limits?|nullcurl -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 }}POST
instance_id*Instance IdFormat
uuidapplication/json- body
Release a credit hold when an LLM call fails.
hold_id*Hold IdLength
1 <= length <= 64request_id*Request IdLength
1 <= length <= 64Successful Response
application/json- response
message?string|nullreleased*Releasedcurl -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}