# Quickstart

Start building with hosted IFM models in three steps.

## Create an API key

Create an API key in the [IFM Platform](https://platform.ifm.ai/api-keys). Store it securely.

```
export IFM_API_KEY="IFM-xf..."
```

## Configure your environment

All IFM models share the same base URL. Choose a hosted model that best fits your needs from the [Model overview](https://docs.ifm.ai/docs/model-catalog.md).

```
export IFM_BASE_URL="https://api.ifm.ai/v1"
```

```
export IFM_MODEL="IFM/K2-Horizon-375B-A23B"
```

## Make the request

See [Parameters](https://docs.ifm.ai/docs/chat-completions.md) for more details about the requests.

```
curl $IFM_BASE_URL/chat/completions \
  -H "Authorization: Bearer $IFM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "'$IFM_MODEL'", "messages": [{"role": "user", "content": "hello"}]}'
```

## Response

A JSON response — the reply text is at `choices[0].message.content`:

```
{
  "choices": [{
    "message": {
      "content": "Hello! How can I help you today?"
    }
  }]
}
```

The full response schema is defined in [Chat completions API](https://docs.ifm.ai/docs/chat-completions.md).

_Last updated: October 13, 2026_
