> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inceptionlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions

> Send chat completion requests to the Inception API to generate conversational responses from Mercury 2 with adjustable reasoning effort and streaming.

Export your API key as an environment variable in your terminal.

<CodeGroup>
  ```bash macOS / Linux theme={null}
  export INCEPTION_API_KEY="your_api_key_here"
  ```

  ```bash Windows theme={null}
  set INCEPTION_API_KEY="your_api_key_here"
  ```
</CodeGroup>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.inceptionlabs.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $INCEPTION_API_KEY" \
    -d '{
      "model": "mercury-2",
      "messages": [
        { "role": "system", "content": "You are a helpful assistant." },
        { "role": "user", "content": "What is a diffusion model?" }
      ]
    }'
  ```

  ```python Python theme={null}
  from inceptionai import Inception

  client = Inception()  # reads INCEPTION_API_KEY from the environment

  completion = client.chat.completions.create(
      model="mercury-2",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "What is a diffusion model?"},
      ],
  )
  print(completion.choices[0].message.content)
  ```

  ```typescript TypeScript theme={null}
  import Inception from 'inceptionai';

  const client = new Inception(); // reads INCEPTION_API_KEY from the environment

  const completion = await client.chat.completions.create({
    model: 'mercury-2',
    messages: [
      { role: 'system', content: 'You are a helpful assistant.' },
      { role: 'user', content: 'What is a diffusion model?' },
    ],
  });
  console.log(completion.choices[0]?.message.content);
  ```
</CodeGroup>
