Inception API

OpenAI-compatible LLM API for the Mercury diffusion language models — chat, fill-in-the-middle, and code-edit completions with streaming, tool calling, and structured outputs. Authenticated with a Bearer API key.

OpenAPI Specification

inception-labs-openapi-original.json Raw ↑
{"openapi":"3.1.0","info":{"title":"Inception API","version":"1.0.0","description":"Inception Labs LLM API — 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/chat/completions":{"post":{"summary":"Create a chat completion","operationId":"createChatCompletion","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"},"example":{"model":"mercury-2","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","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 — 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 — 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 — 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 — 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 — 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\",\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',\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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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"],"openrouter":{"slug":"inception/mercury-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized — 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"],"openrouter":{"slug":"inception/mercury-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized — 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":[],"openrouter":{"slug":"inception/mercury-edit-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized — 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":[],"openrouter":{"slug":"inception/mercury-edit-2"},"datacenters":[{"country_code":"US"}]}]}}}},"401":{"description":"Unauthorized — 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.","minimum":1,"maximum":50000,"default":16384},"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. Values outside this range are reset to 0.75 and a `warning` is returned in the response.","default":0.75,"minimum":0.5,"maximum":1.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."},"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":{"type":"string","enum":["auto","required","none"],"title":"Tool Choice","description":"Controls tool selection: 'auto' (model decides, default when tools present), 'required' (model must call one), or 'none' (model must not call one)."},"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","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"},"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."},"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.0,"maximum":2.0},"top_p":{"type":"number","title":"Top P","description":"Float that controls the cumulative probability of the top tokens to consider.","default":1.0,"minimum":0.0,"maximum":1.0},"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.0,"minimum":-2.0,"maximum":2.0}},"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"},"reasoning_tokens":{"type":"integer","title":"Reasoning Tokens"},"completion_tokens":{"type":"integer","title":"Completion Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"},"cached_input_tokens":{"type":"integer","title":"Cached Input Tokens"}},"type":"object","required":["prompt_tokens","reasoning_tokens","completion_tokens","total_tokens","cached_input_tokens"],"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.0,"minimum":0.0,"maximum":1.0},"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 thei

# --- truncated at 32 KB (49 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/inception-labs/refs/heads/main/openapi/inception-labs-openapi-original.json