{"openapi":"3.0.0","info":{"description":"India-resident OpenAI-compatible inference API for open-weight models: chat completions, streaming, batch jobs and file uploads, served exclusively from GPUs in Indian data centres (DPDP-aligned, zero retention)","version":[{"name":"v1","value":"v1"}]},"servers":[{"description":"India-resident OpenAI-compatible inference API for open-weight models: chat completions, streaming, batch jobs and file uploads, served exclusively from GPUs in Indian data centres (DPDP-aligned, zero retention)","url":"https://api.apirails.com/indierouter"}],"paths":{"/v1/models":{"get":{"tags":["Models"],"parameters":[{"name":"kind","in":"query","description":"Modality filter. Lists chat models by default (so coding-agent model pickers stay clean); pass all for every modality, or one of ocr, asr, tts for a single kind","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["all","ocr","asr","tts"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/models"},"summary":"List models","description":"Lists models. Chat models are listed by default; add ?kind=all for every modality, or ?kind=ocr, asr or tts for one. Each entry carries its kind.","security":[{"bearerAuth":[]}]}},"/v1/chat/completions":{"post":{"tags":["Chat Completions"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/chat/completions"},"summary":"Create chat completion","description":"Implements the OpenAI chat surface. Required fields are model and messages; temperature, top_p, max_tokens, stop, stream, tools, tool_choice and response_format pass through to the model. The response shape matches OpenAI, including usage with prompt_tokens, completion_tokens and total_tokens. Prompt prefixes are cached automatically; cached input tokens bill at the model's cached-input rate","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"max_tokens":{"type":"number","description":"The maximum number of tokens to generate; passes through to the model"},"messages":{"type":"array","description":"The messages that make up the conversation so far (OpenAI chat surface)","required":true,"items":{"type":"object","properties":{"content":{"type":"string","description":"Content of the message","required":true},"role":{"type":"string","description":"Role of the message sender (OpenAI chat surface: system, user, assistant, tool)","required":true}}}},"model":{"type":"string","description":"The model that will complete your prompt. The model parameter takes the model id directly: no route aliases, no silent fallback to a cheaper model. Context length 256K for all listed models","required":true},"response_format":{"type":"object","description":"Response format; passes through to the model (JSON mode: {\"type\": \"json_object\"})","properties":{"type":{"type":"string","description":"Response format type (OpenAI surface: text, json_object)","required":true}}},"stop":{"type":"array","description":"Stop sequences; passes through to the model","items":{"type":"string"}},"stream":{"type":"boolean","description":"Set true to receive server-sent events: one chat.completion.chunk per token batch, terminated by data: [DONE], exactly as the OpenAI SDKs expect","enum":[true,false]},"temperature":{"type":"number","description":"Sampling temperature; passes through to the model"},"tool_choice":{"type":"string","description":"Controls tool use; passes through to the model. OpenAI surface: none, auto, required, or an object naming a specific function","enum":["none","auto","required"]},"tools":{"type":"array","description":"Tools the model may call (OpenAI tool-calling surface); passes through to the model","items":{"type":"object","properties":{"type":{"type":"string","description":"Tool type (OpenAI surface: function)","required":true},"function":{"type":"object","description":"Function definition","required":true}}}},"top_p":{"type":"number","description":"Nucleus sampling parameter; passes through to the model"}}},"example":{"max_tokens":1024,"messages":[{"content":"Namaste, world","role":"user"}],"model":"deepseek-v4-flash","response_format":{"type":"json_object"},"stop":["\n\nUser:"],"stream":"","temperature":0.7,"tool_choice":"auto","tools":[{"type":"function","function":{"description":"Get current weather for a city","name":"get_weather","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}],"top_p":0.95}}}}}},"/v1/files":{"post":{"tags":["Files"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/files"},"summary":"Upload batch file","description":"Upload a JSONL of requests (one request body per line) as multipart form data with purpose=batch. The response carries file_id, bytes and lines","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","format":"binary","description":"JSONL file of requests for batch processing: one request body per line","required":true},"purpose":{"type":"string","description":"Upload purpose; batch files use purpose=batch","required":true,"enum":["batch"]}}},"example":{"file":"(binary)","purpose":"batch"}}}}}},"/v1/batches":{"post":{"tags":["Batch"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/batches"},"summary":"Create batch","description":"Creates a batch job that runs the same API surface asynchronously on a 24-hour completion window. Supported endpoints are /v1/chat/completions; completion_window must be 24h","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"completion_window":{"type":"string","description":"The completion window for the batch job; must be 24h","required":true,"enum":["24h"]},"endpoint":{"type":"string","description":"The endpoint to be used for the batch. Supported endpoints are /v1/chat/completions","required":true},"input_file_id":{"type":"string","description":"The file_id of an uploaded JSONL file (returned by POST /v1/files)","required":true}}},"example":{"completion_window":"24h","endpoint":"/v1/chat/completions","input_file_id":"file-abc123"}}}}}},"/v1/batches/{id}":{"get":{"tags":["Batch"],"parameters":[{"name":"id","in":"path","description":"The ID of the batch job","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/batches/{id}"},"summary":"Retrieve batch","description":"Poll a batch job for status and counts. Download results from the output file; failed rows are itemised with per-line errors","security":[{"bearerAuth":[]}]}},"/v1/batches/{id}/cancel":{"post":{"tags":["Batch"],"parameters":[{"name":"id","in":"path","description":"The ID of the batch job to cancel","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://indierouter.ai/docs/","api_endpoint":"https://api.indierouter.ai/v1/batches/{id}/cancel"},"summary":"Cancel batch","description":"Cancel a running batch job","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}