---
title: "Change the LLM model of a live agent"
method: PATCH
path: "/agents/{id}/model"
tags: ["Agents"]
---

# Change the LLM model of a live agent

`PATCH /agents/{id}/model`

## Request

- Base URL: `https://api.atako.ai`
- URL: `https://api.atako.ai/agents/{id}/model`
- Auth: HTTP bearer

Owner of the agent, or an admin of the owner's company. A plain teammate (who can still view and chat with the agent) gets 404. `modelId` is an `ai_models` UUID or an OpenRouter slug (same shapes as at creation). Takes effect on the agent's next LLM call. A free OpenRouter model is refused (400) on Atako inference; a direct-provider (OpenAI/Anthropic) BYOK agent and an ended/failed agent answer 409. A Weflayr agent takes a Weflayr model id instead (≥160k known context, else 400 MODEL_CONTEXT_TOO_SMALL).

## Path parameters

- `id` string, required

## Request body

- object
  - `modelId` string, required

## Response `200`

- object
  - `modelId` string
  - `model` object
    - `slug` string
    - `name` string
    - `contextLength` integer, nullable

## Other responses

- `400`: modelId must be a non-empty string / Model not found / MODEL_CONTEXT_TOO_SMALL / MODEL_NOT_AVAILABLE_ON_ATAKO_INFERENCE
- `401`: Missing, malformed, or invalid bearer token / API key, or revoked session (SESSION_REVOKED).
- `404`: Unknown agent, or the caller is neither its owner nor an admin of the owner's company.
- `409`: DIRECT_PROVIDER_MODEL_IMMUTABLE / AGENT_NOT_ACTIVE

---

[API](https://skmtc.dev/atako/apis/atako-api.md) · [All operations](https://skmtc.dev/atako/apis/atako-api/llms.txt) · [OpenAPI document](https://skmtc.dev/atako/apis/atako-api/revisions/aa555c56fbd7?raw)
