# AiModelOverrideRequest

Runs one agent on a different model for this run. Name the model either with `modelName` (a model in Maitento's catalogue) or with `customModel` (a model you define inline): exactly one of the two.

**Kind:** an object, used in requests and responses. In a request it is called `AiModelOverrideRequestInput`.

## In a request

| Field | Type | Required | Description |
|---|---|---|---|
| `agentName` | `string` | yes | The agent (its name in the interaction) to run on the other model. Constraints: required (empty or whitespace-only strings are rejected). |
| `modelName` | `string \| null` |  | The name of a catalogue model. Required unless `customModel` is given. |
| `customModel` | [`InlineAiModelDefinitionInput`](https://docs.maitento.com/reference/types/inline-ai-model-definition.md#in-a-request)`\| null` |  | A model defined inline, for one that isn't in the catalogue. Not allowed with `modelName`. |
| `purpose` | [`AiModelOverridePurpose`](https://docs.maitento.com/reference/types/ai-model-override-purpose.md) |  | Which of the agent's models this replaces: its own (the default), or the one that vets what its loom offers it. |

```json
{
  "agentName": "...",
  "modelName": "...",
  "customModel": {
    "name": "...",
    "apiType": "...",
    "modelIdentifier": "...",
    "credentialProvider": "...",
    "contextWindowTokens": 0,
    "maxOutputTokens": 0,
    "supportsJsonSchemaResponseFormat": false,
    "tokenizerFamily": "...",
    "reasoningEffort": "..."
  },
  "purpose": "Agent"
}
```

## In a response

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `agentName` | `string` | The agent (its name in the interaction) to run on the other model. Constraints: required (empty or whitespace-only strings are rejected). |
| `modelName` | `string \| null` | The name of a catalogue model. Required unless `customModel` is given. |
| `customModel` | [`InlineAiModelDefinition`](https://docs.maitento.com/reference/types/inline-ai-model-definition.md)`\| null` | A model defined inline, for one that isn't in the catalogue. Not allowed with `modelName`. |
| `purpose` | [`AiModelOverridePurpose`](https://docs.maitento.com/reference/types/ai-model-override-purpose.md) | Which of the agent's models this replaces: its own (the default), or the one that vets what its loom offers it. |

```json
{
  "agentName": "...",
  "modelName": "...",
  "customModel": {
    "name": "...",
    "apiType": "...",
    "modelIdentifier": "...",
    "credentialProvider": "...",
    "contextWindowTokens": 0,
    "maxOutputTokens": 0,
    "supportsJsonSchemaResponseFormat": false,
    "tokenizerFamily": "...",
    "reasoningEffort": "..."
  },
  "purpose": "Agent"
}
```

## Where it's used

- Inside [`AppProcess`](https://docs.maitento.com/reference/types/app-process.md)
- Inside [`AppProcessWithDetails`](https://docs.maitento.com/reference/types/app-process-with-details.md)
- Inside [`AppStartRequest`](https://docs.maitento.com/reference/types/app-start-request.md)
- Inside [`InteractionProcessStartRequest`](https://docs.maitento.com/reference/types/interaction-process-start-request.md)
