Chat

Create a chat completion

Changed on

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.

post/v1/chat/completions

Request

  • Base URL
    https://api.inceptionlabs.ai
  • URL
    https://api.inceptionlabs.ai/v1/chat/completions
  • Auth
    HTTP bearer

Request body

modelstring required

The model to use for the chat completion.

max_tokensinteger

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".

max_completion_tokensinteger

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".

temperaturenumber

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.

stopstring[]

A list of sequences where the API will stop generating further tokens. The returned text will not contain the stop sequences.

streamboolean

Whether to stream the response.

diffusingboolean

Whether to show the diffusion effect in the streamed response.

extra_bodyobject

Extra parameters passed to the model (OpenAI-compat passthrough).

realtimeboolean

Enable flag for more realtime workloads that require lower TTFT/TTFAT.

reasoning_summaryboolean

Request a summary of the model's reasoning process.

reasoning_summary_waitboolean

Wait for all reasoning summaries to complete before finishing the response.

reasoning_effort'instant' | 'low' | 'medium' | 'high'

Constrains the effort spent on reasoning before the model responds.

Response

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.

idstring required
object'chat.completion' required
createdinteger required
modelstring required
warningstring nullable

Example response

{
  "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
  }
}

Changes