# Choose models

Choose the model an agent answers with; without a choice it uses the project's default. The project and the account set which models it can pick.

## Before you start

You need an agent. See [Create an agent](/docs/agents/create-agent.md).

## Set an agent's model

**Studio**

1. In your project, open **Agents**.
2. Click your agent.
3. Click **Edit**.
4. Open **Model**.
5. Pick **Claude Haiku 4.5**.
6. Click **Save**. You should now see **Configured model** read `anthropic/claude-haiku-4-5-20251001` on the agent's page.

**Code**

1. Set `model` on the agent as `provider/model`. Leave it out to use the project's default:

```ts title="agents/support.ts" {6}
import { agent } from "veryfront/agent";

export default agent({
  id: "support",
  name: "Support assistant",
  model: "anthropic/claude-haiku-4-5-20251001",
  system: "Answer customer questions about orders and refunds. Keep replies to two sentences.",
});
```

2. Start the project with `npm run dev`.
3. Open **Chat** in Studio.
4. Pick Support assistant.
5. Ask "Can I get a refund on an order I placed yesterday?". You should now see the agent reply and its page show **Configured model** `anthropic/claude-haiku-4-5-20251001`.

### Try it in a sandbox

```playground
step: Create a project | npm create -y veryfront@latest support-desk -- --template ai-agent --yes
step: Set the agent's model | cd support-desk && mkdir -p agents && printf '%s\n' 'import { agent } from "veryfront/agent";' '' 'export default agent({' '  id: "support",' '  name: "Support assistant",' '  model: "anthropic/claude-haiku-4-5-20251001",' '  system: "Answer customer questions about orders and refunds. Keep replies to two sentences.",' '});' > agents/support.ts
step: Start it | npm run dev
agent: support
ask: Can I get a refund on an order I placed yesterday?
expect: refund
```

**API**

1. Set `PROJECT` to your project's ID ([Find your IDs](/docs/authentication/api-keys.md#find-your-ids)): `export PROJECT=<id>`.
2. Set the model of your agent, here `support`, with your [API key](/docs/authentication/api-keys.md). Only the fields you send change:

```bash
curl -X PUT https://api.veryfront.com/projects/$PROJECT/agents/support \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "anthropic/claude-haiku-4-5-20251001"}'
```

3. Get the agent. You should now see `"model": "anthropic/claude-haiku-4-5-20251001"`:

```bash
curl https://api.veryfront.com/projects/$PROJECT/agents/support \
  -H "Authorization: Bearer $VERYFRONT_API_KEY"
```

### Try it in a sandbox

```playground
step: Set PROJECT | export PROJECT=$VERYFRONT_PROJECT_ID
step: Before you start: an agent | curl -X POST https://api.veryfront.com/projects/$PROJECT/agents -H "Authorization: Bearer $VERYFRONT_API_KEY" -H "Content-Type: application/json" -d '{"id": "support", "name": "Support assistant", "system_prompt": "Answer customer questions about orders and refunds. Keep replies to two sentences."}'
step: Set the model | curl -X PUT https://api.veryfront.com/projects/$PROJECT/agents/support -H "Authorization: Bearer $VERYFRONT_API_KEY" -H "Content-Type: application/json" -d '{"model": "anthropic/claude-haiku-4-5-20251001"}'
check: curl https://api.veryfront.com/projects/$PROJECT/agents/support -H "Authorization: Bearer $VERYFRONT_API_KEY"
expect: "model":"anthropic/claude-haiku-4-5-20251001"
```

## With MCP

`my-project` is your project's reference: its slug or its ID. Your agent here is `support`; `veryfront__list_agents` lists them.

1. Call `veryfront__list_models`, and find `anthropic/claude-haiku-4-5-20251001` with `enabled` true.
2. Call `veryfront__update_agent` with `"agent_id": "support"`, `"project_reference": "my-project"` and `"model": "anthropic/claude-haiku-4-5-20251001"`.
3. Call `veryfront__get_agent` with `"agent_id": "support"` and `"project_reference": "my-project"`. It worked when `model` is `anthropic/claude-haiku-4-5-20251001`.

## Next steps

* [Limit models in a project](/docs/agents/project-models.md)
* [Chat with your agent](/docs/agents/chat.md)
