{"openapi":"3.1.0","info":{"title":"open-uncensored router","description":"OpenAI-compatible router for abliterated and uncensored models. Bring your own provider keys; requests are routed by quality, speed, cost or at random, with automatic fallback.","version":"0.1.0"},"paths":{"/v1/chat/completions":{"post":{"summary":"Create a chat completion","operationId":"chat_completions_v1_chat_completions_post","parameters":[{"name":"x-ou-strategy","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ou-Strategy"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"A chat completion, or with stream=true a text/event-stream of chat.completion.chunk events ending in `data: [DONE]`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses":{"post":{"summary":"Create a response (OpenAI Responses API)","description":"The Responses API used by Codex and other agents, served by translating to chat completions\n(responses_api.py). Function tools work; hosted OpenAI tools such as web search are dropped.","operationId":"responses_v1_responses_post","parameters":[{"name":"x-ou-strategy","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ou-Strategy"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages":{"post":{"summary":"Create a message (Anthropic Messages API)","description":"The Anthropic Messages API used by Claude Code and the Anthropic SDKs, served by translating to\nchat completions (messages_api.py). Send the key as ``x-api-key`` or ``Authorization: Bearer``.\nClient tools, images and streaming work; prompt caching is automatic (``cache_control`` is not\nneeded) and cached tokens come back as ``cache_read_input_tokens``. Errors use Anthropic's format.","operationId":"anthropic_messages_v1_messages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"x-ou-strategy","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ou-Strategy"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/count_tokens":{"post":{"summary":"Count the input tokens of a message (estimate)","description":"Anthropic's token counting endpoint. Providers do not publish their tokenizers, so the count is\nan estimate (about 4 characters per token); it is free and calls no model.","operationId":"anthropic_count_tokens_v1_messages_count_tokens_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"summary":"List models (public, no key needed)","description":"Every model with its providers and eval scores.  ``?available=true`` hides models that\nno configured, healthy provider can serve right now. A key that may use hidden models (an\nOU_API_KEY key or a preview customer) also sees those; without a key the list is the public one.","operationId":"list_models_v1_models_get","parameters":[{"name":"available","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Available"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models/{model_id}":{"get":{"summary":"Retrieve a model (public, no key needed)","description":"One model with per-provider live metrics, pricing, rate limits and circuit state.","operationId":"get_model_v1_models__model_id__get","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCard"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/models":{"get":{"summary":"Video models (public)","description":"Every video model with its lengths, resolutions and price per clip (provider price plus the usage markup).","operationId":"video_models_v1_videos_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/videos":{"post":{"summary":"Create a video from an image","description":"Start an image-to-video job, shaped like OpenAI's Videos API. JSON with ``model``, ``prompt``,\n``image`` (a data URL, base64 or an https link; also ``input_reference`` or ``image_url``) and optionally\n``seconds`` and ``resolution`` (or ``size``), or multipart/form-data with the image as the file field\n``input_reference``. Returns the job (status ``queued``); poll GET /v1/videos/{id}, then download\nGET /v1/videos/{id}/content. Credit is reserved now and the clip is charged only when it completes.","operationId":"create_video_v1_videos_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List your videos","operationId":"list_videos_v1_videos_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}":{"get":{"summary":"Check on a video","operationId":"get_video_v1_videos__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}/content":{"get":{"summary":"Download a finished video","operationId":"get_video_content_v1_videos__video_id__content_get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"post":{"summary":"Search the web","description":"Web results (title, url, snippet) for agents, from Brave Search with safe search off. Each search\ncosts Brave's price plus the usage markup, from the key's credit, like an image (web_search.py).","operationId":"search_web_v1_search_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/models":{"get":{"summary":"Image models (public)","description":"Every image model with its price per image (provider price plus the usage markup).","operationId":"image_models_v1_images_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/images/generations":{"post":{"summary":"Generate images","description":"OpenAI compatible image generation over the image catalogue (images.py), with the same\ncredit checks, holds, billing and request log as chat.","operationId":"images_generations_v1_images_generations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/edits":{"post":{"summary":"Edit images / new images from reference images","description":"OpenAI compatible image editing. Send reference images plus an instruction; the model draws a\nnew image that keeps them (same character, new scene). ``multipart/form-data`` like OpenAI\n(``image`` or ``image[]`` file fields, ``prompt``, ``model``, ``n``, ``size``, ``response_format``),\nor JSON with ``images``: a list of data URLs, base64 strings or https links. Image-to-image on the\nCivitai SDXL models also takes ``strength`` (0 to 1, default 0.6). Same credits and billing as\nimage generation.","operationId":"images_edits_v1_images_edits_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Prepaid credits used up (billing only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Every provider is rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Every provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"No provider available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stats/latency":{"get":{"summary":"Live speed from real traffic (public)","description":"Median and p90 latency, time to first token and tokens/s per model and provider, measured\non real API traffic over the last ``days`` days. Only model/provider pairs with at least 5\nsuccessful requests are listed. No key needed; contains no customer data.","operationId":"live_latency_v1_stats_latency_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/warm":{"post":{"summary":"Start a model that scales to zero","description":"Start a self-hosted model's GPU ahead of the first message (the playground calls this when\nyou pick one), so that message is answered by the model itself. Free; needs a key, so crawlers\ncannot keep the GPU running. Body: ``{\"model\": \"<id>\"}``. Other models: a no-op.","operationId":"warm_model_v1_warm_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/metrics":{"get":{"summary":"Metrics","description":"Live provider metrics: TTFT, tokens/s, latency percentiles and error rate over the last\nN requests, lifetime token and cost totals, circuit breaker and rate limit state. Operator key\nonly: it holds every customer's id and spend and our hosts' addresses, and any customer key\ncould read it (security review, 2026-11-28).","operationId":"metrics_metrics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits":{"get":{"summary":"Remaining prepaid credit","description":"The prepaid credit left on an ``ou-`` key bought at openuncensored.com, in USD.\n``remaining_usd`` is the Stripe balance minus usage not yet debited (debits go out about\nevery 30 seconds); it can dip slightly below zero, see the 402 ``insufficient_quota`` error.","operationId":"credits_v1_credits_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","description":"Liveness plus provider status from the circuit breakers.  ``?deep=true`` additionally\nprobes the configured upstreams, for the operator key only; a customer key gets the plain\nanswer. The probe skips scale-to-zero hosts that are not running: any request boots their GPU,\nso a $5 key calling this every few minutes kept our Modal boxes up around the clock\n(security review, 2026-11-28).","operationId":"health_health_get","parameters":[{"name":"deep","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Deep"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model","description":"A model id from GET /v1/models."},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","minItems":1,"title":"Messages"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"max_completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Completion Tokens"},"presence_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Presence Penalty"},"frequency_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Frequency Penalty"},"logit_bias":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Logit Bias"},"logprobs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Logprobs"},"top_logprobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top Logprobs"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Parallel Tool Calls"},"response_format":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Response Format"},"stream_options":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stream Options"},"routing":{"anyOf":[{"$ref":"#/components/schemas/RoutingPreferences"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["model","messages"],"title":"ChatCompletionRequest","description":"``POST /v1/chat/completions`` body.\n\nFields outside the OpenAI spec (``top_k``, ``min_p``, ``repetition_penalty``, ...) are\naccepted and forwarded to the provider as they are: those samplers matter for the models\nthis router serves."},"ChatCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"chat.completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#/components/schemas/Choice"},"type":"array","title":"Choices"},"usage":{"anyOf":[{"$ref":"#/components/schemas/UsageInfo"},{"type":"null"}]},"ou":{"anyOf":[{"$ref":"#/components/schemas/RouteInfo"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["id","created","model","choices"],"title":"ChatCompletionResponse"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"}},"additionalProperties":true,"type":"object","required":["role"],"title":"ChatMessage","description":"A chat message.  Unknown fields are kept and forwarded."},"Choice":{"properties":{"index":{"type":"integer","title":"Index"},"message":{"$ref":"#/components/schemas/ChoiceMessage"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"}},"additionalProperties":true,"type":"object","required":["index","message"],"title":"Choice"},"ChoiceMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls"}},"additionalProperties":true,"type":"object","required":["role"],"title":"ChoiceMessage"},"ErrorDetail":{"properties":{"message":{"type":"string","title":"Message"},"type":{"type":"string","title":"Type"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"},"code":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Code"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["message","type"],"title":"ErrorDetail"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"ErrorResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImageGenerationRequest":{"properties":{"model":{"type":"string","title":"Model"},"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt"},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","default":1},"size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size"},"response_format":{"anyOf":[{"type":"string","enum":["b64_json","url"]},{"type":"null"}],"title":"Response Format"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"negative_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Negative Prompt"}},"type":"object","required":["model","prompt"],"title":"ImageGenerationRequest","description":"OpenAI ``POST /v1/images/generations``. Other OpenAI fields (quality, style...) are ignored."},"ModelCard":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"model"},"created":{"type":"integer","title":"Created"},"owned_by":{"type":"string","title":"Owned By"},"base_model":{"type":"string","title":"Base Model"},"abliteration_method":{"type":"string","title":"Abliteration Method"},"hf_repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hf Repo"},"modality":{"type":"string","title":"Modality"},"context_length":{"type":"integer","title":"Context Length"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"eval_scores":{"additionalProperties":{"type":"number"},"type":"object","title":"Eval Scores"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"available":{"type":"boolean","title":"Available"},"providers":{"items":{"$ref":"#/components/schemas/ProviderRef"},"type":"array","title":"Providers"}},"additionalProperties":true,"type":"object","required":["id","created","owned_by","base_model","abliteration_method","modality","context_length","tags","eval_scores","available","providers"],"title":"ModelCard"},"ModelList":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ModelCard"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelList"},"ProviderRef":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["online","degraded","offline"],"title":"Status"},"configured":{"type":"boolean","title":"Configured"},"upstream_model":{"type":"string","title":"Upstream Model"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"}},"additionalProperties":true,"type":"object","required":["name","status","configured","upstream_model"],"title":"ProviderRef"},"RouteInfo":{"properties":{"request_id":{"type":"string","title":"Request Id"},"provider":{"type":"string","title":"Provider"},"upstream_model":{"type":"string","title":"Upstream Model"},"strategy":{"type":"string","title":"Strategy"},"latency_ms":{"type":"number","title":"Latency Ms"},"cost_usd":{"type":"number","title":"Cost Usd"},"usage_estimated":{"type":"boolean","title":"Usage Estimated"},"attempts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Attempts"}},"type":"object","required":["request_id","provider","upstream_model","strategy","latency_ms","cost_usd","usage_estimated","attempts"],"title":"RouteInfo","description":"Router extension: how the request was served (also in ``X-OU-*`` headers)."},"RoutingPreferences":{"properties":{"strategy":{"anyOf":[{"type":"string","enum":["quality","speed","throughput","cost","random","default","auto","latency","fastest","price","cheapest"]},{"type":"null"}],"title":"Strategy","description":"Overrides the account's and the server's default for this request. default = quality, latency = speed, price and cheapest = cost."},"only":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Only","description":"Only try these providers."},"ignore":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ignore","description":"Never try these providers."},"allow_fallbacks":{"type":"boolean","title":"Allow Fallbacks","description":"False: never answer with another model (the model's other providers are still tried when one fails before replying). To pin providers, use only.","default":true}},"additionalProperties":false,"type":"object","title":"RoutingPreferences","description":"Router extension: how this request should be routed."},"SearchRequest":{"properties":{"query":{"type":"string","maxLength":400,"minLength":1,"title":"Query","description":"What to search the web for."},"count":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Count","description":"Results to return, 1 to 20.","default":8},"freshness":{"anyOf":[{"type":"string","enum":["day","week","month","year"]},{"type":"null"}],"title":"Freshness","description":"Only pages from the last day, week, month or year."}},"type":"object","required":["query"],"title":"SearchRequest","description":"POST /v1/search: a web search, billed per query to the key."},"UsageInfo":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens"},"completion_tokens":{"type":"integer","title":"Completion Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"UsageInfo"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}