{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/models/":{"get":{"summary":"List Models","description":"List all accessible models in OpenAI format.\n\n`?type=` accepts one or a comma-separated set of\n`llm,audio,image,video,embedding,rerank`;\nabsent means everything. LLM entries come first so OpenAI-compatible chat\nclients keep seeing chat models at the top of the list.","operationId":"list_models_models__get","parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model}/":{"get":{"summary":"Get Model","description":"Get a single model detail in OpenAI format.","operationId":"get_model_models__model___get","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","title":"Model"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/completions/":{"post":{"summary":"Chat Completions","operationId":"chat_completions_chat_completions__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/chatbots/{chatbot_id}/chat/completions/":{"post":{"tags":["gateway"],"summary":"Call a specific chatbot via API key (OpenAI-compatible)","operationId":"GatewayChatbotChatCompletions","parameters":[{"name":"chatbot_id","in":"path","required":true,"schema":{"type":"integer","title":"Chatbot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayChatbotChatReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayChatbotChatRes"}}}},"400":{"description":"Unsupported chatbot type"},"401":{"description":"Authentication failed"},"404":{"description":"Chatbot not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/claude/v1/models/":{"get":{"tags":["gateway"],"summary":"List Anthropic models","description":"List accessible chat models in Anthropic API format, Claude first.\n\nUsed by Claude for Office, Claude Code's gateway model discovery and other\nAnthropic SDK clients that call GET /v1/models. Every model listed can be\ncalled on /v1/messages; non-Claude ones go through the chat relay.","operationId":"AnthropicListModels","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Anthropiclistmodels"}}}}}}},"/claude/v1/messages/":{"post":{"tags":["gateway"],"summary":"Anthropic Messages API pass-through","operationId":"AnthropicMessages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/claude/v1/messages/count_tokens/":{"post":{"tags":["gateway"],"summary":"Anthropic count_tokens pass-through","description":"Pass-through proxy for Anthropic token counting. No credit logic needed.\n\nA non-Claude model is counted locally: Anthropic's endpoint rejects it.","operationId":"AnthropicCountTokens","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gemini/v1beta/models/":{"get":{"tags":["gateway"],"summary":"List Gemini models","description":"List accessible Gemini models in the Gemini API format.","operationId":"GeminiListModels","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Geminilistmodels"}}}}}}},"/gemini/v1beta/models/{model_and_method}/":{"post":{"tags":["gateway"],"summary":"Gemini generateContent / streamGenerateContent / countTokens pass-through","operationId":"GeminiGenerateContent","parameters":[{"name":"model_and_method","in":"path","required":true,"schema":{"type":"string","title":"Model And Method"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/responses/":{"post":{"tags":["gateway"],"summary":"OpenAI Responses API pass-through","operationId":"CreateResponse","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/audio/speech/":{"post":{"summary":"Text To Speech","description":"Generate speech audio from text using a Gemini TTS model.\n\nRequest body: {model, input, voice, speakers?, instructions?}\n`instructions` (delivery style, OpenAI /audio/speech name) is accepted by\ngemini-3.8-* models only.\nResponse: raw PCM bytes (audio/pcm) with X-Input-Tokens / X-Output-Tokens headers.","operationId":"text_to_speech_audio_speech__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/audio/music/":{"post":{"summary":"Generate Music","description":"Generate music or a sound effect. Synchronous — MP3 bytes come straight back.\n\nRequest body: {model, prompt, lyrics?, duration_seconds?}\nResponse: raw MP3 bytes (audio/mpeg) with X-Model / X-Credits-Charged and,\nfor Lyria, X-Music-Structure.","operationId":"generate_music_audio_music__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/audio/transcriptions/":{"post":{"summary":"Create Transcription","description":"Start a speech-to-text transcription. Asynchronous — poll for the result.\n\nMultipart form: {file, model, language_hints?, enable_speaker_diarization?}\n— the last two carry Soniox's own field names. Repeat `language_hints` once\nper code (default `en`, `ko`).\nReturns: {operation_id, status: \"processing\", model, duration_seconds,\ncredits_charged}. Poll GET /v1/gateway/audio/transcriptions/{operation_id}/.\n\nBilling is settled here, off the duration probed from the uploaded file —\npolling never charges again. A file over the 2-hour cap, or one whose\ncontainer carries no readable duration, is a 400 before any provider work.","operationId":"create_transcription_audio_transcriptions__post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_transcription_audio_transcriptions__post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audio/transcriptions/{operation_id}/":{"get":{"summary":"Get Transcription","description":"Poll a transcription started by POST /v1/gateway/audio/transcriptions/.\n\nReturns: {operation_id, status} plus, once completed, {text, segments,\nduration_seconds}. Free — the credits were charged at kickoff, so polling\n(including polling a finished job again) never bills.\n\nThe operation id is signed for the member who started the job; any other\nkey — a colleague's included — and any id that does not verify gets the\nsame 404.","operationId":"get_transcription_audio_transcriptions__operation_id___get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/images/generate/":{"post":{"summary":"Generate Image","description":"Generate image(s) via the gateway.\n\nReturns images immediately for sync providers (Google, OpenAI) or\nan operation_id for async providers (Fal, Replicate).\n\nRequest body:\n    model (str): Image model name\n    prompt (str): Generation prompt\n    number_of_images (int, optional): Number of images to generate (default: 1)\n    input_images (list[str], optional): Input image URLs for edit mode\n    <generation parameters> (optional): any parameter the model declares in\n        its catalog schema (GET /v1/gateway/models/{model}/) — e.g. `size` /\n        `quality` / `background` for the GPT Image family, `rendering_speed`\n        / `style` for Ideogram, `aspect_ratio` / `resolution` elsewhere.\n        Parameters the model does not declare are ignored; anything left out\n        falls back to the model's declared default.","operationId":"generate_image_images_generate__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/images/generate/{operation_id}/":{"get":{"summary":"Poll Image Status","description":"Poll async image generation status (Fal/Replicate providers only).\n\nQuery params:\n    model (str): Image model name used for generation","operationId":"poll_image_status_images_generate__operation_id___get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/video/generation/":{"post":{"summary":"Create Video","description":"Start async video generation.\n\nRequest body: {model, prompt, parameters?, input_urls?}\nReturns: {operation_id, status: \"processing\", video_model_id: int}","operationId":"create_video_video_generation__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/video/generation/{operation_id}/download/":{"get":{"summary":"Download Video File","description":"Download completed video — streams raw bytes (video/mp4).","operationId":"download_video_file_video_generation__operation_id__download__get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/video/generation/{operation_id}/":{"get":{"summary":"Get Video Generation Status","description":"Poll video generation status.\n\nReturns: {operation_id, status, video_uri?, duration_seconds?}","operationId":"get_video_generation_status_video_generation__operation_id___get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/estimate/":{"post":{"summary":"Estimate","description":"Price a media call before making it.\n\nRequest body: the body you would send to the generation endpoint, plus\n`kind` — `image` (`POST /images/generate/`: model, number_of_images, model\nparameters), `video` (`POST /video/generation/`: model, parameters) or\n`music` (`POST /audio/music/`: model, duration_seconds). `prompt` is not\nneeded.\n\nReturns: {object: \"estimate\", kind, model, credits, exact, bound, lines:\n[{item, credits, exact, bound, basis, note?}]}. `bound` says where the\ncharge lies against the quote: `exact`, `minimum` (token-priced images),\n`maximum` (a sound effect whose length the engine picks) or `approximate`\n(the member's own credit may apply at another rate). `note` explains it.","operationId":"estimate_estimate__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/credits/":{"get":{"summary":"Get Credit Balance","description":"Return the authenticated member's remaining credit balance.","operationId":"get_credit_balance_credits__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/keys/revoke/":{"post":{"summary":"Revoke Current Key","description":"Disable the key that authenticated this request.\n\nWithout this, the only way to revoke a key is a person in the console -\nthe wrong shape for a key that lives in CI or on a laptop that was just\nlost. A key can only revoke itself, so holding it grants nothing new.\n`apikey_middleware` reads the key fresh on every request, so the next call\nwith it is a 401.","operationId":"revoke_current_key_keys_revoke__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/usage/":{"get":{"summary":"Get Usage","description":"Gateway spend for this key (scope=key, default) or this member (scope=member).\n\n`from` and `to` are inclusive dates in Korea time.","operationId":"get_usage_usage__get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"model","title":"By"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"key","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/embeddings/":{"post":{"summary":"Create Embeddings","operationId":"create_embeddings_embeddings__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/decisions/":{"post":{"summary":"Decisions","operationId":"decisions_decisions__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/rerank/":{"post":{"summary":"Rerank","operationId":"rerank_rerank__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/guard/":{"post":{"summary":"Guard","operationId":"guard_guard__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/realtime/sessions/":{"post":{"summary":"Create Live Session","description":"A 60-second single-use token a browser connects with (`?token=`).","operationId":"create_live_session_realtime_sessions__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Live Session Realtime Sessions  Post"}}}}}}},"/mcp/":{"get":{"summary":"Mcp List","operationId":"mcp_list_mcp__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mcp List Mcp  Get"}}}}}}},"/mcp/{suite}/":{"post":{"summary":"Mcp Post","operationId":"mcp_post_mcp__suite___post","parameters":[{"name":"suite","in":"path","required":true,"schema":{"type":"string","title":"Suite"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Mcp Not Allowed","operationId":"mcp_not_allowed_mcp__suite___delete","parameters":[{"name":"suite","in":"path","required":true,"schema":{"type":"string","title":"Suite"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Mcp Not Allowed","operationId":"mcp_not_allowed_mcp__suite___get","parameters":[{"name":"suite","in":"path","required":true,"schema":{"type":"string","title":"Suite"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exa/search/":{"post":{"summary":"Exa Search","operationId":"exa_search_exa_search__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/exa/contents/":{"post":{"summary":"Exa Contents","operationId":"exa_contents_exa_contents__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/exa/answer/":{"post":{"summary":"Exa Answer","operationId":"exa_answer_exa_answer__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_create_transcription_audio_transcriptions__post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"model":{"type":"string","title":"Model"},"language_hints":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Language Hints"},"enable_speaker_diarization":{"type":"boolean","title":"Enable Speaker Diarization","default":true}},"type":"object","required":["file","model"],"title":"Body_create_transcription_audio_transcriptions__post"},"ChatCompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","default":0},"message":{"$ref":"#/components/schemas/ChatCompletionMessage"},"finish_reason":{"type":"string","title":"Finish Reason","default":"stop"}},"type":"object","required":["message"],"title":"ChatCompletionChoice"},"ChatCompletionMessage":{"properties":{"role":{"type":"string","const":"assistant","title":"Role","default":"assistant"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatCompletionMessage"},"ChatCompletionUsage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","default":0}},"type":"object","title":"ChatCompletionUsage"},"ChatMessage":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"GatewayChatbotChatReq":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","minItems":1,"title":"Messages"},"stream":{"type":"boolean","title":"Stream","default":false}},"type":"object","required":["messages"],"title":"GatewayChatbotChatReq","description":"Stateless from the caller's view — the caller supplies the full message\nhistory each call; no session is persisted server-side."},"GatewayChatbotChatRes":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"chat.completion","title":"Object","default":"chat.completion"},"created":{"type":"integer","title":"Created","default":0},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionChoice"},"type":"array","title":"Choices"},"usage":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionUsage"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credits"},"files":{"items":{"$ref":"#/components/schemas/GeneratedFile"},"type":"array","title":"Files","default":[]}},"type":"object","required":["id","model","choices"],"title":"GatewayChatbotChatRes"},"GeneratedFile":{"properties":{"file_id":{"type":"integer","title":"File Id"},"filename":{"type":"string","title":"Filename"},"mime_type":{"type":"string","title":"Mime Type"},"url":{"type":"string","title":"Url"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["file_id","filename","mime_type","url","expires_in"],"title":"GeneratedFile","description":"A file the turn produced, delivered as a signed no-login URL.\n\nMUST stay declared on `GatewayChatbotChatRes` below: FastAPI filters the\nhandler's dict through the response model, so an undeclared field is\nsilently dropped on the wire even though the service built it."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"servers":[{"url":"https://api.baze.co/v1/gateway"}]}