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

# Autocomplete (FIM)

> Generate inline code autocomplete suggestions with the Inception fill-in-the-middle (FIM) endpoint, powered by the Mercury Edit 2 code model.

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/fim/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $INCEPTION_API_KEY" \
    -d '{
      "model": "mercury-edit-2",
      "prompt": "def fibonacci(",
      "suffix": "return a + b"
  }'
  ```

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

  client = Inception()  # reads INCEPTION_API_KEY from the environment

  completion = client.fim.completions.create(
      model="mercury-edit-2",
      prompt="def fibonacci(",
      suffix="return a + b",
  )
  print(completion.choices[0].text)
  ```

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

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

  const completion = await client.fim.completions.create({
    model: 'mercury-edit-2',
    prompt: 'def fibonacci(',
    suffix: 'return a + b',
  });
  console.log(completion.choices[0]?.text);
  ```
</CodeGroup>
