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

# Choose a model

> Choose a model by ID or route to a specific provider.

When you send a request to `https://gateway.ngrok.ai`, the `model` field tells the AI Gateway which model to call.

Use a model ID when you want the gateway to resolve the provider from the [model catalog](/ai-gateway/reference/model-catalog). Use `provider:model` when you want to choose the provider yourself.

## Use a model ID

Use a model ID when you know which model you want to call and don't need to force a specific provider.

```json theme={null}
{
  "model": "gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

The gateway looks up `gpt-4o` in the [model catalog](/ai-gateway/reference/model-catalog), selects the matching provider, and routes the request upstream.

## Route to a specific provider

Use `provider:model` when you want predictable routing or need to avoid ambiguity between model names.

```json theme={null}
{
  "model": "openai:gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

In this example:

* `openai` is the provider ID.
* `gpt-4o` is the model ID.

Use this format when you have more than one provider configured, want to call a custom provider, or want the request to go to one specific upstream.

## Use a custom provider model

```json theme={null}
{
  "model": "my-ollama:llama3.2",
  "messages": [{"role": "user", "content": "Hello"}]
}
```

Custom providers use the same `provider:model` format. In this example, `my-ollama` is your custom provider ID and `llama3.2` is the model ID configured on that provider.

## Check model capabilities

Before choosing a model, check the [model catalog](/ai-gateway/reference/model-catalog) for:

| Field                 | Use it to check                                                |
| --------------------- | -------------------------------------------------------------- |
| Context window        | How much input the model can accept                            |
| Output tokens         | How much output the model can return                           |
| Modalities            | Whether the model supports text, image, audio, video, or files |
| Provider key required | Whether you need to bring your own provider key                |

## Keep access rules in mind

The request can only use providers and models allowed by the [access key configuration](/ai-gateway/guides/access-key-configurations) assigned to the access key.

If you need to limit what a client can call, see [Restrict providers and models](/ai-gateway/guides/restrict-providers-and-models).

## Next steps

* [Model catalog](/ai-gateway/reference/model-catalog): Built-in providers and models
* [Configure fallback models](/ai-gateway/guides/configure-fallback-models): Try another model if the first one fails
* [Use a model you run yourself](/ai-gateway/guides/use-a-model-you-run-yourself): Connect Ollama, vLLM, LM Studio, or another private model
