{"openapi":"3.1.0","info":{"title":"Router-compatible API","version":"0.1.0","description":"Dated Phase 1 compatibility profile; not a claim of permanent full OpenRouter parity."},"servers":[{"url":"/"}],"security":[{"RouterKey":[]}],"tags":[{"name":"Models"},{"name":"Chat"},{"name":"Encrypted inference"},{"name":"Embeddings"},{"name":"Media"},{"name":"Keys"},{"name":"Credits"}],"paths":{"/api/v1/models":{"get":{"tags":["Models"],"operationId":"listModels","summary":"List models available to the authenticated account","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"parameters":[{"$ref":"#/components/parameters/RequestID"},{"name":"output_modalities","in":"query","schema":{"type":"string"}},{"name":"supported_parameters","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["pricing-low-to-high","pricing-high-to-low","context-high-to-low","newest"]}}],"responses":{"200":{"description":"Model catalog","headers":{"X-Catalogue-Generation":{"$ref":"#/components/headers/CatalogueGeneration"},"X-Catalogue-Supply-Captured-At":{"$ref":"#/components/headers/CatalogueSupplyCapturedAt"},"X-Catalogue-Stale":{"$ref":"#/components/headers/CatalogueStale"},"X-Catalogue-Statistics-Available":{"$ref":"#/components/headers/CatalogueStatisticsAvailable"},"X-Catalogue-Statistics-As-Of":{"$ref":"#/components/headers/CatalogueStatisticsAsOf"},"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelListResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/models/{author}/{slug}/endpoints":{"get":{"tags":["Models"],"operationId":"listModelEndpoints","summary":"List eligible provider endpoints for a model","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"parameters":[{"$ref":"#/components/parameters/RequestID"},{"$ref":"#/components/parameters/ModelAuthor"},{"$ref":"#/components/parameters/ModelSlug"}],"responses":{"200":{"description":"Model and endpoint detail","headers":{"X-Catalogue-Generation":{"$ref":"#/components/headers/CatalogueGeneration"},"X-Catalogue-Supply-Captured-At":{"$ref":"#/components/headers/CatalogueSupplyCapturedAt"},"X-Catalogue-Stale":{"$ref":"#/components/headers/CatalogueStale"},"X-Catalogue-Statistics-Available":{"$ref":"#/components/headers/CatalogueStatisticsAvailable"},"X-Catalogue-Statistics-As-Of":{"$ref":"#/components/headers/CatalogueStatisticsAsOf"},"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelEndpointsResponse"}}}},"404":{"$ref":"#/components/responses/ModelNotFound"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/e2ee/resolve":{"post":{"tags":["Encrypted inference"],"operationId":"resolveEncryptedModel","summary":"Resolve an E2EE model before SDK encryption","description":"Resolves an approved offer and native model ID. Inference revalidates all routing metadata and account permissions. Does not reserve funds or guarantee availability.","x-numes-request-limit":{"body_bytes":4096,"timeout":"10s"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["model"],"properties":{"model":{"type":"string","minLength":1,"maxLength":512}}}}}},"responses":{"200":{"description":"Current selection and required protocol/security policy for a qualified encrypted client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptedModelResolution"}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/e2ee/chat/completions":{"post":{"tags":["Encrypted inference"],"operationId":"createEncryptedChatCompletion","summary":"Relay an SDK-encrypted chat completion","description":"Accepts native encrypted HTTP bodies for the resolved, reviewed encryption profile. Whole-body and field encryption use the same opaque relay; protocol metadata is validated without decrypting content. Normal OpenAI clients must use a local SDK bridge. Once ciphertext delivery starts, valid final provider-reported native usage is billable even after a disconnect, including work generated afterwards. Usage collection stays within the original execution deadline. No delivered ciphertext or missing/invalid final usage means no charge. Headers are operational metadata and are not encrypted. Client verifies attestation independently. A conclusive rejection before dispatch returns HTTP 503 with `error.metadata.error_type` set to `inference_not_dispatched`. A client may resolve and encrypt one fresh attempt with a new idempotency key while preserving its encryption policy. Other failures, interrupted bodies and uncertain execution do not authorize automatic retry.","x-numes-request-limit":{"body_bytes":10485760,"timeout":"streaming"},"parameters":[{"$ref":"#/components/parameters/RequestID"},{"name":"X-Inference-Model","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"X-Inference-Offer-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Inference-Offer-Revision-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Inference-Native-Model","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},{"name":"X-Inference-Profile","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"X-Tinfoil-Enclave-Url","in":"header","required":false,"schema":{"type":"string","format":"uri","maxLength":2048}},{"name":"X-Encrypted-Client-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"Ehbp-Encapsulated-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary","description":"Native encrypted body. Whole-body SDKs may preserve the pre-encryption content type; field-encryption profiles carry encrypted fields in JSON."}}}},"responses":{"200":{"description":"Encrypted response bytes; incomplete streams terminate with a transport error.","headers":{"Ehbp-Response-Nonce":{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"X-Generation-Id":{"schema":{"type":"string","format":"uuid"}},"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary","description":"Native JSON with encrypted content fields."}},"text/event-stream":{"schema":{"type":"string","format":"binary","description":"Native SSE with encrypted content fields."}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/chat/completions":{"post":{"tags":["Chat"],"operationId":"createChatCompletion","summary":"Create a streaming or non-streaming chat completion","x-numes-request-limit":{"body_bytes":10485760,"timeout":"streaming"},"parameters":[{"$ref":"#/components/parameters/RequestID"},{"$ref":"#/components/parameters/SessionID"},{"$ref":"#/components/parameters/OpenRouterMetadata"},{"$ref":"#/components/parameters/OpenRouterExperimentalMetadata"},{"$ref":"#/components/parameters/HTTPReferer"},{"$ref":"#/components/parameters/AppTitle"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"JSON completion when stream is false, otherwise SSE chunks followed by data colon space bracket DONE bracket.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"},"X-Generation-Id":{"$ref":"#/components/headers/GenerationID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"type":"string","description":"SSE frames containing ChatCompletionChunk JSON and a terminal data colon space bracket DONE bracket frame."}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/generation":{"get":{"tags":["Chat"],"operationId":"getGeneration","summary":"Get immutable request, usage, delivery, and cost metadata for a generation","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"parameters":[{"$ref":"#/components/parameters/RequestID"},{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Generation metadata visible to the owning account","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/embeddings":{"post":{"tags":["Embeddings"],"operationId":"createEmbedding","summary":"Create text or multimodal embeddings","x-numes-request-limit":{"body_bytes":10485760,"timeout":"300s"},"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"Indexed embedding vectors and exact usage","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"},"X-Generation-Id":{"$ref":"#/components/headers/GenerationID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponse"}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/images":{"post":{"tags":["Media"],"operationId":"createImage","summary":"Generate images","x-numes-request-limit":{"body_bytes":10485760,"timeout":"streaming"},"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRequest"}}}},"responses":{"200":{"description":"Image generation result","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/audio/speech":{"post":{"tags":["Media"],"operationId":"createSpeech","summary":"Generate speech audio","x-numes-request-limit":{"body_bytes":1048576,"timeout":"streaming"},"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"Generated audio bytes","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"audio/mpeg":{"schema":{"type":"string","contentEncoding":"binary"}},"audio/pcm":{"schema":{"type":"string","contentEncoding":"binary"}},"audio/wav":{"schema":{"type":"string","contentEncoding":"binary"}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/audio/transcriptions":{"post":{"tags":["Media"],"operationId":"createTranscription","summary":"Transcribe uploaded audio","x-numes-request-limit":{"body_bytes":26214400,"timeout":"300s"},"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/TranscriptionRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionJSONRequest"}}}},"responses":{"200":{"description":"Transcription","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionResponse"}}}},"503":{"$ref":"#/components/responses/ProviderUnavailable"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/key":{"get":{"tags":["Keys"],"operationId":"getCurrentKey","summary":"Inspect the current API key","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"parameters":[{"$ref":"#/components/parameters/RequestID"}],"responses":{"200":{"description":"Current key metadata","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentKeyResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/keys":{"get":{"tags":["Keys"],"operationId":"listKeys","summary":"List account API keys using a management key","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"},{"name":"include_disabled","in":"query","schema":{"type":"boolean","default":false}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"API keys","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Keys"],"operationId":"createKey","summary":"Create an API key using a management key","x-numes-request-limit":{"body_bytes":32768,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Created API key; the secret is returned only here.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/keys/{hash}":{"parameters":[{"$ref":"#/components/parameters/KeyHash"}],"get":{"tags":["Keys"],"operationId":"getKey","summary":"Get API key metadata using a management key","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"}],"responses":{"200":{"description":"API key metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Keys"],"operationId":"updateKey","summary":"Update an API key using a management key","x-numes-request-limit":{"body_bytes":32768,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKeyRequest"}}}},"responses":{"200":{"description":"Updated API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Keys"],"operationId":"deleteKey","summary":"Delete an API key using a management key","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"}],"responses":{"200":{"description":"Deletion result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteKeyResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/credits":{"get":{"tags":["Credits"],"operationId":"getCredits","summary":"Get net credits and settled usage in one settlement currency using a management key","description":"Account balances are held per settlement currency and are never summed or converted, so the caller names exactly one currency. The totals are read from one consistent ledger snapshot and total_credits minus total_usage equals the posted balance in that currency.","x-numes-request-limit":{"body_bytes":0,"timeout":"10s"},"security":[{"ManagementKey":[]}],"parameters":[{"$ref":"#/components/parameters/RequestID"},{"name":"currency","in":"query","required":true,"description":"Settlement currency to report. Required; there is no default currency.","schema":{"type":"string","enum":["USD","BTC"]}}],"responses":{"200":{"description":"Credit totals in the requested settlement currency","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"RouterKey":{"type":"http","scheme":"bearer","bearerFormat":"API key"},"ManagementKey":{"type":"http","scheme":"bearer","bearerFormat":"Management key"}},"parameters":{"RequestID":{"name":"X-Request-Id","in":"header","required":false,"description":"Correlation ID, not an idempotency key. Inference request IDs recorded with a generation are unique per account. A traffic-admitted request reusing a recorded ID returns 400 invalid_request. Traffic admission rejection takes precedence over this conflict, including for reused IDs; it performs no generation lookup and writes no generation, result or attempt. Rate-limit rejection returns 429 rate_limited with Retry-After; an inference limiter outage retains 500 server.","schema":{"type":"string","minLength":1,"maxLength":128}},"SessionID":{"name":"X-Session-Id","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":256},"description":"Sticky-routing key; request-body session_id takes precedence."},"OpenRouterMetadata":{"name":"X-OpenRouter-Metadata","in":"header","required":false,"schema":{"type":"string"},"description":"Values are case-insensitive; unknown values behave as disabled."},"OpenRouterExperimentalMetadata":{"name":"X-OpenRouter-Experimental-Metadata","in":"header","required":false,"deprecated":true,"schema":{"type":"string"},"description":"Legacy alias for X-OpenRouter-Metadata."},"HTTPReferer":{"name":"HTTP-Referer","in":"header","required":false,"schema":{"type":"string","format":"uri","maxLength":2048}},"AppTitle":{"name":"X-Title","in":"header","required":false,"schema":{"type":"string","maxLength":256}},"ModelAuthor":{"name":"author","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"}},"ModelSlug":{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}},"KeyHash":{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"headers":{"CatalogueGeneration":{"description":"The completed worker publication identifier.","schema":{"type":"string"}},"CatalogueSupplyCapturedAt":{"description":"Consistent supply capture time; supply is captured every 30 seconds by default and a new healthy response is at most one minute old.","schema":{"type":"string","format":"date-time"}},"CatalogueStale":{"description":"True during ordinary stale browsing, which ends at five minutes of supply age.","schema":{"type":"boolean"}},"CatalogueStatisticsAvailable":{"description":"Whether the publication has fresh statistical coverage.","schema":{"type":"boolean"}},"CatalogueStatisticsAsOf":{"description":"Completed statistical coverage time, when any coverage is pinned.","schema":{"type":"string","format":"date-time"}},"RequestID":{"description":"Correlation identifier assigned or accepted by the service.","schema":{"type":"string"}},"GenerationID":{"description":"Generation identifier when inference reached generation setup.","schema":{"type":"string"}}},"responses":{"Error":{"description":"Compatible error envelope","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"},"Retry-After":{"description":"Optional delay in seconds for retryable rate or availability errors.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ModelNotFound":{"description":"The requested model is not in the caller's compatible catalogue: the slug is unknown, the model is not currently published, it is not offered in the key's settlement currency, or the caller may not use it. These cases share one identical response body (`error.code` 404, `error.metadata.error_type` \"not_found\") so availability to other callers is never disclosed. This classification applies to model endpoint discovery; inference and encrypted resolution preserve routing failures as 503 `provider_unavailable`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ProviderUnavailable":{"description":"No eligible provider can serve the request. Unknown, unpublished, currency-mismatched and unauthorized shared model IDs receive the same bounded response (`error.code` 503, `error.metadata.error_type` \"provider_unavailable\", message \"no provider is available\"). Inference and encrypted resolution do not classify model existence after routing fails. Earlier validation and authorization errors remain unchanged. An interrupted server execution while the original HTTP caller remains connected also uses 503 provider_unavailable with the fixed message \"service temporarily unavailable\". Once streaming has started, the error is in-band and the HTTP status remains 200. If an otherwise eligible USD-indexed Bitcoin offer is blocked by an unavailable market reference, or its reference expires before dispatch, the response instead uses 503 with error_type \"bitcoin_reference_price_unavailable\" and message \"Bitcoin pricing is unavailable. Try again shortly.\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"EncryptedModelResolution":{"type":"object","additionalProperties":false,"required":["model","native_model","offer_id","offer_revision_id","transport","protocol","security_policy","usage_meter","context_length","maximum_output_tokens"],"properties":{"model":{"type":"string"},"native_model":{"type":"string"},"offer_id":{"type":"string","format":"uuid"},"offer_revision_id":{"type":"string","format":"uuid"},"transport":{"type":"string","enum":["tinfoil-ehbp","synthetic-ehbp","synthetic-fields-v1","venice-ecies-v1"],"description":"Encryption profile the client must use for this offer. Tinfoil uses enclave attestation; Venice uses provider-managed key discovery with weaker independent verification (see the encrypted inference guide)."},"protocol":{"type":"string","enum":["ehbp-v1","encrypted-json-v1","venice-ecies-v1"]},"security_policy":{"type":"string","enum":["attested-enclave","development","provider-managed"]},"usage_meter":{"type":"string","enum":["provider-native-e2ee-v1"]},"context_length":{"type":"integer","format":"int64","minimum":1},"maximum_output_tokens":{"type":"integer","format":"int64","minimum":1}}},"PriceReference":{"type":"object","additionalProperties":false,"required":["id","policy","usd_per_btc","observed_at","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"policy":{"type":"string"},"usd_per_btc":{"type":"string"},"observed_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"openrouter_metadata":{"type":"object","additionalProperties":true}}},"ModelArchitecture":{"type":"object","additionalProperties":false,"required":["modality","input_modalities","output_modalities","tokenizer"],"properties":{"modality":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","file","audio"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","embeddings"]}},"tokenizer":{"type":"string"},"instruct_type":{"type":["string","null"]}}},"ModelPricing":{"type":"object","additionalProperties":false,"description":"Exact per-unit prices in the inference key's immutable billing currency. For BTC keys, values are Bitcoin base units (1 is one satoshi), token prices have up to thirty decimal places, and clients may display them with BIP177 notation such as ₿123/M.\n","required":["prompt","completion","request","image","audio"],"properties":{"pricing_basis":{"type":"string","enum":["fixed","usd_indexed"]},"reference":{"$ref":"#/components/schemas/PriceReference"},"usd_rates":{"type":"object","additionalProperties":{"type":"string"},"description":"USD anchor rates for the same displayed price categories; present only for USD-indexed Bitcoin schedules."},"input_cache_read":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$"},"input_cache_write":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$"},"prompt":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"completion":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"request":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"image":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"audio":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"}}},"Model":{"type":"object","additionalProperties":false,"required":["id","canonical_slug","name","created","context_length","architecture","pricing","supported_parameters"],"properties":{"billing_currency":{"type":"string","enum":["USD","BTC"]},"usage_meter":{"type":"string","description":"Gateway billing-unit algorithm; not the native tokenizer used for context limits."},"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"canonical_slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$"},"name":{"type":"string"},"description":{"type":"string"},"created":{"type":"integer","format":"int64"},"context_length":{"type":"integer"},"architecture":{"$ref":"#/components/schemas/ModelArchitecture"},"pricing":{"$ref":"#/components/schemas/ModelPricing"},"supported_parameters":{"type":"array","items":{"type":"string"}},"max_input_tokens":{"type":"integer","minimum":1,"description":"Independent token input ceiling of the representative offer, when declared. This is separate from the combined context window."},"maximum_output_length":{"type":["integer","null"],"minimum":1},"embeddings":{"type":"boolean","default":false},"supported_hosted_tools":{"type":"array","items":{"$ref":"#/components/schemas/HostedToolID"}},"reasoning":{"$ref":"#/components/schemas/ModelReasoning"},"top_provider":{"$ref":"#/components/schemas/TopProvider"},"access":{"$ref":"#/components/schemas/ModelAccess"}}},"ModelAccess":{"type":"object","additionalProperties":false,"description":"Numes extension present only on a shared model: an access-restricted variant whose `id` is the canonical slug plus `:org-<handle>`, usable only by members of that organization (docs/MODEL_SHARING.md).","required":["kind","organization"],"properties":{"kind":{"type":"string","enum":["organization"]},"organization":{"$ref":"#/components/schemas/ModelAccessOrganization"}}},"ModelAccessOrganization":{"type":"object","additionalProperties":false,"required":["handle","display_name"],"properties":{"handle":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])$"},"display_name":{"type":"string"}}},"ModelReasoning":{"type":"object","additionalProperties":false,"properties":{"default_effort":{"type":["string","null"]},"default_enabled":{"type":"boolean"},"mandatory":{"type":"boolean"},"supports_max_tokens":{"type":"boolean"},"supported_efforts":{"type":"array","items":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"]}}}},"TopProvider":{"type":"object","additionalProperties":false,"required":["context_length","max_completion_tokens"],"properties":{"context_length":{"type":"integer"},"max_completion_tokens":{"type":["integer","null"],"minimum":1},"is_moderated":{"type":"boolean"}}},"ModelListResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"ModelEndpoint":{"type":"object","additionalProperties":false,"required":["name","provider_name","context_length","pricing","supported_parameters"],"properties":{"tag":{"type":"string"},"max_completion_tokens":{"type":["integer","null"],"minimum":1},"max_prompt_tokens":{"type":"integer","minimum":1},"reasoning":{"$ref":"#/components/schemas/ModelReasoning"},"billing_currency":{"type":"string","enum":["USD","BTC"]},"usage_meter":{"type":"string"},"name":{"type":"string"},"provider_name":{"type":"string"},"context_length":{"type":"integer"},"pricing":{"$ref":"#/components/schemas/ModelPricing"},"supported_parameters":{"type":"array","items":{"type":"string"}},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","file","audio"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","embeddings"]}},"maximum_output_length":{"type":["integer","null"],"minimum":1},"embeddings":{"type":"boolean","default":false},"supported_hosted_tools":{"type":"array","items":{"$ref":"#/components/schemas/HostedToolID"}},"quantization":{"type":["string","null"]},"uptime_last_30m":{"type":["number","null"]}}},"ModelEndpointsResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","name","created","description","architecture","endpoints"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"created":{"type":"integer","format":"int64"},"description":{"type":"string","maxLength":32768},"architecture":{"$ref":"#/components/schemas/ModelArchitecture"},"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/ModelEndpoint"}}}}}},"ContentPart":{"oneOf":[{"$ref":"#/components/schemas/TextPart"},{"$ref":"#/components/schemas/ImagePart"},{"$ref":"#/components/schemas/AudioPart"},{"$ref":"#/components/schemas/FilePart"}],"discriminator":{"propertyName":"type"}},"TextPart":{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}}},"CacheControl":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"const":"ephemeral"},"ttl":{"type":"string","enum":["5m","1h"]}}},"PromptCacheBreakpoint":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"const":"explicit"}}},"PromptCacheOptions":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"mode":{"type":"string","enum":["implicit","explicit"]},"ttl":{"const":"30m"}}},"ImagePart":{"type":"object","additionalProperties":false,"required":["type","image_url"],"properties":{"type":{"const":"image_url"},"image_url":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","maxLength":10485760},"detail":{"type":"string","enum":["auto","low","high"]}}}}},"AudioPart":{"type":"object","additionalProperties":false,"required":["type","input_audio"],"properties":{"type":{"const":"input_audio"},"input_audio":{"type":"object","additionalProperties":false,"required":["data","format"],"properties":{"data":{"type":"string","contentEncoding":"base64"},"format":{"type":"string","enum":["wav","mp3","flac","m4a","ogg","webm","aac","aiff","pcm16","pcm24"]}}}}},"FilePart":{"type":"object","additionalProperties":false,"required":["type","file"],"properties":{"type":{"const":"file"},"file":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","maxLength":255},"file_data":{"type":"string","maxLength":10485760}},"anyOf":[{"required":["file_data"]}]}}},"ChatMessage":{"type":"object","additionalProperties":true,"properties":{"role":{"type":"string"},"name":{"type":"string","description":"Provider-owned message name, forwarded with conversation data."},"content":{"description":"Provider-owned text or structured content; matching compatible adapters preserve unfamiliar non-media shapes. Media must use supported image_url, file or input_audio parts and pass gateway acquisition. Native adapters reject media on roles they cannot translate without loss."},"tool_call_id":{"type":"string"},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}},"reasoning":{"type":"string"},"reasoning_content":{"type":"string"},"reasoning_details":{"type":"array","items":{"$ref":"#/components/schemas/ReasoningDetail"}},"cache_control":{"$ref":"#/components/schemas/CacheControl"}}},"ReasoningDetail":{"type":"object","additionalProperties":true,"description":"Opaque provider reasoning state. Return every field unchanged, including unfamiliar types, formats and empty fragments.","properties":{"type":{},"id":{},"format":{},"index":{},"text":{},"summary":{},"signature":{},"data":{}}},"FunctionTool":{"type":"object","additionalProperties":true,"required":["type","function"],"properties":{"type":{"const":"function"},"cache_control":{"allOf":[{"$ref":"#/components/schemas/CacheControl"}],"description":"Accepted cache hint for this tool definition. It is validated but not sent to the endpoint and never affects routing; mark a system or message block to cache the prompt prefix."},"function":{"type":"object","additionalProperties":true,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{},"strict":{"type":"boolean"}}}}},"CommonHostedTool":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","enum":["web_search","web_fetch","datetime","image_generation","code_execution","file_search","shell","mcp","tool_search","skills","maps","url_context","advisor","apply_patch","fusion","subagent"]},"configuration":{"$ref":"#/components/schemas/HostedToolConfiguration"},"resource_aliases":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"}}}},"HostedToolID":{"type":"string","enum":["openrouter.web_search@1","openrouter.web_fetch@1","openrouter.datetime@1","openrouter.image_generation@1","openrouter.apply_patch@1","openrouter.fusion@1","openrouter.advisor@1","openrouter.subagent@1","openai.web_search@1","openai.file_search@1","openai.code_interpreter@1","openai.image_generation@1","openai.shell@1","openai.mcp@1","openai.connectors@1","openai.tool_search@1","openai.skills@1","anthropic.web_search@1","anthropic.web_fetch@1","anthropic.code_execution@1","anthropic.advisor@1","anthropic.tool_search@1","anthropic.mcp@1","google.search@1","google.maps@1","google.url_context@1","google.file_search@1","google.code_execution@1"]},"NamespacedHostedTool":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"const":"hosted"},"id":{"$ref":"#/components/schemas/HostedToolID"},"configuration":{"$ref":"#/components/schemas/HostedToolConfiguration"},"resource_aliases":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"}}}},"Tool":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool"},{"$ref":"#/components/schemas/CommonHostedTool"},{"$ref":"#/components/schemas/NamespacedHostedTool"}]},"HostedToolConfiguration":{"type":"object","description":"Strict union of the public configuration fields accepted by the frozen hosted-tool registry. Each tool accepts only its documented subset; secret-backed upstream resource identifiers are supplied through resource aliases instead.","additionalProperties":false,"maxProperties":16,"properties":{"max_results":{"type":"integer","minimum":1,"maximum":100},"max_uses":{"type":"integer","minimum":1,"maximum":20},"max_content_tokens":{"type":"integer","minimum":1,"maximum":1000000},"max_num_results":{"type":"integer","minimum":1,"maximum":100},"top_k":{"type":"integer","minimum":1,"maximum":100},"max_turns":{"type":"integer","minimum":1,"maximum":64},"output_compression":{"type":"integer","minimum":0,"maximum":100},"partial_images":{"type":"integer","minimum":0,"maximum":3},"search_prompt":{"type":"string","minLength":1,"maxLength":4096},"search_context_size":{"type":"string","enum":["low","medium","high"]},"engine":{"type":"string","enum":["auto","native","exa"]},"timezone":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"background":{"type":"string","enum":["auto","opaque","transparent"]},"input_fidelity":{"type":"string","enum":["low","high"]},"moderation":{"type":"string","enum":["auto"]},"output_format":{"type":"string","enum":["png","jpeg","webp"]},"quality":{"type":"string","enum":["auto","low","medium","high"]},"size":{"type":"string","enum":["auto","1024x1024","1024x1536","1536x1024"]},"metadata_filter":{"type":"string","minLength":1,"maxLength":4096},"server_label":{"type":"string","minLength":1,"maxLength":128},"server_description":{"type":"string","minLength":1,"maxLength":4096},"execution":{"type":"string","enum":["server"]},"description":{"type":"string","minLength":1,"maxLength":4096},"external_web_access":{"type":"boolean"},"models":{"type":"array","maxItems":16,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":256}},"allowed_tools":{"type":"array","maxItems":256,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"allowed_domains":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":253}},"blocked_domains":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":253}},"filters":{"type":"object","additionalProperties":false,"properties":{"allowed_domains":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":253}}}},"citations":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"}}},"user_location":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["approximate"]},"country":{"type":"string","minLength":1,"maxLength":2},"city":{"type":"string","minLength":1,"maxLength":128},"region":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":128}}},"caching":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}}},"search_types":{"type":"object","additionalProperties":false,"properties":{"web_search":{"type":"object","additionalProperties":false},"image_search":{"type":"object","additionalProperties":false}}},"time_range_filter":{"type":"object","additionalProperties":false,"properties":{"start_time":{"type":"string","minLength":1,"maxLength":128},"end_time":{"type":"string","minLength":1,"maxLength":128}}}}},"ProviderPreferences":{"type":"object","additionalProperties":false,"properties":{"order":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":256}},"allow_fallbacks":{"type":"boolean","default":true},"require_parameters":{"type":"boolean","default":false},"data_collection":{"type":"string","enum":["allow","deny"]},"zdr":{"type":"boolean"},"only":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":256}},"ignore":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":256}},"quantizations":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":256}},"regions":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Numes extension filtering endpoint-declared country or region identifiers."},"sort":{"type":"string","enum":["price","throughput","latency","quality"],"description":"Deterministic provider sort. `quality` is a deliberate Numes compatibility extension that ranks endpoints by exact task-scoped content-free validation evidence; it is opt-in and never changes the default routing order.\n"},"max_price":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"number","minimum":0},"completion":{"type":"number","minimum":0}}}}},"ChatCompletionRequest":{"type":"object","additionalProperties":true,"properties":{"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"models":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"description":"Phase 1 accepts one model through either model or models; alternative-model fallback is rejected."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"stream":{"type":"boolean","default":false},"store":{"type":"boolean","enum":[false],"default":false,"description":"Only false is accepted, equivalent to omission. Stored completions are unsupported. This field is not forwarded and does not change billing metadata or provider retention policies; use provider.zdr and provider.data_collection for provider privacy requirements."},"n":{"type":["integer","null"],"minimum":1,"maximum":1,"description":"Only one response choice is supported. Omit or send 1; larger counts are rejected before dispatch."},"stream_options":{"type":["object","null"],"additionalProperties":false,"properties":{"include_usage":{"type":"boolean","deprecated":true}}},"usage":{"type":"object","additionalProperties":false,"deprecated":true,"description":"Legacy usage opt-in accepted for OpenRouter SDK clients. Usage is always returned regardless of include.","properties":{"include":{"type":"boolean"}}},"session_id":{"type":"string","minLength":1,"maxLength":256},"prompt_cache_key":{"type":"string","minLength":1,"maxLength":256,"description":"Privacy-sensitive cache affinity input. The gateway forwards only its keyed digest."},"prompt_cache_options":{"$ref":"#/components/schemas/PromptCacheOptions"},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"temperature":{},"top_p":{},"top_k":{},"max_tokens":{"type":["integer","null"],"minimum":1},"max_completion_tokens":{"type":["integer","null"],"minimum":1},"stop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"seed":{"type":["integer","null"]},"tools":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}},"max_tool_calls":{"type":"integer","minimum":1,"maximum":1024,"description":"Gateway-enforced upper bound for provider and hosted tool calls."},"tool_choice":{"oneOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object","additionalProperties":false,"required":["type","function"],"properties":{"type":{"const":"function"},"function":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1}}}}}],"description":"Enforced by the gateway and not forwarded as an Ollama generation option."},"parallel_tool_calls":{"type":"boolean","description":"Enforced by the gateway; false rejects a response containing multiple calls."},"reasoning":{"$ref":"#/components/schemas/ReasoningConfig"},"reasoning_effort":{"type":["string","null"],"description":"OpenAI-compatible shorthand for reasoning.effort."},"include_reasoning":{"type":"boolean","deprecated":true,"description":"Deprecated compatibility alias for the inverse of reasoning.exclude."},"response_format":{"description":"Provider-owned output format, forwarded without a fixed local format vocabulary."},"modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio"]}},"audio":{"type":"object","additionalProperties":false,"required":["voice","format"],"properties":{"voice":{"type":"string"},"format":{"type":"string","enum":["wav","mp3"]}}},"provider":{"$ref":"#/components/schemas/ProviderPreferences"},"user":{"type":"string","maxLength":256,"description":"Validated and ignored; never forwarded to a provider or retained as inference metadata."}},"anyOf":[{"required":["model"]},{"required":["models"]}]},"ReasoningConfig":{"type":"object","additionalProperties":true,"properties":{"effort":{},"max_tokens":{},"exclude":{"type":"boolean"},"enabled":{"type":"boolean"}}},"ToolCall":{"type":"object","additionalProperties":true,"required":["function"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","additionalProperties":true,"required":["name"],"properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}}},"Usage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","completion_tokens","total_tokens","cost"],"properties":{"usage_meter":{"type":"string","description":"Opaque identifier of the billing basis this request was charged under. Treat it as a label; the charged amounts are in the cost fields."},"token_count_basis":{"type":"string","enum":["provider_native","gateway_estimate"]},"gateway_billing_units":{"type":"object","description":"Historical gateway billing quantities; absent for current native-meter inference.","additionalProperties":false,"required":["prompt_units","completion_units","reasoning_units"],"properties":{"prompt_units":{"type":"integer","format":"int64","minimum":0},"completion_units":{"type":"integer","format":"int64","minimum":0},"reasoning_units":{"type":"integer","format":"int64","minimum":0}}},"native_tokens":{"$ref":"#/components/schemas/NativeTokenUsage"},"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"cost":{"type":"number","minimum":0,"description":"Settled cost in the inference key's immutable billing currency. For BTC keys, 1 is one satoshi and precision is one micro-satoshi.\n"},"prompt_tokens_details":{"$ref":"#/components/schemas/PromptTokensDetails"},"completion_tokens_details":{"$ref":"#/components/schemas/CompletionTokensDetails"},"cost_details":{"$ref":"#/components/schemas/CostDetails"},"input_images":{"type":"integer","minimum":0},"output_images":{"type":"integer","minimum":0},"input_audio_seconds":{"type":"number","minimum":0},"output_audio_seconds":{"type":"number","minimum":0},"hosted_tool_usage":{"type":"object","additionalProperties":{"type":"number","minimum":0},"description":"Exact namespaced hosted-tool SKU quantities attributable to this response."}}},"NativeTokenUsage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","completion_tokens"],"description":"Validated upstream native-token usage. Current native meters price these counts; reasoning partitions completion and cache partitions prompt.","properties":{"prompt_tokens":{"type":"integer","format":"int64","minimum":0},"completion_tokens":{"type":"integer","format":"int64","minimum":0},"reasoning_tokens":{"type":"integer","format":"int64","minimum":0},"cache_read_tokens":{"type":"integer","format":"int64","minimum":0},"cache_write_tokens":{"type":"integer","format":"int64","minimum":0}}},"PromptTokensDetails":{"type":"object","additionalProperties":false,"properties":{"cached_tokens":{"type":"integer","minimum":0},"cache_write_tokens":{"type":"integer","minimum":0},"audio_tokens":{"type":"integer","minimum":0}}},"CompletionTokensDetails":{"type":"object","additionalProperties":false,"properties":{"reasoning_tokens":{"type":"integer","minimum":0},"audio_tokens":{"type":"integer","minimum":0}}},"CostDetails":{"type":"object","additionalProperties":false,"required":["upstream_inference_cost"],"properties":{"upstream_inference_cost":{"type":"number","minimum":0},"upstream_inference_prompt_cost":{"type":"number","minimum":0},"upstream_inference_completions_cost":{"type":"number","minimum":0}}},"InternalUsage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","completion_tokens"],"description":"Settled usage quantities without internal metering evidence.","properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"reasoning_tokens":{"type":"integer","minimum":0},"cache_read_tokens":{"type":"integer","minimum":0},"cache_write_tokens":{"type":"integer","minimum":0},"input_images":{"type":"integer","minimum":0},"output_images":{"type":"integer","minimum":0},"input_audio_milliseconds":{"type":"integer","minimum":0},"output_audio_milliseconds":{"type":"integer","minimum":0},"input_characters":{"type":"integer","minimum":0},"requests":{"type":"integer","minimum":0},"skus":{"type":"object","additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$"}}}},"ChatCompletionResponse":{"type":"object","additionalProperties":false,"required":["id","object","created","model","choices","usage"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"created":{"type":"integer","format":"int64"},"model":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"provider":{"type":"string"},"choices":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","finish_reason","message"],"properties":{"index":{"type":"integer"},"finish_reason":{"type":["string","null"]},"message":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"const":"assistant"},"content":{"type":["string","null"]},"reasoning":{"type":"string"},"reasoning_details":{"type":"array","items":{"$ref":"#/components/schemas/ReasoningDetail"}},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}},"annotations":{"type":"array","items":{"$ref":"#/components/schemas/ResultAnnotation"}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ResultArtifact"}},"images":{"type":"array","items":{"type":"object","additionalProperties":true}},"audio":{"type":"object","additionalProperties":true}}}}}},"usage":{"$ref":"#/components/schemas/Usage"},"openrouter_metadata":{"type":"object","additionalProperties":true}}},"ResultAnnotation":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","enum":["url_citation","file_citation"]},"title":{"type":"string","maxLength":4096},"url":{"type":"string","format":"uri","maxLength":8192},"filename":{"type":"string","maxLength":255},"start_index":{"type":"integer","minimum":0},"end_index":{"type":"integer","minimum":0}}},"ResultArtifact":{"type":"object","additionalProperties":false,"required":["type","media_type","data"],"properties":{"type":{"type":"string","enum":["file","image","audio"]},"filename":{"type":"string","maxLength":255},"media_type":{"type":"string","maxLength":255},"data":{"type":"string","contentEncoding":"base64","maxLength":8388608}}},"EmbeddingRequest":{"type":"object","additionalProperties":false,"required":["model","input"],"properties":{"model":{"type":"string","minLength":3,"maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"input":{"oneOf":[{"type":"string","maxLength":4194304},{"type":"array","minItems":1,"maxItems":2048,"items":{"type":"string","maxLength":4194304}},{"type":"array","minItems":1,"maxItems":4194304,"items":{"type":"integer","minimum":0}},{"type":"array","minItems":1,"maxItems":2048,"items":{"type":"array","minItems":1,"maxItems":4194304,"items":{"type":"integer","minimum":0}}},{"type":"array","minItems":1,"maxItems":2048,"items":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ContentPart"}}}]},"dimensions":{"type":"integer","minimum":1,"maximum":65536},"encoding_format":{"type":"string","enum":["float","base64"],"default":"float"},"input_type":{"type":"string","maxLength":128},"provider":{"$ref":"#/components/schemas/ProviderPreferences"}}},"EmbeddingResponse":{"type":"object","additionalProperties":false,"required":["id","object","data","model","usage"],"properties":{"id":{"type":"string"},"object":{"const":"list"},"model":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["object","embedding","index"],"properties":{"object":{"const":"embedding"},"index":{"type":"integer","minimum":0},"embedding":{"oneOf":[{"type":"array","items":{"type":"number"}},{"type":"string","contentEncoding":"base64"}]}}}},"usage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","total_tokens","cost"],"properties":{"prompt_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"cost":{"type":"number","minimum":0}}}}},"ChatCompletionChunk":{"type":"object","additionalProperties":true,"required":["id","object","created","model","choices"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion.chunk"},"created":{"type":"integer","format":"int64"},"model":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"oneOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}]},"openrouter_metadata":{"type":"object","additionalProperties":true}}},"GenerationResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#/components/schemas/GenerationMetadata"}}},"GenerationMetadata":{"type":"object","additionalProperties":false,"required":["id","request_id","model","created_at","outcome","streamed","cancelled","delivered_output","usage","total_cost","upstream_inference_cost","cache_discount","attempts"],"properties":{"usage_meter":{"type":"string","description":"Opaque identifier of the selected offer's billing basis."},"id":{"type":"string","format":"uuid"},"request_id":{"type":"string"},"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"provider_name":{"type":["string","null"]},"provider_slug":{"type":["string","null"]},"endpoint":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"outcome":{"type":"string"},"streamed":{"type":"boolean"},"cancelled":{"type":"boolean"},"delivered_output":{"type":"boolean"},"usage":{"$ref":"#/components/schemas/Usage"},"total_cost":{"type":"number","minimum":0},"upstream_inference_cost":{"type":"number","minimum":0},"cache_discount":{"type":"number"},"attempts":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["ordinal","provider_name","provider_slug","endpoint","outcome","delivered_output","cancelled","usage","dispatch_state","financial_status"],"properties":{"usage_meter":{"type":"string"},"ordinal":{"type":"integer","minimum":1},"dispatch_state":{"type":"string","enum":["confirmed","uncertain"],"description":"Actual inference-envelope write or an explicitly uncertain provider handoff."},"financial_status":{"type":"string","enum":["pending","finalized"],"description":"Pending attempts omit cost fields until financial finalization."},"provider_name":{"type":"string"},"provider_slug":{"type":"string"},"endpoint":{"type":"string"},"outcome":{"type":"string"},"failure_class":{"type":"string"},"delivered_output":{"type":"boolean"},"cancelled":{"type":"boolean"},"usage":{"allOf":[{"$ref":"#/components/schemas/InternalUsage"}],"description":"Settled attempt usage; zero while accounting is pending."},"total_cost":{"type":"number","minimum":0,"description":"Final customer charge; absent while financial status is pending."},"upstream_inference_cost":{"type":"number","minimum":0,"description":"Final provider cost; absent while financial status is pending."}}}}}},"ImageRequest":{"type":"object","additionalProperties":false,"required":["model","prompt"],"properties":{"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"prompt":{"type":"string","minLength":1,"maxLength":1048576},"n":{"type":"integer","minimum":1,"maximum":10,"default":1},"size":{"type":"string"},"resolution":{"type":"string","maxLength":16},"aspect_ratio":{"type":"string","maxLength":16},"quality":{"type":"string","enum":["auto","low","medium","high"]},"output_format":{"type":"string","enum":["png","jpeg","webp"]},"background":{"type":"string","enum":["auto","opaque","transparent"]},"output_compression":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer","format":"int64"},"stream":{"type":"boolean","default":false},"input_references":{"type":"array","maxItems":16,"items":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["image_url"],"properties":{"image_url":{"type":"string"}}}]}},"provider":{"$ref":"#/components/schemas/ProviderPreferences"}}},"ImageResponse":{"type":"object","additionalProperties":false,"required":["created","data","usage"],"properties":{"created":{"type":"integer","format":"int64"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["b64_json","media_type"],"properties":{"b64_json":{"type":"string","contentEncoding":"base64"},"media_type":{"type":"string"},"revised_prompt":{"type":"string"}}}},"usage":{"$ref":"#/components/schemas/MediaUsage"}}},"MediaUsage":{"type":"object","additionalProperties":false,"required":["input_images","output_images","input_audio_seconds","output_audio_seconds","input_characters","prompt_tokens","completion_tokens","total_tokens","cost"],"properties":{"input_images":{"type":"integer","minimum":0},"output_images":{"type":"integer","minimum":0},"input_audio_seconds":{"type":"number","minimum":0},"output_audio_seconds":{"type":"number","minimum":0},"input_characters":{"type":"integer","minimum":0},"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"cost":{"type":"number","minimum":0}}},"SpeechRequest":{"type":"object","additionalProperties":false,"required":["model","input","voice"],"properties":{"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"input":{"type":"string","minLength":1,"maxLength":4096},"voice":{"type":"string"},"response_format":{"type":"string","enum":["mp3","pcm","wav"],"default":"mp3"},"speed":{"type":"number","minimum":0.25,"maximum":4,"default":1}}},"TranscriptionRequest":{"type":"object","additionalProperties":false,"required":["file","model"],"properties":{"file":{"type":"string","contentEncoding":"binary"},"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"language":{"type":"string"},"prompt":{"type":"string"},"response_format":{"type":"string","enum":["json","verbose_json"],"default":"json"},"temperature":{"type":"number","minimum":0,"maximum":1},"timestamp_granularities":{"type":"array","maxItems":2,"items":{"type":"string","enum":["word","segment"]}}}},"EncodedAudio":{"type":"object","additionalProperties":false,"required":["data","format"],"properties":{"data":{"type":"string","contentEncoding":"base64"},"format":{"type":"string","enum":["wav","mp3","flac","m4a","ogg","webm","aac","aiff","pcm16","pcm24"]}}},"TranscriptionJSONRequest":{"type":"object","additionalProperties":false,"required":["model"],"properties":{"model":{"type":"string","maxLength":393,"pattern":"^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$"},"file":{"$ref":"#/components/schemas/EncodedAudio"},"audio":{"$ref":"#/components/schemas/EncodedAudio"},"language":{"type":"string"},"prompt":{"type":"string","maxLength":4096},"response_format":{"type":"string","enum":["json","verbose_json"],"default":"json"},"temperature":{"type":"number","minimum":0,"maximum":1},"timestamp_granularities":{"type":"array","maxItems":2,"items":{"type":"string","enum":["word","segment"]}}},"oneOf":[{"required":["file"]},{"required":["audio"]}]},"TranscriptionResponse":{"type":"object","additionalProperties":false,"required":["text","usage"],"properties":{"text":{"type":"string"},"usage":{"type":"object","additionalProperties":false,"required":["type","seconds","input_audio_seconds","output_tokens","cost"],"properties":{"type":{"const":"duration"},"seconds":{"type":"number","minimum":0},"input_audio_seconds":{"type":"number","minimum":0},"output_tokens":{"type":"integer","minimum":0},"cost":{"type":"number","minimum":0}}}}},"KeyReset":{"type":["string","null"],"enum":["daily","weekly","monthly",null]},"KeyMetadata":{"type":"object","additionalProperties":false,"required":["hash","label","name","disabled","limit","limit_remaining","limit_reset","usage","usage_daily","usage_weekly","usage_monthly","created_at","updated_at","expires_at"],"properties":{"hash":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"},"billing_currency":{"type":"string","enum":["USD","BTC"],"description":"Immutable settlement currency; omitted for management keys."},"disabled":{"type":"boolean"},"limit":{"type":["number","null"]},"limit_remaining":{"type":["number","null"]},"limit_reset":{"$ref":"#/components/schemas/KeyReset"},"usage":{"type":"number"},"usage_daily":{"type":"number"},"usage_weekly":{"type":"number"},"usage_monthly":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"CurrentKeyResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"type":"object","required":["is_management_key"],"properties":{"is_management_key":{"type":"boolean"}}}]}}},"KeyResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#/components/schemas/KeyMetadata"}}},"KeyListResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KeyMetadata"}}}},"CreateKeyRequest":{"type":"object","additionalProperties":false,"required":["name","billing_currency"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"billing_currency":{"type":"string","enum":["USD","BTC"],"description":"Required, non-null immutable settlement currency for the inference key. Must be enabled for new operations."},"limit":{"type":["number","null"],"minimum":0},"limit_reset":{"$ref":"#/components/schemas/KeyReset"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"UpdateKeyRequest":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"disabled":{"type":"boolean"},"limit":{"type":["number","null"],"minimum":0},"limit_reset":{"$ref":"#/components/schemas/KeyReset"}}},"CreateKeyResponse":{"type":"object","additionalProperties":false,"required":["data","key"],"properties":{"data":{"$ref":"#/components/schemas/KeyMetadata"},"key":{"type":"string","description":"One-time plaintext key secret."}}},"DeleteKeyResponse":{"type":"object","additionalProperties":false,"required":["deleted"],"properties":{"deleted":{"const":true}}},"CreditsResponse":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["currency","total_credits","total_usage"],"properties":{"currency":{"type":"string","enum":["USD","BTC"],"description":"The requested settlement currency; BTC values are Bitcoin base units."},"total_credits":{"type":"number","description":"Net posted non-usage movements (funding less refunds, disputes, withdrawals, and corrections) as an exact decimal."},"total_usage":{"type":"number","description":"Lifetime settled usage charges as an exact decimal."}}}}}}}}