{"openapi":"3.1.0","info":{"title":"Inception API","version":"1.0.0","description":"Inception Labs LLM API \u2014 chat, FIM, and edit completions powered by Mercury diffusion language models. OpenAI-compatible request\/response shapes with extensions for diffusion-specific features.","contact":{"name":"Inception Labs","url":"https:\/\/docs.inceptionlabs.ai","email":"support@inceptionlabs.ai"},"license":{"name":"Proprietary"},"x-logo":{"url":"https:\/\/docs.inceptionlabs.ai\/logo.png"}},"paths":{"\/v1\/decisions":{"post":{"summary":"Create a decision","operationId":"createDecision","requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionRequest"},"example":{"model":"mercury-decide","state":{"message":"Please refund the duplicate charge on my account."},"questions":{"billing":{"type":"noul","instructions":"Is this request about billing?"},"team":{"type":"choice","criteria":{"billing":"Payments, charges, and refunds","support":"Technical support and other requests"}},"urgency":{"type":"score","instructions":"How urgent is this request?","criteria":["Can wait","Needs attention soon","Needs immediate attention"]}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionResponse"},"example":{"model":"mercury-decide","answers":{"billing":{"type":"noul","noul":0.97},"team":{"type":"choice","choice":"billing","probabilities":{"billing":0.96,"support":0.04},"confidence":0.96},"urgency":{"type":"score","score":1.1,"legend":{"0":"Can wait","1":"Needs attention soon","2":"Needs immediate attention"},"probabilities":{"0":0.1,"1":0.7,"2":0.2},"confidence":0.7}},"usage":{"input_tokens":120,"output_tokens":3}}}}},"422":{"description":"Unprocessable Entity \u2014 invalid decision request.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError422"},"examples":{"validation":{"summary":"Invalid request","value":{"detail":[{"loc":["body","questions"],"msg":"Field required","type":"missing"}]}},"upstream":{"summary":"Service validation error","value":{"error":{"code":"upstream_error","type":"invalid_request_error","message":"Decision service could not complete the request."}}}}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError401"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"402":{"description":"Payment Required \u2014 billing inactive or quota exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError402"},"example":{"error":{"code":"account_error","type":"invalid_request_error","message":"Account access is unavailable."}}}}},"404":{"description":"Not Found \u2014 model not available for this account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError404"},"example":{"error":{"code":"model_not_found","type":"invalid_request_error","message":"Decision model not found."}}}}},"429":{"description":"Too Many Requests \u2014 rate limit exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError429"},"example":{"error":{"code":"rate_limit_exceeded","type":"rate_limit_error","message":"Request or spending limit exceeded."}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError500"},"example":{"error":{"message":"Internal server error","type":"server_error","param":null,"code":"server_error"}}}}},"413":{"description":"Payload Too Large \u2014 decision request body exceeds the size limit.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError413"},"example":{"error":{"code":"request_too_large","type":"invalid_request_error","message":"Request body is too large."}}}}},"502":{"description":"Bad Gateway \u2014 invalid response from the decision service.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError502"},"example":{"error":{"code":"upstream_error","type":"server_error","message":"Decision service returned an invalid response."}}}}},"503":{"description":"Service Unavailable \u2014 decision service is unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError503"},"example":{"error":{"code":"upstream_error","type":"server_error","message":"Decision service could not complete the request."}}}}},"504":{"description":"Gateway Timeout \u2014 decision service timed out.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DecisionError504"},"example":{"error":{"code":"upstream_timeout","type":"server_error","message":"Decision service timed out."}}}}}},"security":[{"BearerAuth":[]}],"tags":["Decisions"],"description":"Evaluate named questions against a shared state with Mercury Decide. Supports binary probability (`noul`), categorical choice, and ordinal score questions. Returns answers and token usage. Streaming is not supported.\n\nImages: put chat-style parts such as `{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image\/png;base64,...\"}}` anywhere in `state` or a question's `instructions` (not in `criteria`). Images must be base64 PNG, JPEG, WebP, or GIF data URLs (remote URLs are not supported), at most 10 MiB each and 16 per upstream request. The complete JSON request, including base64 encoding, is also subject to the gateway's whole-request body limit (20 MiB by default).","x-codeSamples":[{"lang":"bash","label":"cURL","source":"curl https:\/\/api.inceptionlabs.ai\/v1\/decisions -H \"Authorization: Bearer $INCEPTION_API_KEY\" -H \"Content-Type: application\/json\" -d '{\n  \"model\": \"mercury-decide\",\n  \"state\": {\n    \"message\": \"Please refund the duplicate charge on my account.\"\n  },\n  \"questions\": {\n    \"billing\": {\n      \"type\": \"noul\",\n      \"instructions\": \"Is this request about billing?\"\n    },\n    \"team\": {\n      \"type\": \"choice\",\n      \"criteria\": {\n        \"billing\": \"Payments, charges, and refunds\",\n        \"support\": \"Technical support and other requests\"\n      }\n    },\n    \"urgency\": {\n      \"type\": \"score\",\n      \"instructions\": \"How urgent is this request?\",\n      \"criteria\": [\n        \"Can wait\",\n        \"Needs attention soon\",\n        \"Needs immediate attention\"\n      ]\n    }\n  }\n}'\n"},{"lang":"python","label":"Python","source":"import json\nimport os\nimport urllib.request\n\npayload = {\n    \"model\": \"mercury-decide\",\n    \"state\": {\n        \"message\": \"Please refund the duplicate charge on my account.\"\n    },\n    \"questions\": {\n        \"billing\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this request about billing?\"\n        },\n        \"team\": {\n            \"type\": \"choice\",\n            \"criteria\": {\n                \"billing\": \"Payments, charges, and refunds\",\n                \"support\": \"Technical support and other requests\"\n            }\n        },\n        \"urgency\": {\n            \"type\": \"score\",\n            \"instructions\": \"How urgent is this request?\",\n            \"criteria\": [\n                \"Can wait\",\n                \"Needs attention soon\",\n                \"Needs immediate attention\"\n            ]\n        }\n    }\n}\nrequest = urllib.request.Request('https:\/\/api.inceptionlabs.ai\/v1\/decisions',\n    data=json.dumps(payload).encode(),\n    headers={\"Authorization\": f\"Bearer {os.environ['INCEPTION_API_KEY']}\",\n             \"Content-Type\": \"application\/json\"}, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=60) as response:\n    print(json.load(response)[\"answers\"])\n"},{"lang":"typescript","label":"TypeScript","source":"const response = await fetch('https:\/\/api.inceptionlabs.ai\/v1\/decisions', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.INCEPTION_API_KEY}`,\n    'Content-Type': 'application\/json',\n  },\n  body: JSON.stringify({\n  \"model\": \"mercury-decide\",\n  \"state\": {\n    \"message\": \"Please refund the duplicate charge on my account.\"\n  },\n  \"questions\": {\n    \"billing\": {\n      \"type\": \"noul\",\n      \"instructions\": \"Is this request about billing?\"\n    },\n    \"team\": {\n      \"type\": \"choice\",\n      \"criteria\": {\n        \"billing\": \"Payments, charges, and refunds\",\n        \"support\": \"Technical support and other requests\"\n      }\n    },\n    \"urgency\": {\n      \"type\": \"score\",\n      \"instructions\": \"How urgent is this request?\",\n      \"criteria\": [\n        \"Can wait\",\n        \"Needs attention soon\",\n        \"Needs immediate attention\"\n      ]\n    }\n  }\n}),\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log((await response.json()).answers);\n"}]}},"\/v1\/chat\/completions":{"post":{"summary":"Create a chat completion","operationId":"createChatCompletion","requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ChatCompletionRequest"},"example":{"model":"mercury-2.5","messages":[{"role":"user","content":"What is a diffusion language model?"}],"max_tokens":256,"temperature":0.75}}},"required":true},"responses":{"200":{"description":"Successful response. Returns a JSON object when `stream=false`, or a server-sent events stream of `ChatCompletionChunk` objects (terminated by `data: [DONE]`) when `stream=true`.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ChatCompletionResponse"},"example":{"id":"chatcmpl-7a2b3c4d5e","object":"chat.completion","created":1745798400,"model":"mercury-2.5","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"A diffusion language model is a type of language model that uses diffusion to generate text."}}],"usage":{"prompt_tokens":12,"completion_tokens":8,"total_tokens":20,"reasoning_tokens":0,"cached_input_tokens":0}}},"text\/event-stream":{"schema":{"$ref":"#\/components\/schemas\/ChatCompletionChunk"},"x-stainless-stream-type":"sse","x-stainless-stream-event-schema":{"$ref":"#\/components\/schemas\/ChatCompletionChunk"},"x-stainless-stream-terminator":"[DONE]"}}},"400":{"description":"Bad Request \u2014 invalid parameters.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"You exceeded the maximum context length for this model of 128000. Please reduce the length of the messages or completion.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"402":{"description":"Payment Required \u2014 billing inactive or quota exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Account is inactive","type":"account_error","param":null,"code":"account_error"}}}}},"404":{"description":"Not Found \u2014 model not available for this account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"model `jupyter-2` not found","type":"invalid_request_error","param":"model","code":"model_not_found"}}}}},"429":{"description":"Too Many Requests \u2014 rate limit exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Rate limit exceeded. Please try again later.","type":"rate_limit_error","param":null,"code":"rate_limit_reached"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Chat"],"description":"Generate a chat completion from a sequence of messages. Returns a `ChatCompletion` object, or a server-sent events stream of `ChatCompletionChunk` deltas when `stream=true`. Supports tool calling, structured output via `response_format`, and reasoning controls.","x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nchat_completion = client.chat.completions.create(\n    model=\"mercury-2.5\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"What is a diffusion language model?\"\n        }\n    ],\n    max_tokens=256,\n    temperature=0.75,\n)\nprint(chat_completion)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n  model: 'mercury-2.5',\n  messages: [\n    {\n      role: 'user',\n      content: 'What is a diffusion language model?'\n    }\n  ],\n  max_tokens: 256,\n  temperature: 0.75\n});\nconsole.log(chatCompletion);"}]}},"\/v1\/fim\/completions":{"post":{"summary":"Create a fill-in-the-middle completion","description":"Generate a code completion given a `prompt` (prefix) and optional `suffix`. Designed for IDE-style inline completion. Returns a `FimCompletion` object, or a server-sent events stream of `FimCompletionChunk` deltas when `stream=true`. Tool calling and function calling are not supported.","operationId":"createFimCompletion","requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FIMCompletionRequest"},"example":{"model":"mercury-edit-2","prompt":"def fibonacci(n: int) -> int:\n    if n <= 1:\n        return n\n    return ","suffix":"\n\nprint(fibonacci(10))\n","max_tokens":256}}},"required":true},"responses":{"200":{"description":"Successful response. Returns a JSON object when `stream=false`, or a server-sent events stream of `TextCompletionChunk` objects (terminated by `data: [DONE]`) when `stream=true`.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FIMCompletionResponse"},"example":{"id":"cmpl-7a2b3c4d5e","object":"text_completion","created":1745798400,"model":"mercury-edit-2","choices":[{"index":0,"finish_reason":"stop","text":"fibonacci(n - 1) + fibonacci(n - 2)"}],"usage":{"prompt_tokens":24,"completion_tokens":14,"total_tokens":38,"reasoning_tokens":0,"cached_input_tokens":0}}},"text\/event-stream":{"schema":{"$ref":"#\/components\/schemas\/TextCompletionChunk"},"x-stainless-stream-type":"sse","x-stainless-stream-event-schema":{"$ref":"#\/components\/schemas\/TextCompletionChunk"},"x-stainless-stream-terminator":"[DONE]"}}},"400":{"description":"Bad Request \u2014 invalid parameters.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"You exceeded the maximum context length for this model of 128000. Please reduce the length of the messages or completion.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"402":{"description":"Payment Required \u2014 billing inactive or quota exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Account is inactive","type":"account_error","param":null,"code":"account_error"}}}}},"404":{"description":"Not Found \u2014 model not available for this account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"model `jupyter-2` not found","type":"invalid_request_error","param":"model","code":"model_not_found"}}}}},"429":{"description":"Too Many Requests \u2014 rate limit exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Rate limit exceeded. Please try again later.","type":"rate_limit_error","param":null,"code":"rate_limit_reached"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["FIM"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nfim_completion = client.fim.completions.create(\n    model=\"mercury-edit-2\",\n    prompt=\"def fibonacci(n: int) -> int:\\n    if n <= 1:\\n        return n\\n    return \",\n    suffix=\"\\n\\nprint(fibonacci(10))\\n\",\n    max_tokens=256,\n)\nprint(fim_completion)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst fimCompletion = await client.fim.completions.create({\n  model: 'mercury-edit-2',\n  prompt: 'def fibonacci(n: int) -> int:\\n    if n <= 1:\\n        return n\\n    return ',\n  suffix: '\\n\\nprint(fibonacci(10))\\n',\n  max_tokens: 256\n});\nconsole.log(fimCompletion);"}]}},"\/v1\/edit\/completions":{"post":{"summary":"Create a code edit completion","description":"Generate an edit to a code region given the surrounding context. The request must contain a single user message whose content includes the required edit prompt tags (e.g. `<|code_to_edit|>`, `<|cursor|>`, `<|current_file_content|>`). Returns an `EditCompletion` object. Streaming and tool calling are not supported on this endpoint.","operationId":"createEditCompletion","requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EditCompletionRequest"},"example":{"model":"mercury-edit-2","messages":[{"role":"user","content":"<|recently_viewed_code_snippets|>\n<|\/recently_viewed_code_snippets|>\n<|edit_diff_history|>\n<|\/edit_diff_history|>\n<|current_file_content|>\ndef greet(name):\n    print(\"hi\")\n<|\/current_file_content|>\n<|code_to_edit|>\ndef greet(name):\n    print(\"hi\")<|cursor|>\n<|\/code_to_edit|>"}]}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EditCompletionResponse"},"example":{"id":"cmpl-7a2b3c4d5e","object":"edit.completion","created":1745798400,"model":"mercury-edit-2","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"def greet(name):\n    print(f\"hi {name}\")\n"}}],"usage":{"prompt_tokens":156,"completion_tokens":18,"total_tokens":174,"reasoning_tokens":0,"cached_input_tokens":0}}}}},"400":{"description":"Bad Request \u2014 invalid parameters.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"You exceeded the maximum context length for this model of 128000. Please reduce the length of the messages or completion.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"402":{"description":"Payment Required \u2014 billing inactive or quota exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Account is inactive","type":"account_error","param":null,"code":"account_error"}}}}},"404":{"description":"Not Found \u2014 model not available for this account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"model `jupyter-2` not found","type":"invalid_request_error","param":"model","code":"model_not_found"}}}}},"429":{"description":"Too Many Requests \u2014 rate limit exceeded.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Rate limit exceeded. Please try again later.","type":"rate_limit_error","param":null,"code":"rate_limit_reached"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Edit"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nedit_completion = client.edit.completions.create(\n    model=\"mercury-edit-2\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"<|recently_viewed_code_snippets|>\\n<|\/recently_viewed_code_snippets|>\\n<|edit_diff_history|>\\n<|\/edit_diff_history|>\\n<|current_file_content|>\\ndef greet(name):\\n    print(\\\"hi\\\")\\n<|\/current_file_content|>\\n<|code_to_edit|>\\ndef greet(name):\\n    print(\\\"hi\\\")<|cursor|>\\n<|\/code_to_edit|>\"\n        }\n    ],\n)\nprint(edit_completion)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst editCompletion = await client.edit.completions.create({\n  model: 'mercury-edit-2',\n  messages: [\n    {\n      role: 'user',\n      content: '<|recently_viewed_code_snippets|>\\n<|\/recently_viewed_code_snippets|>\\n<|edit_diff_history|>\\n<|\/edit_diff_history|>\\n<|current_file_content|>\\ndef greet(name):\\n    print(\"hi\")\\n<|\/current_file_content|>\\n<|code_to_edit|>\\ndef greet(name):\\n    print(\"hi\")<|cursor|>\\n<|\/code_to_edit|>'\n    }\n  ]\n});\nconsole.log(editCompletion);"}]}},"\/v1\/models":{"get":{"summary":"List available models","description":"List the models currently available through the API.","operationId":"listModels","responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModelsResponse"},"example":{"data":[{"id":"mercury-2","name":"Inception: Mercury 2","created":1745798400,"description":"Mercury 2 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":128000,"max_output_length":50000,"pricing":{"prompt":"0.00000025","completion":"0.00000075","input_cache_reads":"0.000000025","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-2.5","name":"Inception: Mercury 2.5","created":1745798400,"description":"Mercury 2.5 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":260000,"max_output_length":65536,"pricing":{"prompt":"0.0000002","completion":"0.00000075","input_cache_reads":"0.00000002","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2.5"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-3","name":"Inception: Mercury 3","created":1745798400,"description":"Mercury 3 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":1000000,"max_output_length":131072,"pricing":{"prompt":"0","completion":"0","input_cache_reads":"0","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-3"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-decide","name":"Inception: Mercury Decide","created":1745798400,"description":"Typed-decision preview. Decisions endpoint only.","input_modalities":["text"],"output_modalities":["text"],"context_length":65536,"max_output_length":50000,"pricing":{"prompt":"0.00000002","completion":"0","input_cache_reads":"0","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":[],"supported_endpoints":["decisions"],"openrouter":{"slug":"inception\/mercury-decide"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Models"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nmodels = client.models.list()\nprint(models)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst models = await client.models.list();\nconsole.log(models);"}]}},"\/v1\/chat\/completions\/models":{"get":{"summary":"List chat models","description":"List models available for chat completions.","operationId":"listChatModels","responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModelsResponse"},"example":{"data":[{"id":"mercury-2","name":"Inception: Mercury 2","created":1745798400,"description":"Mercury 2 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":128000,"max_output_length":50000,"pricing":{"prompt":"0.00000025","completion":"0.00000075","input_cache_reads":"0.000000025","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-2.5","name":"Inception: Mercury 2.5","created":1745798400,"description":"Mercury 2.5 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":260000,"max_output_length":65536,"pricing":{"prompt":"0.0000002","completion":"0.00000075","input_cache_reads":"0.00000002","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2.5"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-3","name":"Inception: Mercury 3","created":1745798400,"description":"Mercury 3 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":1000000,"max_output_length":131072,"pricing":{"prompt":"0","completion":"0","input_cache_reads":"0","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-3"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Models"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nmodels = client.models.list_chat()\nprint(models)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst models = await client.models.listChat();\nconsole.log(models);"}]}},"\/v1\/fim\/completions\/models":{"get":{"summary":"List FIM models","description":"List models available for fill-in-the-middle completions.","operationId":"listFIMModels","responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModelsResponse"},"example":{"data":[{"id":"mercury-edit-2","name":"Inception: Mercury Edit 2","created":1745798400,"description":"Mercury Edit 2 for code edit completions and fill-in-the-middle code completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":128000,"max_output_length":32000,"pricing":{"prompt":"0.00000025","completion":"0.00000075","input_cache_reads":"0.000000025","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":[],"supported_endpoints":["edit.completions","fim.completions"],"openrouter":{"slug":"inception\/mercury-edit-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Models"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nmodels = client.models.list_fim()\nprint(models)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst models = await client.models.listFim();\nconsole.log(models);"}]}},"\/v1\/edit\/completions\/models":{"get":{"summary":"List Edit models","description":"List models available for edit completions.","operationId":"listEditModels","responses":{"200":{"description":"Successful Response","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ModelsResponse"},"example":{"data":[{"id":"mercury-edit-2","name":"Inception: Mercury Edit 2","created":1745798400,"description":"Mercury Edit 2 for code edit completions and fill-in-the-middle code completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":128000,"max_output_length":32000,"pricing":{"prompt":"0.00000025","completion":"0.00000075","input_cache_reads":"0.000000025","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":[],"supported_endpoints":["edit.completions","fim.completions"],"openrouter":{"slug":"inception\/mercury-edit-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized \u2014 missing or invalid API key.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}}}},"500":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":"server_error"}}}}}},"security":[{"BearerAuth":[]}],"tags":["Models"],"x-codeSamples":[{"lang":"python","label":"Python","source":"import os\nfrom inceptionai import Inception\n\nclient = Inception(\n    api_key=os.environ.get(\"INCEPTION_API_KEY\"),  # defaults to this env var; can be omitted\n)\n\nmodels = client.models.list_edit()\nprint(models)"},{"lang":"typescript","label":"TypeScript","source":"import Inception from 'inceptionai';\n\nconst client = new Inception({\n  apiKey: process.env['INCEPTION_API_KEY'], \/\/ defaults to this env var; can be omitted\n});\n\nconst models = await client.models.listEdit();\nconsole.log(models);"}]}}},"components":{"schemas":{"ChatCompletionRequest":{"properties":{"messages":{"items":{"$ref":"#\/components\/schemas\/Message"},"type":"array","title":"Messages"},"model":{"type":"string","title":"Model","description":"The model to use for the chat completion."},"max_tokens":{"type":"integer","title":"Max Tokens","description":"Maximum number of tokens to generate. Deprecated in favour of `max_completion_tokens`, which takes precedence when both are supplied. The maximum depends on `model`: 50,000 for `mercury-2`; 65,536 for `mercury-2.5`; 131,072 for `mercury-3`. When neither token-budget field is supplied: For `mercury-2`, the default is 16,384. For `mercury-2.5`, the default is 16,384; 65,536 when `reasoning_effort=\"high\"`. For `mercury-3`, the default is 24,576; 8,192 when `reasoning_effort=\"instant\"`; 65,536 when `reasoning_effort=\"medium\"`; 131,072 when `reasoning_effort=\"high\"`.","deprecated":true,"minimum":1,"maximum":131072},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens","description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. Supersedes `max_tokens`. When neither field is supplied, the model's configured default applies (16384 for `mercury-2`). The maximum depends on `model`: 50,000 for `mercury-2`; 65,536 for `mercury-2.5`; 131,072 for `mercury-3`. When neither token-budget field is supplied: For `mercury-2`, the default is 16,384. For `mercury-2.5`, the default is 16,384; 65,536 when `reasoning_effort=\"high\"`. For `mercury-3`, the default is 24,576; 8,192 when `reasoning_effort=\"instant\"`; 65,536 when `reasoning_effort=\"medium\"`; 131,072 when `reasoning_effort=\"high\"`.","minimum":1,"maximum":131072},"temperature":{"type":"number","title":"Temperature","description":"What sampling temperature to use, between 0.5 and 1. Higher values make the output more random; lower values make it more focused and deterministic. For `mercury-2`, the default is 0.75; out-of-range values are reset to 0.75 with a `warning` in the response. For `mercury-2.5`, the default is 1; out-of-range values are reset to 1 with a `warning` in the response. For `mercury-3`, the default is 1; out-of-range values are reset to 1 with a `warning` in the response.","minimum":0.5,"maximum":1},"stop":{"items":{"type":"string"},"type":"array","title":"Stop","description":"A list of sequences where the API will stop generating further tokens. The returned text will not contain the stop sequences."},"tools":{"type":"array","title":"Tools","description":"A list of tools the model may call. Use this to provide functions the model can generate JSON arguments for.","items":{"$ref":"#\/components\/schemas\/ChatCompletionTool"}},"tool_choice":{"anyOf":[{"type":"string","enum":["auto","required","none"]},{"$ref":"#\/components\/schemas\/NamedToolChoice"}],"title":"Tool Choice","description":"Controls tool selection: 'auto' (model decides, default when tools present), 'required' (model must call one), 'none' (model must not call one), or {\"type\": \"function\", \"function\": {\"name\": \"...\"}} to force one declared tool."},"stream":{"type":"boolean","title":"Stream","description":"Whether to stream the response.","default":false},"stream_options":{"$ref":"#\/components\/schemas\/StreamOptions","description":"Options that control streaming behavior."},"diffusing":{"type":"boolean","title":"Diffusing","description":"Whether to show the diffusion effect in the streamed response.","default":false},"extra_body":{"additionalProperties":true,"type":"object","title":"Extra Body","description":"Extra parameters passed to the model (OpenAI-compat passthrough).","x-stainless-param":"extra_params"},"realtime":{"type":"boolean","title":"Realtime","description":"Enable flag for more realtime workloads that require lower TTFT\/TTFAT.","default":false},"response_format":{"title":"Response Format","description":"An object specifying the format that the model must output.","oneOf":[{"$ref":"#\/components\/schemas\/ResponseFormatText"},{"$ref":"#\/components\/schemas\/ResponseFormatJSONObject"},{"$ref":"#\/components\/schemas\/ResponseFormatJSONSchema"}]},"reasoning_summary":{"type":"boolean","title":"Reasoning Summary","description":"Request a summary of the model's reasoning process.","default":false},"reasoning_summary_wait":{"type":"boolean","title":"Reasoning Summary Wait","description":"Wait for all reasoning summaries to complete before finishing the response.","default":false},"reasoning_effort":{"type":"string","title":"Reasoning Effort","description":"Constrains the effort spent on reasoning before the model responds.","enum":["instant","low","medium","high"],"default":"medium"}},"type":"object","required":["messages","model"],"title":"ChatCompletionRequest"},"ChatCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"chat.completion","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":{"$ref":"#\/components\/schemas\/Usage"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"},"reasoning_summary":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningSummary"},{"type":"null"}],"description":"Summary of reasoning process if requested and available."}},"type":"object","required":["id","created","model","choices","usage","object"],"title":"ChatCompletionResponse","example":{"id":"chatcmpl-7a2b3c4d5e","object":"chat.completion","created":1745798400,"model":"mercury-2.5","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"A diffusion language model is a type of language model that uses diffusion to generate text."}}],"usage":{"prompt_tokens":12,"completion_tokens":8,"total_tokens":20,"reasoning_tokens":0,"cached_input_tokens":0}}},"Choice":{"properties":{"index":{"type":"integer","title":"Index"},"message":{"$ref":"#\/components\/schemas\/Message"},"finish_reason":{"type":["string","null"],"enum":["stop","length","tool_calls","content_filter",null],"description":"The reason the model stopped generating tokens."}},"type":"object","required":["index","message","finish_reason"],"title":"Choice"},"ChoiceAnswer":{"properties":{"type":{"type":"string","const":"choice","title":"Type"},"choice":{"type":"string","title":"Choice"},"probabilities":{"additionalProperties":{"type":"number","maximum":1,"minimum":0},"type":"object","title":"Probabilities"},"confidence":{"type":"number","maximum":1,"minimum":0,"title":"Confidence"}},"additionalProperties":false,"type":"object","required":["type","choice","probabilities","confidence"],"title":"ChoiceAnswer"},"ChoiceQuestion":{"properties":{"type":{"type":"string","const":"choice","title":"Type"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}],"title":"Instructions"},"criteria":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}]},"type":"object","maxProperties":255,"minProperties":1,"title":"Criteria","description":"Required mapping of 1 to 255 option labels to descriptions. Descriptions may be null, but criteria must not be omitted, null, or empty. Options are never inferred from instructions."}},"type":"object","required":["type","criteria"],"title":"ChoiceQuestion"},"CompletionTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","title":"Reasoning Tokens","description":"Tokens generated by the model for reasoning.","default":0}},"type":"object","title":"CompletionTokensDetails","description":"Breakdown of the tokens generated for the completion.","required":[]},"DataCenter":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO 3166 Alpha-2 country code."}},"type":"object","required":["country_code"],"title":"DataCenter","description":"Datacenter location information."},"DecisionRequest":{"properties":{"model":{"type":"string","minLength":1,"title":"Model","example":"mercury-decide"},"state":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"}],"title":"State","example":{"message":"Please refund the duplicate charge on my account."}},"questions":{"additionalProperties":{"oneOf":[{"$ref":"#\/components\/schemas\/NoulQuestion"},{"$ref":"#\/components\/schemas\/ChoiceQuestion"},{"$ref":"#\/components\/schemas\/ScoreQuestion"}],"discriminator":{"propertyName":"type","mapping":{"choice":"#\/components\/schemas\/ChoiceQuestion","noul":"#\/components\/schemas\/NoulQuestion","score":"#\/components\/schemas\/ScoreQuestion"}}},"type":"object","minProperties":1,"title":"Questions","example":{"billing":{"type":"noul","instructions":"Is this request about billing?"},"team":{"type":"choice","criteria":{"billing":"Payments, charges, and refunds","support":"Technical support and other requests"}},"urgency":{"type":"score","instructions":"How urgent is this request?","criteria":["Can wait","Needs attention soon","Needs immediate attention"]}}}},"type":"object","required":["model","state","questions"],"title":"DecisionRequest","example":{"model":"mercury-decide","state":{"message":"Please refund the duplicate charge on my account."},"questions":{"billing":{"type":"noul","instructions":"Is this request about billing?"},"team":{"type":"choice","criteria":{"billing":"Payments, charges, and refunds","support":"Technical support and other requests"}},"urgency":{"type":"score","instructions":"How urgent is this request?","criteria":["Can wait","Needs attention soon","Needs immediate attention"]}}}},"DecisionResponse":{"properties":{"model":{"type":"string","minLength":1,"title":"Model"},"answers":{"additionalProperties":{"oneOf":[{"$ref":"#\/components\/schemas\/NoulAnswer"},{"$ref":"#\/components\/schemas\/ChoiceAnswer"},{"$ref":"#\/components\/schemas\/ScoreAnswer"}],"discriminator":{"propertyName":"type","mapping":{"choice":"#\/components\/schemas\/ChoiceAnswer","noul":"#\/components\/schemas\/NoulAnswer","score":"#\/components\/schemas\/ScoreAnswer"}}},"type":"object","minProperties":1,"title":"Answers"},"usage":{"$ref":"#\/components\/schemas\/DecisionUsage"}},"additionalProperties":false,"type":"object","required":["model","answers","usage"],"title":"DecisionResponse","example":{"model":"mercury-decide","answers":{"billing":{"type":"noul","noul":0.97},"team":{"type":"choice","choice":"billing","probabilities":{"billing":0.96,"support":0.04},"confidence":0.96},"urgency":{"type":"score","score":1.1,"legend":{"0":"Can wait","1":"Needs attention soon","2":"Needs immediate attention"},"probabilities":{"0":0.1,"1":0.7,"2":0.2},"confidence":0.7}},"usage":{"input_tokens":120,"output_tokens":3}}},"DecisionUsage":{"properties":{"input_tokens":{"type":"integer","minimum":0,"title":"Input Tokens"},"output_tokens":{"type":"integer","minimum":0,"title":"Output Tokens"}},"additionalProperties":false,"type":"object","required":["input_tokens","output_tokens"],"title":"DecisionUsage"},"EditChoice":{"properties":{"index":{"type":"integer","title":"Index"},"message":{"$ref":"#\/components\/schemas\/EditMessage"},"finish_reason":{"type":["string","null"],"enum":["stop","length","content_filter",null],"description":"The reason the model stopped generating tokens."}},"type":"object","required":["index","message","finish_reason"],"title":"EditChoice","description":"Choice for edit completions."},"EditCompletionRequest":{"properties":{"messages":{"items":{"$ref":"#\/components\/schemas\/EditMessageParam"},"type":"array","title":"Messages"},"model":{"type":"string","title":"Model","description":"The model to use for the edit completion."},"max_tokens":{"type":"integer","title":"Max Tokens","description":"Maximum number of tokens to generate.","default":1024,"minimum":1,"maximum":8192},"temperature":{"type":"number","title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values make the output more random; lower values make it more focused and deterministic.","default":0.2,"minimum":0,"maximum":2},"top_p":{"type":"number","title":"Top P","description":"Float that controls the cumulative probability of the top tokens to consider.","default":1,"minimum":0,"maximum":1},"presence_penalty":{"type":"number","title":"Presence Penalty","description":"Number between -2 and 2. Positive values penalize tokens based on whether they have appeared in the text so far, increasing the model's likelihood to talk about new topics.","default":1,"minimum":-2,"maximum":2}},"type":"object","required":["messages","model"],"title":"EditCompletionRequest"},"EditCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"edit.completion","title":"Object","default":"edit.completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#\/components\/schemas\/EditChoice"},"type":"array","title":"Choices"},"usage":{"$ref":"#\/components\/schemas\/EditUsage"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"}},"type":"object","required":["id","created","model","choices","usage","object"],"title":"EditCompletionResponse","example":{"id":"cmpl-7a2b3c4d5e","object":"edit.completion","created":1745798400,"model":"mercury-edit-2","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"def greet(name):\n    print(f\"hi {name}\")\n"}}],"usage":{"prompt_tokens":156,"completion_tokens":18,"total_tokens":174,"reasoning_tokens":0,"cached_input_tokens":0}}},"EditMessage":{"properties":{"role":{"type":"string","const":"assistant","title":"Role","description":"Edit responses are always from the assistant.","default":"assistant"},"content":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content","description":"The model's edit output."}},"type":"object","title":"EditMessage","description":"Edit response message. The model always responds as the assistant.","required":["role"]},"EditMessageParam":{"properties":{"role":{"type":"string","const":"user","title":"Role","description":"Edit requests only accept user messages.","default":"user"},"content":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"}],"title":"Content","description":"The content of the edit request. Must contain the required edit prompt tags."}},"type":"object","required":["content","role"],"title":"EditMessageParam","description":"Edit request message. Edit endpoints only accept a single user message."},"EditUsage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt."},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the generated completion, including reasoning tokens."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total tokens used in the request (prompt + completion)."},"prompt_tokens_details":{"$ref":"#\/components\/schemas\/PromptTokensDetails"},"completion_tokens_details":{"$ref":"#\/components\/schemas\/CompletionTokensDetails"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"title":"EditUsage","description":"Usage for edit completions."},"FIMCompletionRequest":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"The prompt to complete."},"suffix":{"type":"string","title":"Suffix","description":"The suffix to complete."},"model":{"type":"string","title":"Model","description":"The model to use for the FIM completion."},"max_tokens":{"type":"integer","title":"Max Tokens","description":"Maximum number of tokens to generate.","default":512,"minimum":1,"maximum":8192},"top_p":{"type":"number","title":"Top P","description":"Float that controls the cumulative probability of the top tokens to consider.","default":1,"minimum":0,"maximum":1},"top_k":{"type":"integer","title":"Top K","description":"Limits sampling to the `k` most likely tokens. Must be `-1` (disables the cutoff and considers all tokens) or an integer from 1 to 1000; other values such as 0 are rejected.","default":-1,"minimum":-1,"maximum":1000},"frequency_penalty":{"type":"number","title":"Frequency Penalty","description":"Number between -2 and 2. Positive values penalize tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.","default":0,"minimum":-2,"maximum":2},"presence_penalty":{"type":"number","title":"Presence Penalty","description":"Number between -2 and 2. Positive values penalize tokens based on whether they have appeared in the text so far, increasing the model's likelihood to talk about new topics.","default":1.5,"minimum":-2,"maximum":2},"repetition_penalty":{"type":"number","title":"Repetition Penalty","description":"Penalizes tokens that have already appeared in the generated text. Must be greater than 0. Values greater than 1.0 discourage repetition; 1.0 applies no penalty.","default":1,"minimum":0},"stop":{"items":{"type":"string"},"type":"array","title":"Stop","description":"A list of sequences where the API will stop generating further tokens. The returned text will not contain the stop sequences. Defaults to common code-block boundaries.","default":["\n\n","\n \n"]},"stream":{"type":"boolean","title":"Stream","description":"Whether to stream the response.","default":false},"stream_options":{"$ref":"#\/components\/schemas\/StreamOptions","description":"Options that control streaming behavior."}},"type":"object","required":["prompt","model"],"title":"FIMCompletionRequest"},"FIMCompletionResponse":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"text_completion","title":"Object","default":"text_completion"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"choices":{"items":{"$ref":"#\/components\/schemas\/TextCompletionChoice"},"type":"array","title":"Choices"},"usage":{"$ref":"#\/components\/schemas\/FIMUsage"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"}},"type":"object","required":["id","created","model","choices","usage","object"],"title":"FIMCompletionResponse","example":{"id":"cmpl-7a2b3c4d5e","object":"text_completion","created":1745798400,"model":"mercury-edit-2","choices":[{"index":0,"finish_reason":"stop","text":"fibonacci(n - 1) + fibonacci(n - 2)"}],"usage":{"prompt_tokens":24,"completion_tokens":14,"total_tokens":38,"reasoning_tokens":0,"cached_input_tokens":0}}},"FIMUsage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt."},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the generated completion, including reasoning tokens."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total tokens used in the request (prompt + completion)."},"prompt_tokens_details":{"$ref":"#\/components\/schemas\/PromptTokensDetails"},"completion_tokens_details":{"$ref":"#\/components\/schemas\/CompletionTokensDetails"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"title":"FIMUsage","description":"Usage for FIM completions."},"FunctionCall":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["arguments"],"title":"FunctionCall"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#\/components\/schemas\/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError","required":[]},"JsonValue":{"required":[]},"ModelObject":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the model."},"name":{"type":"string","title":"Name","description":"Display name for the model."},"created":{"type":"integer","title":"Created","description":"Unix timestamp when model was created."},"input_modalities":{"items":{"type":"string"},"type":"array","title":"Input Modalities","description":"Supported input modalities."},"output_modalities":{"items":{"type":"string"},"type":"array","title":"Output Modalities","description":"Supported output modalities."},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length in tokens."},"max_output_length":{"type":"integer","title":"Max Output Length","description":"Maximum output length in tokens."},"pricing":{"$ref":"#\/components\/schemas\/PricingInfo","description":"Pricing information."},"supported_sampling_parameters":{"items":{"type":"string"},"type":"array","title":"Supported Sampling Parameters","description":"Supported sampling parameters."},"supported_features":{"items":{"type":"string"},"type":"array","title":"Supported Features","description":"Supported model features."},"supported_endpoints":{"items":{"type":"string"},"type":"array","title":"Supported Endpoints","description":"API endpoints this model can be called on, e.g. `chat.completions` or `decisions`."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Model description."},"openrouter":{"anyOf":[{"$ref":"#\/components\/schemas\/OpenRouterInfo"},{"type":"null"}],"description":"OpenRouter-specific metadata."},"datacenters":{"anyOf":[{"items":{"$ref":"#\/components\/schemas\/DataCenter"},"type":"array"},{"type":"null"}],"title":"Datacenters","description":"Available datacenters."}},"type":"object","required":["id","name","created","input_modalities","output_modalities","context_length","max_output_length","pricing","supported_sampling_parameters","supported_features","supported_endpoints"],"title":"ModelObject","description":"Model information object."},"ModelsResponse":{"properties":{"data":{"items":{"$ref":"#\/components\/schemas\/ModelObject"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsResponse","description":"Response model for models endpoint.","example":{"data":[{"id":"mercury-2","name":"Inception: Mercury 2","created":1745798400,"description":"Mercury 2 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":128000,"max_output_length":50000,"pricing":{"prompt":"0.00000025","completion":"0.00000075","input_cache_reads":"0.000000025","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-2.5","name":"Inception: Mercury 2.5","created":1745798400,"description":"Mercury 2.5 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":260000,"max_output_length":65536,"pricing":{"prompt":"0.0000002","completion":"0.00000075","input_cache_reads":"0.00000002","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-2.5"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-3","name":"Inception: Mercury 3","created":1745798400,"description":"Mercury 3 diffusion language model for chat completions.","input_modalities":["text"],"output_modalities":["text"],"context_length":1000000,"max_output_length":131072,"pricing":{"prompt":"0","completion":"0","input_cache_reads":"0","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":["tools","json_mode","structured_outputs"],"supported_endpoints":["chat.completions"],"openrouter":{"slug":"inception\/mercury-3"},"datacenters":[{"country_code":"US"}]},{"id":"mercury-decide","name":"Inception: Mercury Decide","created":1745798400,"description":"Typed-decision preview. Decisions endpoint only.","input_modalities":["text"],"output_modalities":["text"],"context_length":65536,"max_output_length":50000,"pricing":{"prompt":"0.00000002","completion":"0","input_cache_reads":"0","input_cache_writes":"0"},"supported_sampling_parameters":["temperature","stop"],"supported_features":[],"supported_endpoints":["decisions"],"openrouter":{"slug":"inception\/mercury-decide"},"datacenters":[{"country_code":"US"}]}]}},"NamedToolChoice":{"properties":{"type":{"type":"string","const":"function","title":"Type","description":"Always `function`."},"function":{"$ref":"#\/components\/schemas\/ToolChoiceFunction"}},"type":"object","required":["type","function"],"title":"NamedToolChoice","description":"Forces one declared tool: {\"type\": \"function\", \"function\": {\"name\": \"...\"}}."},"NoulAnswer":{"properties":{"type":{"type":"string","const":"noul","title":"Type"},"noul":{"type":"number","maximum":1,"minimum":0,"title":"Noul"}},"additionalProperties":false,"type":"object","required":["type","noul"],"title":"NoulAnswer"},"NoulCriteria":{"properties":{"true":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}],"title":"True"},"false":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}],"title":"False"}},"type":"object","title":"NoulCriteria","required":[]},"NoulQuestion":{"properties":{"type":{"type":"string","const":"noul","title":"Type"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}],"title":"Instructions"},"criteria":{"anyOf":[{"$ref":"#\/components\/schemas\/NoulCriteria"},{"type":"null"}]}},"type":"object","required":["type"],"title":"NoulQuestion"},"OpenRouterInfo":{"properties":{"slug":{"type":"string","title":"Slug","description":"OpenRouter slug for the model."}},"type":"object","required":["slug"],"title":"OpenRouterInfo","description":"Optional OpenRouter-specific information."},"PricingInfo":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"Pricing per 1 token for input."},"completion":{"type":"string","title":"Completion","description":"Pricing per 1 token for output."},"input_cache_reads":{"type":"string","title":"Input Cache Reads","description":"Pricing per 1 token for cache reads.","default":"0"},"input_cache_writes":{"type":"string","title":"Input Cache Writes","description":"Pricing per 1 token for cache writes.","default":"0"}},"type":"object","required":["prompt","completion"],"title":"PricingInfo","description":"Pricing information for a model."},"PromptTokensDetails":{"properties":{"cached_tokens":{"type":"integer","title":"Cached Tokens","description":"Prompt tokens served from the prefix cache.","default":0}},"type":"object","title":"PromptTokensDetails","description":"Breakdown of the tokens in the prompt.","required":[]},"ReasoningSummary":{"description":"Summary of the model's reasoning process.","properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The summarized reasoning.","title":"Content"},"status":{"default":"unavailable","description":"Status of the summary.","enum":["complete","unavailable","skipped"],"title":"Status","type":"string"}},"title":"ReasoningSummary","type":"object","required":[]},"ScoreAnswer":{"properties":{"type":{"type":"string","const":"score","title":"Type"},"score":{"type":"number","minimum":0,"title":"Score"},"legend":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"}]},"type":"object","title":"Legend"},"probabilities":{"additionalProperties":{"type":"number","maximum":1,"minimum":0},"type":"object","title":"Probabilities"},"confidence":{"type":"number","maximum":1,"minimum":0,"title":"Confidence"}},"additionalProperties":false,"type":"object","required":["type","score","legend","probabilities","confidence"],"title":"ScoreAnswer"},"ScoreQuestion":{"properties":{"type":{"type":"string","const":"score","title":"Type"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"},{"type":"null"}],"title":"Instructions"},"criteria":{"items":{"anyOf":[{"type":"string"},{"additionalProperties":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"object"},{"items":{"$ref":"#\/components\/schemas\/JsonValue"},"type":"array"}]},"type":"array","maxItems":10,"minItems":1,"title":"Criteria"}},"type":"object","required":["type","criteria"],"title":"ScoreQuestion"},"StreamOptions":{"properties":{"include_usage":{"type":"boolean","title":"Include Usage","description":"If true, an additional chunk is streamed before the `data: [DONE]` message containing the token usage statistics for the entire request. Inside that chunk, `choices` is an empty array and the `usage` field is populated.","default":false}},"type":"object","title":"StreamOptions","description":"Options for controlling streaming behavior. Only used when `stream=true`.","required":[]},"TextCompletionChoice":{"properties":{"index":{"type":"integer","title":"Index"},"text":{"type":"string","title":"Text"},"finish_reason":{"type":["string","null"],"enum":["stop","length","content_filter",null],"description":"The reason the model stopped generating tokens."}},"type":"object","required":["index","text","finish_reason"],"title":"TextCompletionChoice","description":"Choice for FIM completions."},"ToolCall":{"properties":{"index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Index","default":0},"id":{"type":"string","title":"Id"},"type":{"type":"string","const":"function","title":"Type","default":"function"},"function":{"$ref":"#\/components\/schemas\/FunctionCall"}},"type":"object","required":["id","function","type"],"title":"ToolCall"},"ToolChoiceFunction":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the tool the model must call. Must match a tool in `tools`."}},"type":"object","required":["name"],"title":"ToolChoiceFunction","description":"The `function` object of a named tool_choice."},"Usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt."},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the generated completion, including reasoning tokens."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total tokens used in the request (prompt + completion)."},"prompt_tokens_details":{"$ref":"#\/components\/schemas\/PromptTokensDetails"},"completion_tokens_details":{"$ref":"#\/components\/schemas\/CompletionTokensDetails"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"title":"Usage"},"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"},"ChatCompletionChunk":{"description":"Model for a single chunk in a streaming chat completion response.","properties":{"id":{"title":"Id","type":"string"},"object":{"const":"chat.completion.chunk","default":"chat.completion.chunk","title":"Object","type":"string"},"created":{"title":"Created","type":"integer"},"model":{"title":"Model","type":"string"},"choices":{"items":{"$ref":"#\/components\/schemas\/ChunkChoice"},"title":"Choices","type":"array"},"reasoning_summary":{"anyOf":[{"$ref":"#\/components\/schemas\/ReasoningSummary"},{"type":"null"}],"default":null,"description":"Summary of reasoning process (included in final chunk if available)."}},"required":["id","created","model","choices","object"],"title":"ChatCompletionChunk","type":"object"},"ChunkChoice":{"description":"Represents a choice in a streaming response chunk.","properties":{"index":{"title":"Index","type":"integer"},"delta":{"$ref":"#\/components\/schemas\/ChunkDelta"},"finish_reason":{"type":["string","null"],"enum":["stop","length","tool_calls","content_filter",null],"description":"The reason the model stopped generating tokens."}},"required":["index","delta"],"title":"ChunkChoice","type":"object"},"ChunkDelta":{"description":"Represents a partial message in a streaming response chunk.","properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The partial content of the message.","title":"Content"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The role of the message sender, typically only in the first chunk.","title":"Role"},"tool_calls":{"anyOf":[{"items":{"$ref":"#\/components\/schemas\/ToolCallDelta"},"type":"array"},{"type":"null"}],"default":null,"description":"The tool calls generated by the model in this chunk.","title":"Tool Calls"}},"title":"ChunkDelta","type":"object","required":[]},"FunctionCallDelta":{"description":"Streaming counterpart to FunctionCall; arguments arrives chunk-by-chunk and may be null.","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Name"},"arguments":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Arguments"}},"title":"FunctionCallDelta","type":"object","required":[]},"TextChunkChoice":{"description":"Represents a choice in a streaming text completion response chunk.","properties":{"index":{"title":"Index","type":"integer"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The text in this chunk.","title":"Text"},"finish_reason":{"type":["string","null"],"enum":["stop","length","content_filter",null],"description":"The reason the model stopped generating tokens."}},"required":["index"],"title":"TextChunkChoice","type":"object"},"TextCompletionChunk":{"description":"Model for a single chunk in a streaming text completion response.","properties":{"id":{"title":"Id","type":"string"},"object":{"const":"text_completion","default":"text_completion","title":"Object","type":"string"},"created":{"title":"Created","type":"integer"},"model":{"title":"Model","type":"string"},"choices":{"items":{"$ref":"#\/components\/schemas\/TextChunkChoice"},"title":"Choices","type":"array"}},"required":["id","created","model","choices","object"],"title":"TextCompletionChunk","type":"object"},"ToolCallDelta":{"description":"Streaming counterpart to ToolCall; per OpenAI SSE spec, id\/type only appear in the first chunk per index.","properties":{"index":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":0,"title":"Index"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Id"},"type":{"anyOf":[{"const":"function","type":"string"},{"type":"null"}],"default":null,"title":"Type"},"function":{"anyOf":[{"$ref":"#\/components\/schemas\/FunctionCallDelta"},{"type":"null"}],"default":null}},"title":"ToolCallDelta","type":"object","required":[]},"Message":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool","function"],"title":"Role","description":"The role of the message sender (system, user, assistant, tool, function)."},"content":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content","description":"A string or array of content parts. Models with image support accept user-message parts of the form {\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image\/png;base64,...\", \"detail\": \"auto\"}} alongside text parts. Images must be base64 PNG, JPEG, WebP, or GIF data URLs, at most 10 MiB each and 15 MiB total per request. Detail is optional (auto, low, high). Remote URLs are not supported."},"tool_calls":{"anyOf":[{"items":{"$ref":"#\/components\/schemas\/ToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"The tool calls generated by the model."},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id","description":"The ID of the tool call this message is responding to (for role='tool')."}},"type":"object","required":["role"],"title":"Message"},"FunctionDefinition":{"type":"object","title":"FunctionDefinition","required":["name"],"properties":{"name":{"type":"string","description":"The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"description":{"type":"string","description":"A description of what the function does, used by the model to choose when and how to call the function."},"parameters":{"type":"object","additionalProperties":true,"description":"The parameters the function accepts, described as a JSON Schema object."},"strict":{"type":"boolean","default":false,"description":"Whether to enforce strict schema adherence when generating the function call. When true, the model output is constrained to match the `parameters` schema exactly."}}},"ChatCompletionTool":{"type":"object","title":"ChatCompletionTool","required":["type","function"],"properties":{"type":{"type":"string","const":"function","description":"The type of the tool."},"function":{"$ref":"#\/components\/schemas\/FunctionDefinition"}}},"ResponseFormatText":{"type":"object","title":"ResponseFormatText","required":["type"],"properties":{"type":{"type":"string","const":"text","description":"The type of response format being defined. Always `text`. The model responds with plain text and output is not constrained to JSON."}}},"ResponseFormatJSONObject":{"type":"object","title":"ResponseFormatJSONObject","required":["type"],"properties":{"type":{"type":"string","const":"json_object","description":"The type of response format being defined. Always `json_object`."}}},"JSONSchema":{"type":"object","title":"JSONSchema","required":["name"],"properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."},"description":{"type":"string","description":"A description of what the response format is for, used by the model to determine how to respond in the format."},"schema":{"type":"object","additionalProperties":true,"description":"The schema for the response format, described as a JSON Schema object."},"strict":{"type":"boolean","default":false,"description":"Whether to enforce strict schema adherence when generating the output. When true, the model output is constrained to match the supplied `schema` exactly."}}},"ResponseFormatJSONSchema":{"type":"object","title":"ResponseFormatJSONSchema","required":["type","json_schema"],"properties":{"type":{"type":"string","const":"json_schema","description":"The type of response format being defined. Always `json_schema`."},"json_schema":{"$ref":"#\/components\/schemas\/JSONSchema"}}},"ErrorObject":{"type":"object","title":"ErrorObject","required":["message","type"],"properties":{"message":{"type":"string","description":"Human-readable error message."},"type":{"type":"string","description":"Error category, e.g. `invalid_request_error`, `rate_limit_error`."},"param":{"type":["string","null"],"description":"Offending parameter, if applicable."},"code":{"type":["string","null"],"description":"Machine-readable error code."}}},"ErrorResponse":{"type":"object","title":"ErrorResponse","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"message":"You exceeded the maximum context length for this model of 128000. Please reduce the length of the messages or completion.","type":"invalid_request_error","param":"messages","code":"context_length_exceeded"}}},"DecisionError401":{"type":"object","title":"DecisionError401","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"message":"Incorrect API key provided","type":"authentication_error","param":null,"code":"invalid_api_key"}}},"DecisionError500":{"type":"object","title":"DecisionError500","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"message":"Internal server error","type":"server_error","param":null,"code":"server_error"}}},"DecisionError402":{"type":"object","title":"DecisionError402","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"account_error","type":"invalid_request_error","message":"Account access is unavailable."}}},"DecisionError404":{"type":"object","title":"DecisionError404","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"model_not_found","type":"invalid_request_error","message":"Decision model not found."}}},"DecisionError413":{"type":"object","title":"DecisionError413","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"request_too_large","type":"invalid_request_error","message":"Request body is too large."}}},"DecisionError429":{"type":"object","title":"DecisionError429","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"rate_limit_exceeded","type":"rate_limit_error","message":"Request or spending limit exceeded."}}},"DecisionError502":{"type":"object","title":"DecisionError502","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"upstream_error","type":"server_error","message":"Decision service returned an invalid response."}}},"DecisionError503":{"type":"object","title":"DecisionError503","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"upstream_error","type":"server_error","message":"Decision service could not complete the request."}}},"DecisionError504":{"type":"object","title":"DecisionError504","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"upstream_timeout","type":"server_error","message":"Decision service timed out."}}},"DecisionError422":{"title":"DecisionError422","anyOf":[{"$ref":"#\/components\/schemas\/HTTPValidationError"},{"$ref":"#\/components\/schemas\/DecisionUpstreamValidationError"}],"example":{"detail":[{"loc":["body","questions"],"msg":"Field required","type":"missing"}]}},"DecisionUpstreamValidationError":{"type":"object","title":"DecisionUpstreamValidationError","required":["error"],"properties":{"error":{"$ref":"#\/components\/schemas\/ErrorObject"}},"example":{"error":{"code":"upstream_error","type":"invalid_request_error","message":"Decision service could not complete the request."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key provided as a Bearer token: `Authorization: Bearer <api_key>`. Get an API key at https:\/\/platform.inceptionlabs.ai."}}},"servers":[{"url":"https:\/\/api.inceptionlabs.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"tags":[{"name":"Decisions","description":"Structured decisions with Mercury Decide."},{"name":"Chat","description":"Chat completion endpoints (OpenAI-compatible)."},{"name":"FIM","description":"Fill-in-the-middle code completion endpoints."},{"name":"Edit","description":"Code edit completion endpoints."},{"name":"Models","description":"List available models."}]}