{"openapi":"3.0.0","info":{"description":"NagaAI inference API (naga.ac) — OpenAI/Anthropic-compatible v1 surface: chat, responses, messages, embeddings, moderations, audio and images.","version":"v1"},"servers":[{"description":"NagaAI inference API (naga.ac) — OpenAI/Anthropic-compatible v1 surface: chat, responses, messages, embeddings, moderations, audio and images.","url":"https://api.apirails.com/naga"}],"paths":{"/v1/models":{"get":{"tags":["Models"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/models/list-models","api_endpoint":"https://api.naga.ac/v1/models"},"summary":"List models","description":"Returns the models NagaAI serves, whole and unpaged. Requires no key; presenting one narrows the catalog to the models the key may run.","security":[{"bearerAuth":[]}]}},"/v1/startups":{"get":{"tags":["Startups"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/startups/list-startups","api_endpoint":"https://api.naga.ac/v1/startups"},"summary":"List startups","description":"Returns the organizations whose models NagaAI serves. Requires no key, and presenting one changes nothing.","security":[{"bearerAuth":[]}]}},"/v1/responses":{"post":{"tags":["Responses"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/responses/create-a-response","api_endpoint":"https://api.naga.ac/v1/responses"},"summary":"Create response","description":"Runs a model over a prompt or conversation and returns its output (the Responses API surface).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"object","description":"The shape of the reply (format, verbosity) and how long it should run","properties":{"format":{"type":"string","description":"The reply format","enum":["text","json_object","json_schema"]},"verbosity":{"type":"string","description":"How verbose the reply should be"}}},"input":{"type":"string","description":"The prompt: one string, or the conversation as typed items, oldest first","required":true},"instructions":{"type":"string","description":"A system instruction put ahead of the conversation"},"max_output_tokens":{"type":"number","description":"The ceiling on generated tokens, reasoning included; at least 1 (the gateway raises it where the reasoning budget would not fit)"},"model":{"type":"string","description":"The model to run, named by an id or alias from NagaAI's catalog","required":true},"parallel_tool_calls":{"type":"boolean","description":"Whether the model may return several tool calls in one turn (reaches only some providers)"},"reasoning":{"type":"object","description":"How much reasoning to do, and what summary of it comes back","properties":{"effort":{"type":"string","description":"How much reasoning the model spends before answering","enum":["none","minimal","low","medium","high","xhigh"]},"generate_summary":{"type":"string","description":"Legacy spelling of summary"},"summary":{"type":"string","description":"What summary of the reasoning comes back"}}},"stream":{"type":"boolean","description":"Whether the reply arrives incrementally as the model writes it"},"temperature":{"type":"number","description":"How much randomness goes into the reply, between 0 and 2"},"tool_choice":{"type":"string","description":"Which tool, if any, the model calls this turn: none, auto, required, or a hosted tool name"},"tools":{"type":"array","description":"The tools the model may call; web_search and web_search_preview are the only hosted ones the gateway runs","items":{"type":"object","properties":{"type":{"type":"string","description":"The tool kind; hosted web-search tools run without a function body","required":true,"enum":["function","web_search","web_search_preview"]},"function":{"type":"object","description":"The function declaration, for type=function tools"}}}},"top_p":{"type":"number","description":"The sampling cut-off, between 0 and 1; an alternative to temperature"},"truncation":{"type":"string","description":"What to do when the conversation outgrows the context window (reaches only some providers)","enum":["auto","disabled"]}}},"example":{"text":{},"input":"Explain quantum computing in simple terms.","instructions":"","max_output_tokens":"","model":"gpt-6-astra","parallel_tool_calls":"","reasoning":{},"stream":"","temperature":"","tool_choice":"auto","tools":[],"top_p":"","truncation":""}}}}}},"/v1/chat/completions":{"post":{"tags":["Chat"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion","api_endpoint":"https://api.naga.ac/v1/chat/completions"},"summary":"Create chat completion","description":"Runs a model over a chat-formatted conversation and returns one completion (the Chat Completions API surface).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"frequency_penalty":{"type":"number","description":"How hard repetition is penalized, scaled by how often, from -2 to 2"},"functions":{"type":"array","description":"The pre-tools function-calling surface (legacy; a request carrying it draws a refusal)","items":{"type":"object","properties":{"description":{"type":"string","description":"What the function does"},"name":{"type":"string","description":"The function name the model calls","required":true},"parameters":{"type":"object","description":"The arguments the function takes, as a JSON Schema object"}}}},"image_config":{"type":"object","description":"An aspect ratio and a size for image output, a NagaAI extension (the gateway drops it)","properties":{}},"logit_bias":{"type":"object","description":"A map from token id to sampling bias (the gateway drops it)","properties":{}},"max_completion_tokens":{"type":"number","description":"The ceiling on generated tokens, reasoning included; at least 1"},"max_tokens":{"type":"number","description":"An alias of max_completion_tokens, read only when that key is absent; at least 1"},"messages":{"type":"array","description":"The conversation so far, oldest first; one entry at least. Roles: system, user, assistant, tool","required":true,"items":{"type":"object","properties":{"content":{"type":"string","description":"What was said: one string, or an array of content parts","required":true},"role":{"type":"string","description":"Who the message is from","required":true},"tool_call_id":{"type":"string","description":"On a tool message, the id of the call it answers"},"tool_calls":{"type":"array","description":"The tool calls an earlier assistant turn made, echoed back so results can be matched"}}}},"model":{"type":"string","description":"The model to run, named by an id or alias from NagaAI's catalog","required":true},"parallel_tool_calls":{"type":"boolean","description":"Whether the model may return several tool calls in one turn"},"prediction":{"type":"object","description":"Content the reply is expected to reproduce (the gateway drops it)","properties":{}},"presence_penalty":{"type":"number","description":"How hard a token is penalized for having appeared, from -2 to 2"},"reasoning_effort":{"type":"string","description":"How much reasoning to spend before answering, from none to xhigh","enum":["none","minimal","low","medium","high","xhigh"]},"response_format":{"type":"object","description":"The shape the model's output must take, selected by type","properties":{"type":{"type":"string","description":"The output shape","enum":["text","json_object","json_schema"]}}},"stop":{"type":"array","description":"Strings that end generation the moment the model produces one (up to 4)","items":{"type":"string"}},"stream":{"type":"boolean","description":"Whether the reply arrives incrementally as the model writes it"},"stream_options":{"type":"object","description":"Extra streaming behavior","properties":{"include_usage":{"type":"boolean","description":"Adds one trailing chunk carrying the request's token totals"}}},"temperature":{"type":"number","description":"How much randomness goes into the reply, between 0 and 2; an alternative to top_p"},"tool_choice":{"type":"string","description":"Which tool, if any, the model calls: none, auto, required, or a named tool"},"tools":{"type":"array","description":"The tools the model is allowed to call","items":{"type":"object","properties":{"type":{"type":"string","description":"The tool kind; hosted web-search tools run without a function body","required":true,"enum":["function","web_search","web_search_preview"]},"function":{"type":"object","description":"The function declaration, for type=function tools"}}}},"top_p":{"type":"number","description":"The sampling cut-off, between 0 and 1; an alternative to temperature"},"web_search_options":{"type":"object","description":"Settings for the hosted web-search tool (the gateway drops them)","properties":{}}}},"example":{"frequency_penalty":"","functions":[],"image_config":{},"logit_bias":{},"max_completion_tokens":"","max_tokens":"","messages":[{"content":"Explain quantum computing in simple terms.","role":"user"}],"model":"gpt-6-astra","parallel_tool_calls":"","prediction":{},"presence_penalty":"","reasoning_effort":"","response_format":{},"stop":[],"stream":"","stream_options":{},"temperature":"","tool_choice":"auto","tools":[{"type":"function","function":{"description":"Get the current weather for a location","name":"get_weather","parameters":{"type":"object","properties":{"location":{"type":"string"}}}}}],"top_p":"","web_search_options":{}}}}}}},"/v1/messages":{"post":{"tags":["Messages"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/messages/create-a-message","api_endpoint":"https://api.naga.ac/v1/messages"},"summary":"Create message","description":"Runs a model over an Anthropic-style messages conversation (system outside, content blocks inside) and returns one message.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"max_tokens":{"type":"number","description":"The ceiling on generated tokens; required, at least 1 (the gateway raises it where the reasoning budget would not fit)","required":true},"messages":{"type":"array","description":"The conversation so far, oldest first: one to 100000 entries","required":true,"items":{"type":"object","properties":{"content":{"type":"string","description":"What was said: one string, or at least one content block","required":true},"role":{"type":"string","description":"Whose turn this is, and what blocks it may carry","required":true}}}},"metadata":{"type":"object","description":"An object describing the request; only user_id counts, and it reaches only some providers","properties":{"user_id":{"type":"string","description":"External identifier for the end user"}}},"model":{"type":"string","description":"The model to run, named by an id or alias from NagaAI's catalog","required":true},"output_config":{"type":"object","description":"Output-level settings; effort wins over the thinking budget","properties":{"effort":{"type":"string","description":"How much reasoning the output gets","enum":["low","medium","high","xhigh","max"]}}},"stop_sequences":{"type":"array","description":"Strings that end generation the moment the model produces one; the reply never names which matched","items":{"type":"string"}},"stream":{"type":"boolean","description":"Whether the reply arrives incrementally as the model writes it"},"system":{"type":"string","description":"The system prompt, as one string or as text blocks joined in order"},"temperature":{"type":"number","description":"How much randomness goes into the reply, between 0 and 2"},"thinking":{"type":"object","description":"How much reasoning the model does before answering; the budget becomes a tier (under 1024 draws a refusal)","properties":{"budget_tokens":{"type":"number","description":"The reasoning token budget"}}},"tool_choice":{"type":"object","description":"Which tool, if any, the model is to call","properties":{"type":{"type":"string","description":"What the model may do with the declared tools"}}},"tools":{"type":"array","description":"The tools the model may call; two dated web-search stamps are the only hosted ones the gateway serves","items":{"type":"object","properties":{"type":{"type":"string","description":"The tool kind; hosted web-search tools run without a function body","required":true,"enum":["function","web_search","web_search_preview"]},"function":{"type":"object","description":"The function declaration, for type=function tools"}}}},"top_k":{"type":"number","description":"How many top candidates each token is drawn from (reaches only some providers)"},"top_p":{"type":"number","description":"The sampling cut-off, between 0 and 1; an alternative to temperature"}}},"example":{"max_tokens":"","messages":[{"content":"Explain quantum computing in simple terms.","role":"user"}],"metadata":{},"model":"claude-sonnet-4-5","output_config":{},"stop_sequences":[],"stream":"","system":"","temperature":"","thinking":{},"tool_choice":{},"tools":[],"top_k":"","top_p":""}}}}}},"/v1/embeddings":{"post":{"tags":["Embeddings"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/embeddings/create-embeddings","api_endpoint":"https://api.naga.ac/v1/embeddings"},"summary":"Create embeddings","description":"Embeds strings, token ids, or arrays of either with the named embeddings model.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"dimensions":{"type":"number","description":"The vector length to ask for (the gateway bounds nothing and drops the key where the provider has no such parameter)"},"encoding_format":{"type":"string","description":"How the vectors come back; base64 costs precision, since the gateway holds them as 64-bit","enum":["float","base64"]},"input":{"type":"string","description":"What to embed: strings, token ids, or arrays of either","required":true},"model":{"type":"string","description":"The model to embed with, named by its id or alias","required":true}}},"example":{"dimensions":"","encoding_format":"","input":"The quick brown fox","model":"text-embedding-3-large"}}}}}},"/v1/moderations":{"post":{"tags":["Moderations"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/moderations/classify-content","api_endpoint":"https://api.naga.ac/v1/moderations"},"summary":"Classify content","description":"Classifies content against the named moderation model; each image_url part costs a flat 250 input tokens.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"What to moderate: one string, or an array of strings / image_url parts","required":true},"model":{"type":"string","description":"The moderation model, named by its id or alias","required":true}}},"example":{"input":"Is this safe?","model":"omni-moderation-latest"}}}}}},"/v1/audio/speech":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/audio/create-speech","api_endpoint":"https://api.naga.ac/v1/audio/speech"},"summary":"Create speech","description":"Synthesises speech from text with the named speech model; the response_format also sets the answer's Content-Type.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"The text to read aloud, at most 32768 Unicode characters","required":true},"instructions":{"type":"string","description":"Free-form direction for how the text should be delivered"},"model":{"type":"string","description":"The speech model to synthesise with, named by its id or alias","required":true},"response_format":{"type":"string","description":"The audio container to synthesise into","enum":["mp3","opus","aac","flac","wav","pcm"]},"speed":{"type":"number","description":"How fast to read, as a multiplier of the model's normal pace; zero or less draws a 400"},"voice":{"type":"string","description":"The voice to read in, by the name the model knows it under","required":true}}},"example":{"input":"The quick brown fox jumped over the lazy dog.","instructions":"","model":"gpt-4o-mini-tts","response_format":"","speed":"","voice":"alloy"}}}}}},"/v1/audio/transcriptions":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/audio/create-a-transcription","api_endpoint":"https://api.naga.ac/v1/audio/transcriptions"},"summary":"Create transcription","description":"Transcribes an audio file into text in the language spoken (multipart/form-data upload; the gateway converts the container where the provider needs another).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","format":"binary","description":"The audio file itself (the gateway converts the container where the provider needs another)","required":true},"language":{"type":"string","description":"The language spoken in the audio, as a lower-case ISO 639-1 code; any other shape draws a 400"},"model":{"type":"string","description":"The model to transcribe with, named by its id or alias","required":true},"prompt":{"type":"string","description":"A free-form hint for the provider: names, jargon, expected style"}}},"example":{"file":"file","language":"en","model":"whisper-1","prompt":""}}}}}},"/v1/audio/translations":{"post":{"tags":["Audio"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/audio/create-a-translation","api_endpoint":"https://api.naga.ac/v1/audio/translations"},"summary":"Create translation","description":"Translates an audio file into English text (multipart/form-data upload; the gateway converts the container where the provider needs another).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","format":"binary","description":"The audio file itself (the gateway converts the container where the provider needs another)","required":true},"language":{"type":"string","description":"The language spoken in the audio, as a lower-case ISO 639-1 code; any other shape draws a 400"},"model":{"type":"string","description":"The model to translate with, named by its id or alias","required":true},"prompt":{"type":"string","description":"A free-form hint for the provider: names, jargon, expected style"}}},"example":{"file":"file","language":"es","model":"whisper-1","prompt":""}}}}}},"/v1/images/generations":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/images/create-an-image","api_endpoint":"https://api.naga.ac/v1/images/generations"},"summary":"Create an image","description":"Generates images from a text prompt with the named image model; moderation screens the prompt first.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"model":{"type":"string","description":"The model to generate with, named by its id or alias","required":true},"n":{"type":"number","description":"How many images to ask for; absent means one, and a value above what the model declares draws a refusal"},"prompt":{"type":"string","description":"What to generate, in words; one to 8192 characters, and moderation screens it first","required":true},"quality":{"type":"string","description":"The provider's quality knob, passed through unchecked; a provider without one drops it"},"response_format":{"type":"string","description":"Whether each image comes back as a link (url) or as inline base64 (b64_json)","enum":["url","b64_json"]},"size":{"type":"string","description":"The requested image size, written {width}x{height}; any other shape draws a refusal"}}},"example":{"model":"gpt-image-1","n":"","prompt":"A red panda sitting on a log","quality":"","response_format":"","size":"1024x1024"}}}}}},"/v1/images/edits":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.naga.ac/api-reference/images/edit-an-image","api_endpoint":"https://api.naga.ac/v1/images/edits"},"summary":"Edit an image","description":"Edits the supplied image(s) per the prompt with the named image model (multipart/form-data upload; one part per image, image[] merges into the same list).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"background":{"type":"string","description":"The provider's background knob, passed through unchecked; a provider without one drops it"},"image":{"type":"string","format":"binary","description":"The images to edit, one per part named image (image[] merges into the same list)","required":true},"mask":{"type":"string","format":"binary","description":"A single image whose transparent area marks what the model may repaint"},"model":{"type":"string","description":"The model to edit with, named by its id or alias","required":true},"n":{"type":"number","description":"How many images to ask for; absent means one, and a value above what the model declares draws a refusal"},"prompt":{"type":"string","description":"What to change, in words; one to 32000 characters","required":true},"quality":{"type":"string","description":"The provider's quality knob, passed through unchecked; a provider without one drops it"},"response_format":{"type":"string","description":"Whether each image comes back as a link (url) or as inline base64 (b64_json)","enum":["url","b64_json"]},"size":{"type":"string","description":"The requested image size, written {width}x{height}; any other shape draws a refusal"}}},"example":{"background":"","image":"file","mask":"(binary)","model":"gpt-image-1","n":"","prompt":"Make the sky sunset-colored","quality":"","response_format":"","size":"1024x1024"}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}