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

# LLM Models API

> Register LLM models and choose the workspace's models and backup model via the Public API

Choose which LLM model your workspace uses for each kind of work, and which model answers when that model's provider is unavailable (the [backup model](https://ago.mintlify.site/agent/agents.md#backup-model)). You can also register models from the supported providers and remove the ones you no longer use.

These endpoints are not available as MCP tools.

## Authentication

Reading requires an API key with the `llm_models:read` scope; changes require `llm_models:write`. These scopes can only be granted to API keys, not to OAuth connections.

```bash theme={null}
curl -H "X-API-Key: ago_v1_sk_..." https://your-workspace.api.useago.com/api/v1/workspace-models
```

See [API Key Authentication](https://ago.mintlify.site/security/api-key-authentication.md) for setup instructions.

***

## Workspace models

### Read the workspace models

```
GET /api/v1/workspace-models
```

```json theme={null}
{
  "default_model_id": "6f1c0c1e-2a57-4f8e-9d0b-3c1f5f7a9b10",
  "fast_model_id": "0b3d2a8e-7c41-4d5a-8f9e-1a2b3c4d5e6f",
  "cheap_model_id": null,
  "reasoning_model_id": null,
  "backup_model_id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4"
}
```

| Field | Description |
| - | - |
| default\_model\_id | Model used by agents and most features |
| fast\_model\_id | Model used for quick tasks such as titles and suggestions |
| cheap\_model\_id | Model used for high-volume background tasks. `null`: the fast model |
| reasoning\_model\_id | Model used for tasks that need deeper reasoning. `null`: the default model |
| backup\_model\_id | Model that answers while another model's provider is unavailable. `null`: no backup |

### Change the workspace models

```
PUT /api/v1/workspace-models
```

The request replaces every field: send the current values of the fields you don't want to change. An optional field you omit, including `backup_model_id`, is unset. `default_model_id` and `fast_model_id` are required.

```bash theme={null}
curl -X PUT https://your-workspace.api.useago.com/api/v1/workspace-models \
  -H "X-API-Key: ago_v1_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "default_model_id": "6f1c0c1e-2a57-4f8e-9d0b-3c1f5f7a9b10",
    "fast_model_id": "0b3d2a8e-7c41-4d5a-8f9e-1a2b3c4d5e6f",
    "backup_model_id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4"
  }'
```

The response has the same shape as `GET`. An unknown model id returns `400` and changes nothing.

Choose a backup model from another provider than your other models: a backup from the same provider is usually down at the same time. Your conversation and ticket content is sent to the backup model's provider when it answers.

***

## Models

### List models

```
GET /api/v1/llm-models
```

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
      "name": "Mistral Large",
      "model_name": "mistral-large-latest",
      "provider": "mistral",
      "azure_endpoint": null,
      "azure_api_version": null,
      "has_azure_api_key": false,
      "base_url": null,
      "has_api_key": false,
      "reasoning": null,
      "used_by": ["Backup model"]
    }
  ],
  "has_more": false,
  "total": 1
}
```

`used_by` lists the workspace settings and agents that use the model. API keys stored on a model are never returned.

### Read a model

```
GET /api/v1/llm-models/{model_id}
```

### List providers

```
GET /api/v1/llm-models/catalog
```

Returns the providers AGO supports, with suggested model ids for each. Models of the `openai_compatible` provider can't be registered through the API (see below).

### Register a model

```
POST /api/v1/llm-models
```

| Field | Type | Required | Description |
| - | - | - | - |
| name | string | Yes | Display name, unique in the workspace |
| model\_name | string | No | The provider's model id, such as `mistral-large-latest`. Defaults to `name` |
| provider | string | Yes | A provider `key` from the catalog |
| reasoning | object | No | Reasoning options for providers that support them, such as `{"effort": "low"}` |

Returns `201` with the model. For Azure OpenAI, `model_name` is your deployment name, and the model uses your workspace's Azure OpenAI connection.

Models of the `openai_compatible` provider (your own endpoint or gateway) can't be registered through the API. Contact AGO support to add one.

### Update a model

```
PUT /api/v1/llm-models/{model_id}
```

Same fields as registration. The model keeps the endpoint and key AGO support configured for it, unless you change its provider.

### Delete a model

```
DELETE /api/v1/llm-models/{model_id}
```

A model still used by a workspace setting or an agent can't be deleted: the `400` error lists where it is used.

```json theme={null}
{
  "object": "deleted",
  "id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
  "deleted": true
}
```

## Related

* [Agents](https://ago.mintlify.site/agent/agents.md#backup-model) - How the backup model takes over
* [API Key Authentication](https://ago.mintlify.site/security/api-key-authentication.md) - Create a key with the `llm_models` scopes


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.