{"openapi":"3.1.1","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"DeepXRoute public API","version":"1.11.0","description":"API-key integration for text generation, model discovery, media jobs and USD usage/balance reporting, plus separately authenticated API-key and supplier-credential management. Request activation is separate from authentication. Console signup, checkout, profiles, invoices and administration use session-authenticated /api routes and are not public API-key operations. JSON accounting amounts are nanoUSD integer strings unless a field explicitly documents the legacy numeric catalog representation. 1 USD = 1,000,000,000 nanoUSD. Use integer/decimal arithmetic. All API responses use Cache-Control: no-store. A global limit of 300 requests/minute/IP also applies. Reverse-proxy/network errors can have non-JSON bodies."},"servers":[{"url":"https://api.deepxroute.com","description":"Production API. Override explicitly when testing a local environment."}],"externalDocs":{"url":"https://console.deepxroute.com/setup#api-reference","description":"Setup and integration guide"},"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"tags":[{"name":"Presets","description":"Account-owned, versioned model, prompt, parameter and function-tool configurations. Separate presets:read/write management permissions."},{"name":"Supplier key management","description":"Separate provider-keys:read/write permissions. Metadata only; no saved secret recovery. Writes can change supplier access and platform-spending consent."},{"name":"Key management","description":"Separate scoped management credentials created in the console. Cannot run inference, access payments or administer accounts."},{"name":"Models","description":"Discover model IDs, exact prices and configured capabilities."},{"name":"Text","description":"Compatible text interfaces with usage accounting and optional SSE streaming."},{"name":"Keys","description":"Read the current API key's policy; this is not a management API."},{"name":"Usage","description":"Self-scoped usage by default; account reads require explicit billing permission."},{"name":"Media","description":"Submit, poll, cancel queued jobs and retrieve private outputs with the originating key."}],"paths":{"/v1/presets":{"get":{"operationId":"listPresets","tags":["Presets"],"summary":"List account presets","description":"Requires presets:read. Presets and history are scoped to the credential's account; another account returns 404. No inference occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetList"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"25 presets per page, including archived history."}]},"post":{"operationId":"createPreset","tags":["Presets"],"summary":"Create a versioned preset","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePreset"},"example":{"requestId":"11111111-1111-4111-8111-111111111111","slug":"code-reviewer","name":"Code reviewer","config":{"models":["dxr-coder-pro"],"systemPrompt":"Review code clearly.","parameters":{"temperature":0.2,"max_tokens":512},"tools":[]}}}}}}},"/v1/presets/{slug}":{"get":{"operationId":"getPreset","tags":["Presets"],"summary":"Read a preset and active configuration","description":"Requires presets:read. Presets and history are scoped to the credential's account; another account returns 404. No inference occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preset"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}}]},"patch":{"operationId":"updatePreset","tags":["Presets"],"summary":"Edit metadata or save a new active version","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePreset"},"example":{"requestId":"11111111-1111-4111-8111-111111111111","revision":1,"config":{"models":["dxr-coder-pro"],"systemPrompt":"Review code clearly.","parameters":{"temperature":0.2,"max_tokens":512},"tools":[]}}}}}},"delete":{"operationId":"archivePreset","tags":["Presets"],"summary":"Archive a preset and retain immutable history","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetControl"},"example":{"requestId":"11111111-1111-4111-8111-111111111111","revision":1}}}}}},"/v1/presets/{slug}/versions":{"get":{"operationId":"listPresetVersions","tags":["Presets"],"summary":"List immutable preset versions","description":"Requires presets:read. Presets and history are scoped to the credential's account; another account returns 404. No inference occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetVersionList"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}}]}},"/v1/presets/{slug}/versions/{version}":{"get":{"operationId":"getPresetVersion","tags":["Presets"],"summary":"Read a saved preset configuration","description":"Requires presets:read. Presets and history are scoped to the credential's account; another account returns 404. No inference occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetVersion"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":100}}]}},"/v1/presets/{slug}/activate":{"post":{"operationId":"activatePresetVersion","tags":["Presets"],"summary":"Restore a saved version for future requests","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivatePreset"},"example":{"requestId":"11111111-1111-4111-8111-111111111111","revision":2,"version":1}}}}}},"/v1/presets/{slug}/chat/completions":{"post":{"operationId":"importPresetchat_completions","tags":["Presets"],"summary":"Save a preset from chat/completions","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials. Import only concrete model IDs, supported parameters and client function tools. Nested preset references and unsupported settings are rejected. Conversation/input/stream fields are discarded; system/developer instructions are extracted. Different protocol tool shapes are normalized. No inference or charge occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Stable UUID for this import. Retain on retry."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"integer","minimum":1},"description":"Required current revision when updating an existing slug. Omit only for a new preset."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"},"example":{"model":"dxr-coder-pro","messages":[{"role":"system","content":"Review code clearly."},{"role":"user","content":"Transient example"}],"temperature":0.2}}}}}},"/v1/presets/{slug}/messages":{"post":{"operationId":"importPresetmessages","tags":["Presets"],"summary":"Save a preset from messages","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials. Import only concrete model IDs, supported parameters and client function tools. Nested preset references and unsupported settings are rejected. Conversation/input/stream fields are discarded; system/developer instructions are extracted. Different protocol tool shapes are normalized. No inference or charge occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Stable UUID for this import. Retain on retry."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"integer","minimum":1},"description":"Required current revision when updating an existing slug. Omit only for a new preset."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequest"},"example":{"model":"dxr-coder-pro","system":"Review code clearly.","messages":[{"role":"user","content":"Transient example"}],"max_tokens":512}}}}}},"/v1/presets/{slug}/responses":{"post":{"operationId":"importPresetresponses","tags":["Presets"],"summary":"Save a preset from responses","description":"Requires presets:write. Writes are serialized per account. Supply a fresh requestId for each intended change; retry the same body/reference after an uncertain response. A repeated request returns its original mutation receipt with replayed:true, even after later edits. Reload current metadata afterward. Changed content under the same ID returns 409. Revisions prevent stale edits. Presets are shared within the account; management credentials do not authorize inference. Up to 50 retained presets/account, 100 immutable versions/preset, 128 KiB/config and 32 JSON nesting levels. Saved prompts and tool definitions are retained; never embed credentials. Import only concrete model IDs, supported parameters and client function tools. Nested preset references and unsupported settings are rejected. Conversation/input/stream fields are discarded; system/developer instructions are extracted. Different protocol tool shapes are normalized. No inference or charge occurs.","responses":{"200":{"description":"Preset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetMutation"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Stable UUID for this import. Retain on retry."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"integer","minimum":1},"description":"Required current revision when updating an existing slug. Omit only for a new preset."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRequest"},"example":{"model":"dxr-coder-pro","instructions":"Review code clearly.","input":"Transient example"}}}}}},"/v1/keys":{"get":{"operationId":"listManagedKeys","tags":["Key management"],"summary":"List account API keys","description":"Requires keys:read on a separate management credential. Lists this account's inference API key metadata, including revoked/expired keys, but never secrets. Page size 25; 60 management calls/minute/account.","responses":{"200":{"description":"Key page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedKeyList"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"Page number."}]},"post":{"operationId":"createManagedKey","tags":["Key management"],"summary":"Create an inference API key","description":"Requires keys:write. Supply a UUID requestId and retain it with the normalized settings. Concurrent and later identical retries with the same management credential return the same key secret; differing settings return 409. An expired management credential cannot recover a response, and a revoked child key cannot be recreated with its old requestId. At most 10 unrevoked inference keys per account, shared with console creation. Secrets are not returned by list/get. All keys share the account wallet.","responses":{"200":{"description":"Created or recovered key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManagedKey"},"example":{"requestId":"c566337e-ed82-4fb9-b4e5-5c7a85e1b9bf","name":"Production app","budgetNanoUsd":"10000000000","budgetPeriod":"monthly","allowedModels":["dxr-coder-pro"],"billingRead":false}}}}}},"/v1/keys/{id}":{"get":{"operationId":"getManagedKey","tags":["Key management"],"summary":"Read an account API key","description":"Requires keys:read. Returns owned inference-key metadata and current spending/held amounts in integer nanoUSD. No plaintext key or token hash is exposed.","responses":{"200":{"description":"Key metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Inference API key UUID; management credentials and internal workspace keys cannot be targeted."}]},"patch":{"operationId":"updateManagedKey","tags":["Key management"],"summary":"Update an account API key","description":"Requires keys:write. Send the latest revision from list/get; a stale revision returns 409. Omitted fields stay unchanged, null clears a budget/expiry/model allowlist, and an empty model allowlist blocks every model. Budget changes do not reset usage. Revoked keys cannot be restored. Requires future expiry when a non-null expiry is supplied.","responses":{"200":{"description":"Policy saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagementOk"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Inference API key UUID; management credentials and internal workspace keys cannot be targeted."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateManagedKey"},"example":{"revision":1,"budgetNanoUsd":"5000000000"}}}}},"delete":{"operationId":"revokeManagedKey","tags":["Key management"],"summary":"Revoke an account API key","description":"Requires keys:write. Revocation is idempotent and cannot be undone. New requests are denied; already accepted requests may still finish and settle. Does not delete usage history or revoke other keys.","responses":{"200":{"description":"Key revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagementOk"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Inference API key UUID; management credentials and internal workspace keys cannot be targeted."}]}},"/v1/provider-keys":{"get":{"operationId":"listProviderKeys","tags":["Supplier key management"],"summary":"List supplier credentials","description":"Requires provider-keys:read. Returns only this account's metadata, including revoked/expired keys. Never returns plaintext, ciphertext, wrapping-key IDs or creation digests. Shared limit: 60 management calls/minute/account.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKeyList"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"25 records per page, newest first; includes retired credentials."}]},"post":{"operationId":"createProviderKey","tags":["Supplier key management"],"summary":"Store a supplier credential","description":"Requires provider-keys:write. At most ten unrevoked supplier keys across console and API creation. requestId is account-wide: identical normalized settings, including the supplied secret, return existing metadata; changed settings, any edit or revocation returns 409. Retain the original UUID and settings on uncertain responses, even when switching management credentials. Defaults: enabled, primary stage, priority 100, unrestricted models/application keys, no expiry, no platform fallback. Primary keys run before permitted platform routes; backup keys run afterward. The combined plan has at most eight attempts (one with allow_fallbacks:false) and advances only after a confirmed non-billable rejection. Stage alone never permits platform spending. Empty filter arrays are invalid. Provider and model must be enabled for BYOK; selected application keys must be active owned inference keys. A saved credential does not prove supplier access. No password field is accepted.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderKey"},"example":{"requestId":"c566337e-ed82-4fb9-b4e5-5c7a85e1b9bf","provider":"configured-supplier","name":"Production supplier","secret":"SUPPLIER_API_KEY_PLACEHOLDER","allowedModels":["dxr-coder-pro"],"allowPlatformFallback":false}}}}}},"/v1/provider-keys/{id}":{"get":{"operationId":"getProviderKey","tags":["Supplier key management"],"summary":"Read supplier credential metadata","description":"Requires provider-keys:read. An unknown or foreign credential returns 404. Includes retained metadata for revoked credentials; never returns a stored secret.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Owned supplier credential UUID; never a supplier secret or inference API key ID."}]},"patch":{"operationId":"updateProviderKey","tags":["Supplier key management"],"summary":"Update supplier credential policy","description":"Requires provider-keys:write and latest revision. Omission preserves a field; null clears expiry or filters. Both filters must match. Newly selected application keys must be active and owned; retained retired references may remain but grant no usable access. Unselected apps skip this credential and its fallback preference and may use platform capacity in auto mode. platformFallbackPolicy selects allow, deny_model, deny_provider or legacy deny_all; it is mutually exclusive with allowPlatformFallback. Supplier-scoped restrictions can permit full-price platform usage through other suppliers. Changing routingStage moves the key within future plans without changing platform-spending consent; a changed revision invalidates an in-flight planned attempt. Changes never replace a secret. Stale revision returns 409; revoked credentials return 404.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Owned supplier credential UUID; never a supplier secret or inference API key ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProviderKey"},"example":{"revision":1,"allowedApiKeys":["c566337e-ed82-4fb9-b4e5-5c7a85e1b9bf"],"allowPlatformFallback":false}}}}},"delete":{"operationId":"revokeProviderKey","tags":["Supplier key management"],"summary":"Revoke a supplier credential","description":"Requires provider-keys:write. Idempotent permanent revocation erases the encrypted secret while retaining policy/history. It does not grant platform-fallback consent. Already authorized supplier calls may finish. Works even when the provider or encryption configuration is removed. Accepts no request body or query parameters.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagementOk"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Owned supplier credential UUID; never a supplier secret or inference API key ID."}]}},"/v1/provider-keys/{id}/rotate":{"post":{"operationId":"rotateProviderKey","tags":["Supplier key management"],"summary":"Replace a supplier secret","description":"Requires provider-keys:write and the current revision. Preserves policy and increments both revision and secret_version. A lost response must be resolved by reading metadata before another rotation; replaying the old revision returns 409. Already authorized calls may finish with the previous secret. Never returns either secret.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKey"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Owned supplier credential UUID; never a supplier secret or inference API key ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateProviderKey"},"example":{"revision":1,"secret":"REPLACEMENT_SUPPLIER_KEY_PLACEHOLDER"}}}}}},"/v1/provider-keys/settings":{"get":{"operationId":"getProviderKeySettings","tags":["Supplier key management"],"summary":"Read supplier routing configuration","description":"Requires provider-keys:read. Returns account default/revision, configured suppliers and model IDs, key-storage availability and separate BYOK fee policy. Availability does not confirm pricing activation, wallet funding or supplier acceptance. No secrets, private routes or supplier model IDs are exposed.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKeySettings"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}]},"patch":{"operationId":"updateProviderKeySettings","tags":["Supplier key management"],"summary":"Change the account credential default","description":"Requires provider-keys:write and latest revision. auto follows primary keys, permitted platform routes, then backup keys and obeys saved fallback policies; byok only uses eligible saved credentials; platform explicitly permits full-price platform billing. Applies to requests with no explicit credential mode. In-flight requests recheck the account mode before another attempt. This permission can change spending behavior; stale revisions return 409.","responses":{"200":{"description":"Supplier credential metadata or settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKeyMode"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"managementBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProviderKeySettings"},"example":{"mode":"byok","revision":1}}}}}},"/v1/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List available models","description":"Defaults to text models. Returns configured/priced models visible to this key, including provisional models. The allowlist applies; active pricing does not bypass wallet or key budgets. 60 discovery reads/minute/account. Unknown list query parameters are rejected.","responses":{"200":{"description":"Model catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":150,"default":""},"description":"Case-insensitive substring search over trimmed name and ID."},{"name":"output_modalities","in":"query","required":false,"schema":{"type":"string","enum":["all","text","image","video"],"default":"text"},"description":"Output type."},{"name":"availability","in":"query","required":false,"schema":{"type":"string","enum":["all","active","preview","unavailable"],"default":"all"},"description":"Activation status. Preview prices do not allow inference."}]}},"/v1/models/{id}":{"get":{"operationId":"getModel","tags":["Models"],"summary":"Get a model","description":"Returns one model object. A missing or disallowed model returns 404. Shares the discovery read limit.","responses":{"200":{"description":"Model details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"description":"Exact model ID from the catalog; URL-encode path segments."}]}},"/v1/key":{"get":{"operationId":"getCurrentKey","tags":["Keys"],"summary":"Inspect your API key","description":"Returns policy, settled spending and outstanding holds, never the key secret. Monthly budgets use UTC settlement months and carry outstanding holds from earlier months. 60 reads/minute/key. This endpoint grants no key-management access.","responses":{"200":{"description":"Current key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyStatus"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Text"],"summary":"Create a chat completion","description":"Text and client-executed function calls only. Send the conversation on every request. No image/audio/file inputs, server-hosted tools, background work, stored responses or previous_response_id. Raw credential/destination overrides (api_key, api_base, base_url, extra_headers, litellm_params, custom_llm_provider, deployment_id) return 400 before reservation. Other unknown top-level fields are generally dropped, not forwarded. Provider-specific fields inside forwarded structures are subject to the upstream interface. Check the model's configured gateway limits and availability. Admission reserves maximum possible cost, settles reported usage and holds unconfirmed usage for review. Each POST is a new potentially billable request: Idempotency-Key does not deduplicate text generation. Disable SDK automatic retries. 60 inference requests/minute/account.","responses":{"200":{"description":"Upstream-compatible JSON or SSE when stream=true. The gateway preserves upstream response fields. Missing/invalid usage can leave credit held even when a response body is delivered.","headers":{"x-request-id":{"description":"Inference reference for usage/support. Present after reservation; use error.request_id for earlier application errors.","schema":{"type":"string"}},"x-dxr-provider":{"description":"Provider ID of the last attempt, once response headers were received. An accepted response does not guarantee usable output or settled usage.","schema":{"type":"string"}},"x-dxr-preset-id":{"schema":{"type":"string","format":"uuid"},"description":"Resolved preset ID, when a preset was used."},"x-dxr-preset-version":{"schema":{"type":"string"},"description":"Immutable preset version reserved for this request."},"x-dxr-model":{"description":"Public model ID selected for the responding attempt. This identifies the model used for DeepXRoute pricing, even when the upstream response names a private provider alias. An accepted response is not proof of settled usage.","schema":{"type":"string"}},"x-dxr-attempts":{"description":"Number of provider attempts for this inference reservation (1–8). No attempt is repeated automatically after an ambiguous outcome.","schema":{"type":"integer","minimum":1,"maximum":8}},"x-dxr-billing-mode":{"description":"Selected attempt uses platform-funded capacity or a saved customer provider key. BYOK costs in DeepXRoute reports are platform fees only; supplier charges are separate.","schema":{"type":"string","enum":["platform","byok"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string","description":"Chat completion chunk events, ending with data: [DONE]. Usage is requested automatically. An interrupted stream may have no terminal event."}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet credit or API-key spending budget for the reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds the application or edge limit (approximately 2 MB). An edge rejection may use a plain-text response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Content-Type. Send application/json for request bodies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream response could not be confirmed. Credit may remain held for review. Do not automatically repeat text generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"},"example":{"model":"dxr-coder-pro","messages":[{"role":"user","content":"Hello!"}],"max_completion_tokens":256}}}}}},"/v1/responses":{"post":{"operationId":"createResponse","tags":["Text"],"summary":"Create a response","description":"Text and client-executed function calls only. Send the conversation on every request. No image/audio/file inputs, server-hosted tools, background work, stored responses or previous_response_id. Raw credential/destination overrides (api_key, api_base, base_url, extra_headers, litellm_params, custom_llm_provider, deployment_id) return 400 before reservation. Other unknown top-level fields are generally dropped, not forwarded. Provider-specific fields inside forwarded structures are subject to the upstream interface. Check the model's configured gateway limits and availability. Admission reserves maximum possible cost, settles reported usage and holds unconfirmed usage for review. Each POST is a new potentially billable request: Idempotency-Key does not deduplicate text generation. Disable SDK automatic retries. 60 inference requests/minute/account. The gateway forces store=false.","responses":{"200":{"description":"Upstream-compatible response JSON, or named SSE events ending in response.completed on successful completion. Interrupted streams and response.failed require reconciliation; do not infer a refund from an interrupted connection.","headers":{"x-request-id":{"description":"Inference reference for usage/support. Present after reservation; use error.request_id for earlier application errors.","schema":{"type":"string"}},"x-dxr-provider":{"description":"Provider ID of the last attempt, once response headers were received. An accepted response does not guarantee usable output or settled usage.","schema":{"type":"string"}},"x-dxr-preset-id":{"schema":{"type":"string","format":"uuid"},"description":"Resolved preset ID, when a preset was used."},"x-dxr-preset-version":{"schema":{"type":"string"},"description":"Immutable preset version reserved for this request."},"x-dxr-model":{"description":"Public model ID selected for the responding attempt. This identifies the model used for DeepXRoute pricing, even when the upstream response names a private provider alias. An accepted response is not proof of settled usage.","schema":{"type":"string"}},"x-dxr-attempts":{"description":"Number of provider attempts for this inference reservation (1–8). No attempt is repeated automatically after an ambiguous outcome.","schema":{"type":"integer","minimum":1,"maximum":8}},"x-dxr-billing-mode":{"description":"Selected attempt uses platform-funded capacity or a saved customer provider key. BYOK costs in DeepXRoute reports are platform fees only; supplier charges are separate.","schema":{"type":"string","enum":["platform","byok"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string","description":"Responses SSE event stream with type-tagged JSON payloads."}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet credit or API-key spending budget for the reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds the application or edge limit (approximately 2 MB). An edge rejection may use a plain-text response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Content-Type. Send application/json for request bodies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream response could not be confirmed. Credit may remain held for review. Do not automatically repeat text generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRequest"},"example":{"model":"dxr-coder-pro","input":"Hello!","max_output_tokens":256,"store":false}}}}}},"/v1/messages":{"post":{"operationId":"createMessage","tags":["Text"],"summary":"Create an Anthropic-compatible message","description":"Text and client-executed function calls only. Send the conversation on every request. No image/audio/file inputs, server-hosted tools, background work, stored responses or previous_response_id. Raw credential/destination overrides (api_key, api_base, base_url, extra_headers, litellm_params, custom_llm_provider, deployment_id) return 400 before reservation. Other unknown top-level fields are generally dropped, not forwarded. Provider-specific fields inside forwarded structures are subject to the upstream interface. Check the model's configured gateway limits and availability. Admission reserves maximum possible cost, settles reported usage and holds unconfirmed usage for review. Each POST is a new potentially billable request: Idempotency-Key does not deduplicate text generation. Disable SDK automatic retries. 60 inference requests/minute/account. The upstream anthropic-version is fixed to 2023-06-01; a client header does not select another version.","responses":{"200":{"description":"Upstream-compatible message JSON, or message/content-block SSE events through message_stop. Responses use DeepXRoute's application error envelope before streaming begins.","headers":{"x-request-id":{"description":"Inference reference for usage/support. Present after reservation; use error.request_id for earlier application errors.","schema":{"type":"string"}},"x-dxr-provider":{"description":"Provider ID of the last attempt, once response headers were received. An accepted response does not guarantee usable output or settled usage.","schema":{"type":"string"}},"x-dxr-preset-id":{"schema":{"type":"string","format":"uuid"},"description":"Resolved preset ID, when a preset was used."},"x-dxr-preset-version":{"schema":{"type":"string"},"description":"Immutable preset version reserved for this request."},"x-dxr-model":{"description":"Public model ID selected for the responding attempt. This identifies the model used for DeepXRoute pricing, even when the upstream response names a private provider alias. An accepted response is not proof of settled usage.","schema":{"type":"string"}},"x-dxr-attempts":{"description":"Number of provider attempts for this inference reservation (1–8). No attempt is repeated automatically after an ambiguous outcome.","schema":{"type":"integer","minimum":1,"maximum":8}},"x-dxr-billing-mode":{"description":"Selected attempt uses platform-funded capacity or a saved customer provider key. BYOK costs in DeepXRoute reports are platform fees only; supplier charges are separate.","schema":{"type":"string","enum":["platform","byok"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}},"text/event-stream":{"schema":{"type":"string","description":"Anthropic-compatible SSE event stream. Usage can arrive across message_start and message_delta."}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet credit or API-key spending budget for the reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds the application or edge limit (approximately 2 MB). An edge rejection may use a plain-text response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Content-Type. Send application/json for request bodies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream response could not be confirmed. Credit may remain held for review. Do not automatically repeat text generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequest"},"example":{"model":"dxr-coder-pro","messages":[{"role":"user","content":"Hello!"}],"max_tokens":256}}}}}},"/v1/billing/balance":{"get":{"operationId":"getBalance","tags":["Usage"],"summary":"Read account balance","description":"Requires billing_read=true. Returns the entire account wallet, not a per-key budget. Available credit is balance minus reserved; it may be negative after an authoritative refund/dispute. 60 reads/minute/account.","responses":{"200":{"description":"USD wallet balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage/report":{"get":{"operationId":"getUsageReport","tags":["Usage"],"summary":"Group usage and cost","description":"Unknown query parameters are rejected. Finished requests use their settlement time; open/review requests use their start time. Totals and rows share one database snapshot per response. Subsequent pages may change as new work settles. Amounts are integer nanoUSD strings. cost equals platform_cost plus byok_fee. BYOK charges here are DeepXRoute fees only; supplier-direct charges are not included. A report's held amount covers only its filters; wallet balance includes all holds. Report/record reads share 60 requests/minute/account; exports allow 6/minute/account. Groups are sorted by their grouping columns; summary covers all matching rows, not just the page. Group fields depend on groupBy.","responses":{"200":{"description":"Grouped usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Inclusive UTC date. Supply start and end together, or omit both for this UTC month through today."},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Exclusive UTC date. The interval must contain 1–180 days."},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["self","account"],"default":"self"},"description":"Account scope requires the key's explicit billing_read permission. Self scope includes only this key."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["all","chat","image","video"],"default":"all"},"description":"Output type."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["all","completed","pending","review","failed"],"default":"all"},"description":"Failed includes cancelled media; queued/submitting/running media are pending."},{"name":"model","in":"query","required":false,"schema":{"type":"string","maxLength":150},"description":"Exact model ID after trimming. Omit or use an empty string for all models."},{"name":"keyId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Account scope: one key or console/unattributed work. Self scope: only the calling key UUID is allowed."},{"name":"memberId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Filter by immutable team membership ID, including departed members, or unattributed personal/historical work. Always intersects the calling key's scope; it never grants another member's usage. Member email addresses are not included."},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","enum":["day","model","key","model-key","day-model-key","member","day-member","model-member"],"default":"day"},"description":"Used by /report. Accepted but ignored by /records and /export."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page. Accepted but ignored by CSV export."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Rows per page. Accepted but ignored by CSV export."}]}},"/v1/usage/records":{"get":{"operationId":"listUsageRecords","tags":["Usage"],"summary":"List individual usage records","description":"Unknown query parameters are rejected. Finished requests use their settlement time; open/review requests use their start time. Totals and rows share one database snapshot per response. Subsequent pages may change as new work settles. Amounts are integer nanoUSD strings. cost equals platform_cost plus byok_fee. BYOK charges here are DeepXRoute fees only; supplier-direct charges are not included. A report's held amount covers only its filters; wallet balance includes all holds. Report/record reads share 60 requests/minute/account; exports allow 6/minute/account. Records are sorted by event_at descending, then ID descending. Historical media and console activity may be unattributed. Prompts and generated output are excluded.","responses":{"200":{"description":"Individual usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRecords"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Inclusive UTC date. Supply start and end together, or omit both for this UTC month through today."},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Exclusive UTC date. The interval must contain 1–180 days."},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["self","account"],"default":"self"},"description":"Account scope requires the key's explicit billing_read permission. Self scope includes only this key."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["all","chat","image","video"],"default":"all"},"description":"Output type."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["all","completed","pending","review","failed"],"default":"all"},"description":"Failed includes cancelled media; queued/submitting/running media are pending."},{"name":"model","in":"query","required":false,"schema":{"type":"string","maxLength":150},"description":"Exact model ID after trimming. Omit or use an empty string for all models."},{"name":"keyId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Account scope: one key or console/unattributed work. Self scope: only the calling key UUID is allowed."},{"name":"memberId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Filter by immutable team membership ID, including departed members, or unattributed personal/historical work. Always intersects the calling key's scope; it never grants another member's usage. Member email addresses are not included."},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","enum":["day","model","key","model-key","day-model-key","member","day-member","model-member"],"default":"day"},"description":"Used by /report. Accepted but ignored by /records and /export."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page. Accepted but ignored by CSV export."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Rows per page. Accepted but ignored by CSV export."}]}},"/v1/usage/export":{"get":{"operationId":"exportUsageCsv","tags":["Usage"],"summary":"Export usage as CSV","description":"Unknown query parameters are rejected. Finished requests use their settlement time; open/review requests use their start time. Totals and rows share one database snapshot per response. Subsequent pages may change as new work settles. Amounts are integer nanoUSD strings. cost equals platform_cost plus byok_fee. BYOK charges here are DeepXRoute fees only; supplier-direct charges are not included. A report's held amount covers only its filters; wallet balance includes all holds. Report/record reads share 60 requests/minute/account; exports allow 6/minute/account. Exports all matching individual rows in one snapshot, ignoring pagination/grouping. Above 10,000 rows returns 422 instead of truncating. USD decimals have nine places. Text cells are spreadsheet-formula neutralized. This is a usage extract, not an invoice.","responses":{"200":{"description":"CSV with reference, UTC event/start/settlement times, type, model, key ID/name, status, tokens, cost_usd, held_usd, currency, price_version, billing_mode, byok_fee_basis_points, byok_fee_version, provider_key_id, provider_secret_version, member_id, requested_model, preset_id, preset_version and preset_slug. Routing attribution identifies the original first requested model and admitted preset version, not current configuration. Member IDs preserve team attribution including console work and departed members; personal/unattributed work has a blank ID. No member email addresses. BYOK cost is the platform fee only; supplier-direct charges are separate. An empty result contains a header row.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"Attachment filename includes the applied UTC date range."}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"More than 10,000 usage rows match the CSV export; narrow dates/filters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"start","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Inclusive UTC date. Supply start and end together, or omit both for this UTC month through today."},{"name":"end","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Exclusive UTC date. The interval must contain 1–180 days."},{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["self","account"],"default":"self"},"description":"Account scope requires the key's explicit billing_read permission. Self scope includes only this key."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["all","chat","image","video"],"default":"all"},"description":"Output type."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["all","completed","pending","review","failed"],"default":"all"},"description":"Failed includes cancelled media; queued/submitting/running media are pending."},{"name":"model","in":"query","required":false,"schema":{"type":"string","maxLength":150},"description":"Exact model ID after trimming. Omit or use an empty string for all models."},{"name":"keyId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Account scope: one key or console/unattributed work. Self scope: only the calling key UUID is allowed."},{"name":"memberId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["unattributed"]}]},"description":"Filter by immutable team membership ID, including departed members, or unattributed personal/historical work. Always intersects the calling key's scope; it never grants another member's usage. Member email addresses are not included."},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","enum":["day","model","key","model-key","day-model-key","member","day-member","model-member"],"default":"day"},"description":"Used by /report. Accepted but ignored by /records and /export."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page. Accepted but ignored by CSV export."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Rows per page. Accepted but ignored by CSV export."}]}},"/v1/media/catalog":{"get":{"operationId":"getMediaCatalog","tags":["Media"],"summary":"Read media options and activation","description":"Key allowlists apply. Legacy catalog models can include supported sizes without an active configured price; use the prices/previewPrices arrays or unified model discovery to select a priced size. Unlike unified discovery, legacy price.amount is a JSON integer in nanoUSD. No generation is submitted.","responses":{"200":{"description":"Media catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaCatalog"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media/jobs":{"post":{"operationId":"createMediaJob","tags":["Media"],"summary":"Submit an image or video job","description":"Save a new idempotencyKey UUID before submitting. A retry with the same account, originating key and normalized content returns the original job without another reservation. Changed content or another key returns 409. Access and activation checks still apply on retry. Unknown body fields are discarded; seed applies to images only. Current video duration is five seconds. Maximum two queued/submitting/running/review jobs per account. 10 submissions/minute/account. Returned amount is the accepted fixed price, initially held; poll state to learn the result.","responses":{"200":{"description":"New or existing job (both return HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJob"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient wallet credit or API-key spending budget for the reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key does not have the requested model or account billing permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds the application or edge limit (approximately 2 MB). An edge rejection may use a plain-text response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Content-Type. Send application/json for request bodies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pricing or generation is not activated, or the requested service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaRequest"},"example":{"idempotencyKey":"61b3e78b-02dd-438c-bfe8-87c7d4706c49","model":"uhub-lume-base","size":"1024*1024","prompt":"A lighthouse at dawn"}}}}},"get":{"operationId":"listMediaJobs","tags":["Media"],"summary":"List this key's media jobs","description":"Only jobs submitted with this key are returned. Account billing-read permission does not widen media access. Page size is 20; order is created_at descending, then ID descending. Increment page while hasMore is true.","responses":{"200":{"description":"Media job page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobPage"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page; 20 jobs per page."}]}},"/v1/media/jobs/{id}":{"get":{"operationId":"getMediaJob","tags":["Media"],"summary":"Poll a media job","description":"Use the originating key. Poll every few seconds; stop on completed, failed, cancelled or review. Review means credit is held pending reconciliation. Completed charges the accepted fixed price; failed/cancelled releases the hold. Supplier IDs, URLs and credentials are never exposed.","responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJob"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Media job UUID returned by submission. Use its originating API key."}]}},"/v1/media/jobs/{id}/cancel":{"post":{"operationId":"cancelMediaJob","tags":["Media"],"summary":"Cancel a queued job","description":"Only the originating key can cancel, and only while state=queued. Worker races, missing jobs, another key and repeated cancellation return 409. Cancellation releases the hold; it cannot cancel work already sent to the supplier.","responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Submission UUID conflict, or job is no longer queued for cancellation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Media job UUID returned by submission. Use its originating API key."}]}},"/v1/media/jobs/{id}/asset":{"get":{"operationId":"downloadMediaAsset","tags":["Media"],"summary":"Download a completed output","description":"Requires the originating API key and an unexpired completed asset. Outputs are retained for seven days. No signed public link is returned. Single explicit-start byte ranges are supported; suffix/multiple/out-of-bounds ranges return 416. Download before asset_expires_at.","responses":{"200":{"description":"Private output bytes.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"Inline by default; attachment when download=1."},"Content-Length":{"schema":{"type":"integer","minimum":0}},"Accept-Ranges":{"schema":{"type":"string","enum":["bytes"]}}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"Requested byte range.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"Inline by default; attachment when download=1."},"Content-Length":{"schema":{"type":"integer","minimum":0}},"Accept-Ranges":{"schema":{"type":"string","enum":["bytes"]}},"Content-Range":{"schema":{"type":"string"},"description":"bytes start-end/total"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request, unavailable model/size, malformed parameters or unsupported input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked key, or inactive account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found, unavailable, expired or outside this key's access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"Invalid or unsupported range. Empty body.","headers":{"Content-Range":{"schema":{"type":"string"},"description":"bytes */total"}}},"429":{"description":"Rate or active-job limit exceeded. Application responses include Retry-After: 60. Recheck active jobs before retrying media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","example":"60"},"description":"Seconds before retry; the underlying condition must also be resolved."}}},"500":{"description":"Unexpected application error. Retain the reference; do not blindly repeat potentially billable requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Media job UUID returned by submission. Use its originating API key."},{"name":"download","in":"query","required":false,"schema":{"type":"string","examples":["1"]},"description":"Exactly 1 requests attachment disposition; other values keep inline."},{"name":"Range","in":"header","required":false,"schema":{"type":"string","pattern":"^bytes=[0-9]+-[0-9]*$","examples":["bytes=0-1023"]},"description":"Single byte range with an explicit start; omit end to read through the last byte."}]}}},"components":{"securitySchemes":{"managementBearer":{"type":"http","scheme":"bearer","bearerFormat":"DeepXRoute management credential","description":"Use only a dxr-mgmt credential with the operation's explicit keys:read/write or provider-keys:read/write permission. Inference keys, cookies and x-api-key are not accepted for management. Account network/lifetime policies and credential disabling also apply."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"DeepXRoute API key","description":"Authorization: Bearer YOUR_DEEPXROUTE_KEY. Bearer authentication takes precedence if both headers are sent. Disabled credentials are rejected; account network and maximum-lifetime policies apply to existing and new credentials on every key-authenticated endpoint."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Alternative key header, including Anthropic clients. Never put keys in URLs or browser-side code."}},"schemas":{"ProviderKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","minimum":1},"routing_stage":{"type":"string","enum":["primary","backup"]},"enabled":{"type":"boolean"},"allowed_models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"allowed_api_keys":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}]},"allow_platform_fallback":{"type":"boolean","deprecated":true,"description":"Legacy projection: true only for allow. Read platform_fallback_policy for supplier-scoped restrictions."},"platform_fallback_policy":{"type":"string","enum":["allow","deny_model","deny_provider","deny_all"]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expired":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revision":{"type":"integer","minimum":1},"secret_version":{"type":"integer","minimum":1}},"required":["id","provider","name","priority","routing_stage","enabled","allowed_models","allowed_api_keys","allow_platform_fallback","platform_fallback_policy","expires_at","expired","created_at","updated_at","revoked_at","revision","secret_version"],"additionalProperties":false},"ProviderKeyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProviderKey"}},"page":{"type":"integer","minimum":1},"hasMore":{"type":"boolean"}},"required":["items","page","hasMore"],"additionalProperties":false},"CreateProviderKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"priority":{"type":"integer","minimum":1,"maximum":1000,"default":100},"routingStage":{"type":"string","enum":["primary","backup"],"default":"primary","description":"Primary keys run before eligible platform routes; backup keys run afterward. Within each stage, provider order then numeric key priority applies. Stage never grants platform-spending consent. BYOK-only skips platform; platform-only skips both saved-key stages."},"enabled":{"type":"boolean","default":true},"allowedModels":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^(dxr|uhub)-[a-z0-9-]+$"},"minItems":1,"maxItems":100,"uniqueItems":true},{"type":"null"}]},"allowedApiKeys":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"uniqueItems":true},{"type":"null"}]},"allowPlatformFallback":{"type":"boolean","deprecated":true,"description":"Legacy input: true means allow; false means deny_all. Omission on create defaults to deny_all. Do not combine with platformFallbackPolicy. Omission on edit preserves the saved policy."},"platformFallbackPolicy":{"type":"string","enum":["allow","deny_model","deny_provider","deny_all"],"description":"Automatic-mode spending rule. allow permits platform credit subject to other saved policies. deny_model blocks this supplier's platform capacity for matching models. deny_provider blocks this supplier's platform capacity for every model, even outside this key's model filter. deny_all (default, preserving legacy false) blocks all suppliers' platform capacity for matching models. All rules respect application-key filters and persist for disabled/expired keys and the last applicable revoked policy. Other suppliers remain usable under supplier-scoped rules; use provider.only or byok mode for a stricter request. Do not combine with allowPlatformFallback."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"requestId":{"type":"string","format":"uuid"},"provider":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"secret":{"type":"string","minLength":16,"maxLength":4096,"pattern":"^[\\x21-\\x7e]+$","writeOnly":true,"description":"Supplier-issued secret. Stored encrypted and never returned. Send only over HTTPS from trusted server automation."}},"required":["name","requestId","provider","secret"],"additionalProperties":false,"not":{"required":["allowPlatformFallback","platformFallbackPolicy"]}},"UpdateProviderKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"priority":{"type":"integer","minimum":1,"maximum":1000,"default":100},"routingStage":{"type":"string","enum":["primary","backup"],"default":"primary","description":"Primary keys run before eligible platform routes; backup keys run afterward. Within each stage, provider order then numeric key priority applies. Stage never grants platform-spending consent. BYOK-only skips platform; platform-only skips both saved-key stages."},"enabled":{"type":"boolean","default":true},"allowedModels":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^(dxr|uhub)-[a-z0-9-]+$"},"minItems":1,"maxItems":100,"uniqueItems":true},{"type":"null"}]},"allowedApiKeys":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"uniqueItems":true},{"type":"null"}]},"allowPlatformFallback":{"type":"boolean","deprecated":true,"description":"Legacy input: true means allow; false means deny_all. Omission on create defaults to deny_all. Do not combine with platformFallbackPolicy. Omission on edit preserves the saved policy."},"platformFallbackPolicy":{"type":"string","enum":["allow","deny_model","deny_provider","deny_all"],"description":"Automatic-mode spending rule. allow permits platform credit subject to other saved policies. deny_model blocks this supplier's platform capacity for matching models. deny_provider blocks this supplier's platform capacity for every model, even outside this key's model filter. deny_all (default, preserving legacy false) blocks all suppliers' platform capacity for matching models. All rules respect application-key filters and persist for disabled/expired keys and the last applicable revoked policy. Other suppliers remain usable under supplier-scoped rules; use provider.only or byok mode for a stricter request. Do not combine with allowPlatformFallback."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revision":{"type":"integer","minimum":1}},"required":["revision"],"additionalProperties":false,"not":{"required":["allowPlatformFallback","platformFallbackPolicy"]}},"RotateProviderKey":{"type":"object","properties":{"revision":{"type":"integer","minimum":1},"secret":{"type":"string","minLength":16,"maxLength":4096,"pattern":"^[\\x21-\\x7e]+$","writeOnly":true,"description":"Supplier-issued secret. Stored encrypted and never returned. Send only over HTTPS from trusted server automation."}},"required":["revision","secret"],"additionalProperties":false},"UpdateProviderKeySettings":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","byok","platform"]},"revision":{"type":"integer","minimum":1}},"required":["mode","revision"],"additionalProperties":false},"ProviderKeyMode":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","byok","platform"]},"revision":{"type":"integer","minimum":1}},"required":["mode","revision"],"additionalProperties":false},"ProviderKeySettings":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","byok","platform"]},"revision":{"type":"integer","minimum":1},"available":{"type":"boolean"},"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"models":{"type":"array","items":{"type":"string"}}},"required":["id","name","models"],"additionalProperties":false}},"fee":{"anyOf":[{"type":"object","properties":{"basisPoints":{"type":"integer","minimum":0},"version":{"type":"string"},"basis":{"type":"string","enum":["public_model_price"]},"supplierCharges":{"type":"string","enum":["separate"]}},"required":["basisPoints","version","basis","supplierCharges"],"additionalProperties":false},{"type":"null"}]}},"required":["mode","revision","available","providers","fee"],"additionalProperties":false},"ManagedKey":{"type":"object","properties":{"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expired":{"type":"boolean"},"budget_nano_usd":{"anyOf":[{"$ref":"#/components/schemas/NanoUsd"},{"type":"null"}]},"budget_period":{"type":"string","enum":["lifetime","monthly"]},"allowed_models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"billing_read":{"type":"boolean"},"revision":{"type":"integer","minimum":1},"spent":{"$ref":"#/components/schemas/NanoUsd"},"held":{"$ref":"#/components/schemas/NanoUsd"}},"required":["disabled_at","last_used_at","id","name","prefix","created_at","revoked_at","expires_at","expired","budget_nano_usd","budget_period","allowed_models","billing_read","revision","spent","held"],"additionalProperties":false},"ManagedKeyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ManagedKey"}},"page":{"type":"integer","minimum":1},"hasMore":{"type":"boolean"}},"required":["items","page","hasMore"],"additionalProperties":false},"CreatedApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","pattern":"^sk-dxr-","description":"Secret returned only by create or its identical retry. Keep it in a secret manager."}},"required":["id","key"],"additionalProperties":false},"CreateManagedKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"budgetNanoUsd":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,15})$"},{"type":"null"}]},"budgetPeriod":{"type":"string","enum":["lifetime","monthly"]},"allowedModels":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":150},"maxItems":200},{"type":"null"}]},"billingRead":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"requestId":{"type":"string","format":"uuid"}},"required":["name","requestId"],"additionalProperties":false},"UpdateManagedKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"budgetNanoUsd":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,15})$"},{"type":"null"}]},"budgetPeriod":{"type":"string","enum":["lifetime","monthly"]},"allowedModels":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":150},"maxItems":200},{"type":"null"}]},"billingRead":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revision":{"type":"integer","minimum":1}},"required":["revision"],"additionalProperties":false},"PresetConfig":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"models":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":150}},"provider":{"type":"object","properties":{"order":{"maxItems":8,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}},"only":{"maxItems":8,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}},"ignore":{"maxItems":8,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}},"allow_fallbacks":{"default":true,"type":"boolean"},"credentials":{"default":"auto","type":"string","enum":["auto","byok","platform"]},"require_parameters":{"default":false,"type":"boolean"},"max_price":{"type":"object","properties":{"prompt":{"type":"number","minimum":0,"maximum":1000000},"completion":{"type":"number","minimum":0,"maximum":1000000}},"additionalProperties":false}},"additionalProperties":false},"systemPrompt":{"type":"string","maxLength":32000},"parameters":{"default":{},"type":"object","properties":{"max_tokens":{"type":"integer","minimum":1,"maximum":65536},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"top_k":{"type":"integer","minimum":0,"maximum":100000},"stop":{"anyOf":[{"type":"string","maxLength":1000},{"maxItems":4,"type":"array","items":{"type":"string","maxLength":1000}}]},"stop_sequences":{"maxItems":4,"type":"array","items":{"type":"string","maxLength":1000}},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"parallel_tool_calls":{"type":"boolean"},"response_format":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reasoning":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"thinking":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"text":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"tool_choice":{"anyOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}},"required":["name"],"additionalProperties":false}]}},"additionalProperties":false},"tools":{"default":[],"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"},"description":{"type":"string","maxLength":8000},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"type":"boolean"}},"required":["name","parameters"],"additionalProperties":false}}},"required":["models"],"additionalProperties":false},"CreatePreset":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"default":"","type":"string","maxLength":500},"config":{"$ref":"#/components/schemas/PresetConfig"}},"required":["requestId","slug","name","config"],"additionalProperties":false},"UpdatePreset":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"enabled":{"type":"boolean"},"config":{"$ref":"#/components/schemas/PresetConfig"}},"required":["requestId","revision"],"additionalProperties":false},"PresetControl":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},"required":["requestId","revision"],"additionalProperties":false},"ActivatePreset":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"version":{"type":"integer","minimum":1,"maximum":100}},"required":["requestId","revision","version"],"additionalProperties":false},"Preset":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revision":{"type":"integer","minimum":1},"active_version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/PresetConfig"}},"required":["id","slug","name","description","enabled","archived_at","revision","active_version","created_at","updated_at","config"],"additionalProperties":false},"PresetMutation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revision":{"type":"integer","minimum":1},"active_version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/PresetConfig"},"replayed":{"type":"boolean"}},"required":["id","slug","name","description","enabled","archived_at","revision","active_version","created_at","updated_at","config","replayed"],"additionalProperties":false},"PresetList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Preset"}},"page":{"type":"integer","minimum":1},"hasMore":{"type":"boolean"}},"required":["items","page","hasMore"],"additionalProperties":false},"PresetVersion":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"config":{"$ref":"#/components/schemas/PresetConfig"},"created_at":{"type":"string","format":"date-time"}},"required":["version","config","created_at"],"additionalProperties":false},"PresetVersionList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"}},"required":["version","created_at"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ManagementOk":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"IntegerString":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","examples":["0","1000000000"],"description":"Nonnegative base-10 integer encoded as a string."},"NanoUsd":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","examples":["1000000000"],"description":"Nonnegative integer nanoUSD. 1 USD = 1,000,000,000 nanoUSD. Preserve precision with integer arithmetic."},"SignedNanoUsd":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$","examples":["-1000000000"],"description":"Signed integer nanoUSD; wallet balance/available may become negative after refunds/disputes."},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string","enum":["request_error","insufficient_credit"]},"request_id":{"type":"string","description":"Application request reference; distinct from an inference reservation UUID."}},"required":["message","type","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"TextModel":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"object":{"type":"string","enum":["model"]},"owned_by":{"type":"string","enum":["deepxroute"]},"name":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text"]}},"availability":{"type":"string","enum":["active","preview","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["chat"]},"output_modalities":{"type":"array","items":{"type":"string","enum":["text"]}},"providers":{"type":"array","items":{"$ref":"#/components/schemas/TextProvider"}},"limits":{"type":"object","properties":{"max_input_tokens":{"type":"integer","minimum":1},"max_output_tokens":{"type":"integer","minimum":1}},"required":["max_input_tokens","max_output_tokens"],"additionalProperties":false},"pricing":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["nano_usd"]},"input_per_token":{"$ref":"#/components/schemas/NanoUsd"},"output_per_token":{"$ref":"#/components/schemas/NanoUsd"},"version":{"type":"string"}},"required":["currency","unit","input_per_token","output_per_token","version"],"additionalProperties":false}},"required":["id","object","owned_by","name","input_modalities","availability","endpoints","kind","output_modalities","providers","limits","pricing"],"additionalProperties":false},"TextProvider":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"endpoints":{"type":"array","items":{"type":"string"}},"streaming":{"type":"boolean"},"supported_parameters":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"max_output_tokens":{"type":"integer","minimum":1},"fallback_statuses":{"type":"array","items":{"type":"integer","enum":[401,403,404,429]}},"byok":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean"},"fee_basis_points":{"type":"integer","minimum":1,"maximum":10000},"fee_version":{"type":"string"},"fee_basis":{"type":"string","enum":["public_model_price"]},"supplier_charges":{"type":"string","enum":["separate"]}},"required":["available","fee_basis_points","fee_version","fee_basis","supplier_charges"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","enabled","endpoints","streaming","supported_parameters","max_output_tokens","fallback_statuses","byok"],"additionalProperties":false},"ProviderPreferences":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"},"maxItems":8,"uniqueItems":true},"only":{"type":"array","items":{"type":"string"},"maxItems":8,"uniqueItems":true},"ignore":{"type":"array","items":{"type":"string"},"maxItems":8,"uniqueItems":true},"allow_fallbacks":{"type":"boolean","default":true},"credentials":{"type":"string","enum":["auto","byok","platform"],"default":"auto","description":"auto follows the saved account default (initially automatic: primary keys, permitted platform routes, then backup keys); each platform route must satisfy every applicable saved spending policy. byok never uses platform capacity. platform explicitly skips saved customer keys and pays normal model prices. Disabled/expired keys and the last revoked policy do not implicitly consent to platform use. deny_model blocks the key's supplier for matching models; deny_provider blocks that supplier even outside the model filter; deny_all preserves the legacy cross-supplier veto for matching models; allow adds no restriction. All honor application-key filters. Removing or excluding a provider does not erase its saved policy. At most eight total attempts, or one with allow_fallbacks=false. BYOK fees use the model's catalog token prices times the configured basis points, rounded up once to nanoUSD; the supplier bills separately. Platform fallback requires a full-price reservation."},"require_parameters":{"type":"boolean","default":false},"max_price":{"type":"object","properties":{"prompt":{"type":"number","minimum":0,"maximum":1000000},"completion":{"type":"number","minimum":0,"maximum":1000000}},"required":[],"additionalProperties":false}},"required":[],"additionalProperties":false,"description":"Provider IDs come from the model providers list. Restrictions are never relaxed. order prioritizes eligible providers; unlisted eligible providers follow. allow_fallbacks=false tries only the first eligible credential or platform attempt. Fallback requires an operator-confirmed non-billable rejection; timeouts, 5xx and accepted/interrupted responses are never replayed. require_parameters=true excludes legacy routes without declared capabilities and rejects unrecognized request fields. max_price is the maximum customer USD price per million prompt/completion tokens; the same versioned model price applies to every provider. Unsupported preferences, including sort, data_collection and zdr, return 400. Empty only allows no provider."},"MediaModel":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"object":{"type":"string","enum":["model"]},"owned_by":{"type":"string","enum":["deepxroute"]},"name":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text"]}},"availability":{"type":"string","enum":["active","preview","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["image","video"]},"output_modalities":{"type":"array","items":{"type":"string","enum":["image","video"]}},"limits":{"type":"object","properties":{"prompt_characters":{"type":"integer","minimum":1},"seconds":{"type":"integer","minimum":1},"retention_days":{"type":"integer","minimum":1}},"required":["prompt_characters","retention_days"],"additionalProperties":false},"pricing":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["nano_usd"]},"outputs":{"type":"array","items":{"type":"object","properties":{"size":{"type":"string"},"amount":{"$ref":"#/components/schemas/NanoUsd"},"version":{"type":"string"}},"required":["size","amount","version"],"additionalProperties":false}}},"required":["currency","unit","outputs"],"additionalProperties":false}},"required":["id","object","owned_by","name","input_modalities","availability","endpoints","kind","output_modalities","limits","pricing"],"additionalProperties":false},"Model":{"oneOf":[{"$ref":"#/components/schemas/TextModel"},{"$ref":"#/components/schemas/MediaModel"}]},"ModelList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}},"required":["object","data"],"additionalProperties":false},"KeyStatus":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"budget_nano_usd":{"anyOf":[{"$ref":"#/components/schemas/NanoUsd"},{"type":"null"}]},"budget_period":{"type":"string","enum":["lifetime","monthly"]},"allowed_models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"billing_read":{"type":"boolean"},"spent":{"$ref":"#/components/schemas/NanoUsd"},"held":{"$ref":"#/components/schemas/NanoUsd"},"currency":{"type":"string","enum":["USD"]},"amountUnit":{"type":"string","enum":["nano_usd"]}},"required":["id","name","prefix","expires_at","budget_nano_usd","budget_period","allowed_models","billing_read","spent","held","currency","amountUnit"],"additionalProperties":false},"Balance":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/SignedNanoUsd"},"reserved":{"$ref":"#/components/schemas/NanoUsd"},"available":{"$ref":"#/components/schemas/SignedNanoUsd"},"currency":{"type":"string","enum":["USD"]},"amountUnit":{"type":"string","enum":["nano_usd"]},"scope":{"type":"string","enum":["account"]}},"required":["balance","reserved","available","currency","amountUnit","scope"],"additionalProperties":false},"UsageTotals":{"type":"object","properties":{"requests":{"$ref":"#/components/schemas/IntegerString"},"completed":{"$ref":"#/components/schemas/IntegerString"},"failed":{"$ref":"#/components/schemas/IntegerString"},"active":{"$ref":"#/components/schemas/IntegerString"},"cost":{"$ref":"#/components/schemas/NanoUsd"},"platform_cost":{"$ref":"#/components/schemas/NanoUsd"},"byok_fee":{"$ref":"#/components/schemas/NanoUsd"},"held":{"$ref":"#/components/schemas/NanoUsd"},"input_tokens":{"$ref":"#/components/schemas/IntegerString"},"output_tokens":{"$ref":"#/components/schemas/IntegerString"}},"required":["requests","completed","failed","active","cost","platform_cost","byok_fee","held","input_tokens","output_tokens"],"additionalProperties":false},"UsageGroup":{"type":"object","properties":{"requests":{"$ref":"#/components/schemas/IntegerString"},"completed":{"$ref":"#/components/schemas/IntegerString"},"failed":{"$ref":"#/components/schemas/IntegerString"},"active":{"$ref":"#/components/schemas/IntegerString"},"cost":{"$ref":"#/components/schemas/NanoUsd"},"platform_cost":{"$ref":"#/components/schemas/NanoUsd"},"byok_fee":{"$ref":"#/components/schemas/NanoUsd"},"held":{"$ref":"#/components/schemas/NanoUsd"},"input_tokens":{"$ref":"#/components/schemas/IntegerString"},"output_tokens":{"$ref":"#/components/schemas/IntegerString"},"day":{"type":"string","format":"date"},"kind":{"type":"string","enum":["chat","image","video"]},"model":{"type":"string"},"key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"key_name":{"type":"string"},"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["requests","completed","failed","active","cost","platform_cost","byok_fee","held","input_tokens","output_tokens"],"additionalProperties":false},"UsageRecord":{"type":"object","properties":{"requested_model":{"type":"string","description":"Original first requested model after preset resolution and explicit overrides. Media uses its only model."},"preset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"preset_version":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"preset_slug":{"anyOf":[{"type":"string","description":"Immutable preset reference. Null when no preset was used; no prompt or tool content is exposed."},{"type":"null"}]},"id":{"type":"string","format":"uuid"},"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"key_name":{"type":"string"},"kind":{"type":"string","enum":["chat","image","video"]},"model":{"type":"string"},"price_version":{"type":"string"},"billing_mode":{"type":"string","enum":["platform","byok"]},"fee_basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"fee_version":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider_key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"provider_secret_version":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"output_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"cost":{"anyOf":[{"$ref":"#/components/schemas/NanoUsd"},{"type":"null"}]},"held":{"$ref":"#/components/schemas/NanoUsd"},"state":{"type":"string","enum":["completed","failed","pending","review"]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"event_at":{"type":"string","format":"date-time"}},"required":["requested_model","preset_id","preset_version","preset_slug","id","member_id","key_id","key_name","kind","model","price_version","billing_mode","fee_basis_points","fee_version","provider_key_id","provider_secret_version","input_tokens","output_tokens","cost","held","state","created_at","completed_at","event_at"],"additionalProperties":false},"UsageReport":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"amountUnit":{"type":"string","enum":["nano_usd"]},"scope":{"type":"string","enum":["self","account"]},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"dateBasis":{"type":"string","enum":["settled_or_started"]},"summary":{"$ref":"#/components/schemas/UsageTotals"},"hasMore":{"type":"boolean"},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"groupBy":{"type":"string","enum":["day","model","key","model-key","day-model-key","member","day-member","model-member"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/UsageGroup"}}},"required":["currency","amountUnit","scope","start","end","dateBasis","summary","hasMore","page","limit","groupBy","items"],"additionalProperties":false},"UsageRecords":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"amountUnit":{"type":"string","enum":["nano_usd"]},"scope":{"type":"string","enum":["self","account"]},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"dateBasis":{"type":"string","enum":["settled_or_started"]},"summary":{"$ref":"#/components/schemas/UsageTotals"},"hasMore":{"type":"boolean"},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"items":{"type":"array","items":{"$ref":"#/components/schemas/UsageRecord"}}},"required":["currency","amountUnit","scope","start","end","dateBasis","summary","hasMore","page","limit","items"],"additionalProperties":false},"ChatRequest":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"preset":{"type":"string","pattern":"^@preset/[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Saved preset in the calling key's account. Also supported as model: @preset/slug or actual-model@preset/slug. Explicit model selection replaces the saved list. Request fields override defaults; function tools merge by name. Unsupported preset parameters fail before reservation. Key, member, supplier and budget restrictions remain enforced."},"models":{"type":"array","items":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"minItems":1,"maxItems":4,"uniqueItems":true,"description":"Ordered candidate models. If model is also supplied, it is tried first; a repeated primary is counted once. At most four distinct models total. Known models without eligible routes, compatible limits or model/supplier/credential permission are skipped before reservation; restrictions are never relaxed. Unknown model IDs and malformed settings fail the request. Eight total attempts leave at least one slot per later model. allow_fallbacks:false permits one attempt only. One reservation covers the largest candidate charge; only the selected model settles. Timeouts, 5xx and accepted/interrupted responses never trigger fallback."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]},{"type":"null"}]},"name":{"type":"string"},"tool_call_id":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"JSON-encoded function arguments."}},"required":["name","arguments"],"additionalProperties":false}},"required":["function"],"additionalProperties":true}}},"required":["role"],"additionalProperties":true}},"max_completion_tokens":{"type":"integer","minimum":1,"default":1024,"description":"Must not exceed this model's max_output_tokens from discovery. The gateway uses 1024 when omitted."},"max_tokens":{"type":"integer","minimum":1,"default":1024,"description":"Fallback alias when max_completion_tokens is absent. Prefer max_completion_tokens."},"temperature":{"type":"number"},"top_p":{"type":"number"},"stream":{"type":"boolean","default":false},"n":{"type":"integer","const":1},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","additionalProperties":true},"strict":{"type":"boolean"}},"required":["name"],"additionalProperties":true}},"required":["type","function"],"additionalProperties":true}},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}},"required":["type","function"],"additionalProperties":false}]},"parallel_tool_calls":{"type":"boolean"},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"response_format":{"type":"object","additionalProperties":true,"description":"Forwarded to the selected model; provider support varies."},"seed":{"type":"integer"},"frequency_penalty":{"type":"number"},"presence_penalty":{"type":"number"}},"required":["messages"],"additionalProperties":true,"anyOf":[{"required":["model"]},{"required":["models"]},{"required":["preset"]}],"allOf":[{"not":{"required":["fallbacks"]}},{"not":{"required":["models","fallbacks"]}},{"anyOf":[{"not":{"required":["fallbacks"]}},{"required":["model"]}]}]},"ResponseRequest":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"preset":{"type":"string","pattern":"^@preset/[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Saved preset in the calling key's account. Also supported as model: @preset/slug or actual-model@preset/slug. Explicit model selection replaces the saved list. Request fields override defaults; function tools merge by name. Unsupported preset parameters fail before reservation. Key, member, supplier and budget restrictions remain enforced."},"models":{"type":"array","items":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"minItems":1,"maxItems":4,"uniqueItems":true,"description":"Ordered candidate models. If model is also supplied, it is tried first; a repeated primary is counted once. At most four distinct models total. Known models without eligible routes, compatible limits or model/supplier/credential permission are skipped before reservation; restrictions are never relaxed. Unknown model IDs and malformed settings fail the request. Eight total attempts leave at least one slot per later model. allow_fallbacks:false permits one attempt only. One reservation covers the largest candidate charge; only the selected model settles. Timeouts, 5xx and accepted/interrupted responses never trigger fallback."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"},"input":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["system","developer","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]}},"required":["role","content"],"additionalProperties":true},{"type":"object","properties":{"type":{"type":"string","enum":["function_call"]},"call_id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}},"required":["type","call_id","name","arguments"],"additionalProperties":true},{"type":"object","properties":{"type":{"type":"string","enum":["function_call_output"]},"call_id":{"type":"string"},"output":{"type":"string"}},"required":["type","call_id","output"],"additionalProperties":true}]}}]},"max_output_tokens":{"type":"integer","minimum":1,"default":1024,"description":"Must not exceed this model's max_output_tokens from discovery. The gateway uses 1024 when omitted."},"max_tokens":{"type":"integer","minimum":1,"default":1024,"description":"Fallback alias when max_output_tokens is absent."},"instructions":{"type":"string"},"temperature":{"type":"number"},"top_p":{"type":"number"},"stream":{"type":"boolean","default":false},"store":{"type":"boolean","const":false,"default":false},"background":{"type":"boolean","const":false},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","additionalProperties":true},"strict":{"type":"boolean"}},"required":["type","name"],"additionalProperties":true}},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"name":{"type":"string"}},"required":["type","name"],"additionalProperties":false}]},"parallel_tool_calls":{"type":"boolean"},"reasoning":{"type":"object","additionalProperties":true,"description":"Forwarded; model support varies."},"text":{"type":"object","additionalProperties":true,"description":"Forwarded output-format settings; model support varies."}},"required":["input"],"additionalProperties":true,"anyOf":[{"required":["model"]},{"required":["models"]},{"required":["preset"]}],"allOf":[{"not":{"required":["fallbacks"]}},{"not":{"required":["models","fallbacks"]}},{"anyOf":[{"not":{"required":["fallbacks"]}},{"required":["model"]}]}]},"MessageRequest":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"preset":{"type":"string","pattern":"^@preset/[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Saved preset in the calling key's account. Also supported as model: @preset/slug or actual-model@preset/slug. Explicit model selection replaces the saved list. Request fields override defaults; function tools merge by name. Unsupported preset parameters fail before reservation. Key, member, supplier and budget restrictions remain enforced."},"models":{"type":"array","items":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]},"minItems":1,"maxItems":4,"uniqueItems":true,"description":"Ordered candidate models. If model is also supplied, it is tried first; a repeated primary is counted once. At most four distinct models total. Known models without eligible routes, compatible limits or model/supplier/credential permission are skipped before reservation; restrictions are never relaxed. Unknown model IDs and malformed settings fail the request. Eight total attempts leave at least one slot per later model. allow_fallbacks:false permits one attempt only. One reservation covers the largest candidate charge; only the selected model settles. Timeouts, 5xx and accepted/interrupted responses never trigger fallback."},"fallbacks":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":150,"examples":["dxr-coder-pro"]}},"required":["model"],"additionalProperties":false},"description":"Messages-only alternative to models: up to three fallback models after the required primary model. Entries accept only model. Cannot be combined with models; duplicate fallback IDs are rejected."},"provider":{"$ref":"#/components/schemas/ProviderPreferences"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"]},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":true}},"required":["type","id","name","input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_result"]},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]},"is_error":{"type":"boolean"}},"required":["type","tool_use_id","content"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"]},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"],"additionalProperties":true}]}}]}},"required":["role","content"],"additionalProperties":false}},"max_tokens":{"type":"integer","minimum":1,"default":1024,"description":"Must not exceed this model's max_output_tokens from discovery. The gateway uses 1024 when omitted."},"temperature":{"type":"number"},"top_p":{"type":"number"},"stream":{"type":"boolean","default":false},"system":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":true}},"required":["name","input_schema"],"additionalProperties":true}},"tool_choice":{"type":"object","properties":{"type":{"type":"string","enum":["auto","any","tool","none"]},"name":{"type":"string"},"disable_parallel_tool_use":{"type":"boolean"}},"required":["type"],"additionalProperties":true},"top_k":{"type":"integer","minimum":0},"stop_sequences":{"type":"array","items":{"type":"string"}},"thinking":{"type":"object","additionalProperties":true,"description":"Forwarded thinking settings; model support varies."}},"required":["messages"],"additionalProperties":true,"anyOf":[{"required":["model"]},{"required":["models"]},{"required":["preset"]}],"allOf":[{"not":{"required":["models","fallbacks"]}},{"anyOf":[{"not":{"required":["fallbacks"]}},{"required":["model"]}]}]},"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["chat.completion"]},"created":{"type":"integer","minimum":0},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"message":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]},{"type":"null"}]},"name":{"type":"string"},"tool_call_id":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"JSON-encoded function arguments."}},"required":["name","arguments"],"additionalProperties":false}},"required":["function"],"additionalProperties":true}}},"required":[],"additionalProperties":true},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":[],"additionalProperties":true}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}},"required":[],"additionalProperties":true}},"required":[],"additionalProperties":true},"Response":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["response"]},"created_at":{"type":"integer","minimum":0},"status":{"type":"string"},"model":{"type":"string"},"output":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["system","developer","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]}},"required":["role","content"],"additionalProperties":true},{"type":"object","properties":{"type":{"type":"string","enum":["function_call"]},"call_id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}},"required":["type","call_id","name","arguments"],"additionalProperties":true},{"type":"object","properties":{"type":{"type":"string","enum":["function_call_output"]},"call_id":{"type":"string"},"output":{"type":"string"}},"required":["type","call_id","output"],"additionalProperties":true}]}},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}},"required":[],"additionalProperties":true},"error":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}},"required":[],"additionalProperties":true},"Message":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["assistant"]},"model":{"type":"string"},"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"]},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":true}},"required":["type","id","name","input"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_result"]},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","input_text","output_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true}}]},"is_error":{"type":"boolean"}},"required":["type","tool_use_id","content"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"]},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"],"additionalProperties":true}]}},"stop_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stop_sequence":{"anyOf":[{"type":"string"},{"type":"null"}]},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"cache_read_input_tokens":{"type":"integer","minimum":0},"cache_creation_input_tokens":{"type":"integer","minimum":0}},"required":[],"additionalProperties":true}},"required":[],"additionalProperties":true},"MediaRequest":{"type":"object","properties":{"idempotencyKey":{"type":"string","format":"uuid"},"model":{"type":"string"},"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"Trimmed before validation and idempotency comparison."},"size":{"type":"string","description":"Priced size from discovery. Image dimensions use *; video dimensions use x."},"negativePrompt":{"type":"string","maxLength":500,"default":""},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Images only. Ignored for video."}},"required":["idempotencyKey","model","prompt","size"],"additionalProperties":true},"MediaJob":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["image","video"]},"model":{"type":"string"},"prompt":{"type":"string"},"parameters":{"type":"object","properties":{"size":{"type":"string"},"negativePrompt":{"type":"string"},"seed":{"type":"integer","minimum":0}},"required":["size","negativePrompt"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/NanoUsd"},"currency":{"type":"string","enum":["USD"]},"state":{"type":"string","enum":["queued","submitting","running","completed","failed","review","cancelled"]},"asset_type":{"anyOf":[{"type":"string","enum":["image/png","image/jpeg","image/webp","video/mp4"]},{"type":"null"}]},"asset_bytes":{"anyOf":[{"$ref":"#/components/schemas/IntegerString"},{"type":"null"}]},"asset_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","model","prompt","parameters","amount","currency","state","asset_type","asset_bytes","asset_expires_at","created_at","completed_at"],"additionalProperties":false},"MediaJobPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MediaJob"}},"hasMore":{"type":"boolean"},"page":{"type":"integer","minimum":1}},"required":["items","hasMore","page"],"additionalProperties":false},"LegacyMediaPrice":{"type":"object","properties":{"model":{"type":"string"},"size":{"type":"string"},"currency":{"type":"string","enum":["USD"]},"amount":{"type":"integer","minimum":1,"maximum":1000000000000,"description":"Legacy numeric nanoUSD amount; not decimal dollars. Unified discovery uses integer strings."},"version":{"type":"string"}},"required":["model","size","currency","amount","version"],"additionalProperties":false},"MediaCatalog":{"type":"object","properties":{"enabled":{"type":"boolean"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["image","video"]},"sizes":{"type":"array","items":{"type":"string"}},"seconds":{"type":"integer","minimum":1}},"required":["id","label","kind","sizes"],"additionalProperties":false}},"prices":{"type":"array","items":{"$ref":"#/components/schemas/LegacyMediaPrice"}},"previewPrices":{"type":"array","items":{"$ref":"#/components/schemas/LegacyMediaPrice"}},"retentionDays":{"type":"integer","minimum":1}},"required":["enabled","models","prices","previewPrices","retentionDays"],"additionalProperties":false}}}}