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

# Choosing a Model

> Pick the AI model that builds your app — and know when to switch

## The model behind the agent

Every time OptiDev Agent builds something, it's using an AI model. You choose which one.

**Start with Claude Sonnet 5.** It's the default, it's the best all-rounder, and most people never need to change it. Switch models when you have a specific reason — a task that's too hard, a task too small to spend much on, or a project too big to fit in one conversation.

You can change models any time, even mid-project. Your work isn't tied to a model.

***

## Switching Models

### For one project

At the bottom of the Agent chat box, click the model name. The picker groups models into **Anthropic** and **Other providers**, and each row shows two meters at a glance:

| Meter                         | What it tells you                                                       |
| ----------------------------- | ----------------------------------------------------------------------- |
| **Intelligence** (brain icon) | How capable the model is on hard, multi-step work                       |
| **Cost** (dollar signs)       | How fast it burns your credits — one sign is cheapest, five is priciest |

Hover any model for a longer description, what it's best for, and its speed rating.

### For every new project

Go to **Settings** → **Workspace** tab → **AI Settings** and set your **Default Model**. New projects that don't have their own preference will use it.

***

## Models Available

### Anthropic

| Model                | Best for                                                                                                        | Plan               |
| -------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------ |
| **Claude Sonnet 5**  | The default. Near-Opus reasoning with strong coding and tool use, at a lower price. Best pick for most work.    | All plans          |
| **Claude 4.7 Opus**  | The smartest option. Multi-file refactors, deep reasoning, and tricky bugs you need fixed right the first time. | Pro and Enterprise |
| **Claude 4.5 Haiku** | Fastest and cheapest Claude. Renames, copy tweaks, small edits, tight iteration.                                | All plans          |

### Other providers

| Model             | Best for                                                                                               | Plan      |
| ----------------- | ------------------------------------------------------------------------------------------------------ | --------- |
| **GPT-5.6 Terra** | OpenAI's newest frontier model. Strongest reasoning in the GPT-5 line — good for hard multi-file work. | All plans |
| **Qwen 3.5 Plus** | Sonnet-class coding at a fraction of the price. Good for long sessions on a budget.                    | All plans |
| **MiMo V2.5 Pro** | A reasoning specialist — strong on math and structured logic, though slower and narrower.              | All plans |

<Note>
  **Claude 4.7 Opus needs a Pro plan.** On Free and Standard it appears in the picker with a crown icon and an **Upgrade plan to use** button. Every other model works on every plan, including Free.
</Note>

***

<Tip>
  If the agent is stuck on a bug after a couple of attempts, switching to a more capable model is often faster than re-prompting the same one.
</Tip>

***

## Which Should I Pick?

<AccordionGroup>
  <Accordion title="I'm just getting started">
    Leave it on **Claude Sonnet 5**. Come back to this page when you hit something it struggles with.
  </Accordion>

  <Accordion title="The agent can't solve my bug">
    Switch to **Claude 4.7 Opus** (Pro) or **GPT-5.6 Terra**. Both are built for hard reasoning. Ask it to analyze before changing anything: *"Analyze this issue deeper and come up with a plan to fix it. Don't make changes yet."*
  </Accordion>

  <Accordion title="My project has gotten big">
    Stay on **Claude Sonnet 5** or move up to **Claude 4.7 Opus** — the stronger the model, the better it holds a large project in its head. It also helps to start a fresh session: *"Read through the project to understand the current state, then…"*
  </Accordion>

  <Accordion title="I'm low on credits">
    Use **Qwen 3.5 Plus** or **Claude 4.5 Haiku**. Both are far cheaper per task and fine for straightforward changes.
  </Accordion>
</AccordionGroup>

***

## For Developers

<Accordion title="Technical Reference">
  ### Model IDs

  Anthropic models resolve server-side through `AppConfigService.getClaudeModel()`, so the ID can be updated in the `app_configs` table without a deploy:

  | Picker tier | Resolved model ID           |
  | ----------- | --------------------------- |
  | `opus`      | `claude-opus-4-7`           |
  | `sonnet`    | `claude-sonnet-5`           |
  | `haiku`     | `claude-haiku-4-5-20251001` |

  Non-Anthropic models are addressed by their OpenRouter IDs: `openai/gpt-5.6-terra`, `qwen/qwen3.5-plus-02-15`, `xiaomi/mimo-v2.5-pro`.

  ### Two engines

  A model key containing `/` routes to the **OpenCode** engine (OpenRouter-backed); keys without one use the **Claude** engine directly. The stored workspace default is a key, not an ID — `claude-4-sonnet` is a legacy key that resolves to the current Sonnet.

  Selecting an unavailable or unknown model falls back to the default rather than erroring, so a model can be retired without breaking saved preferences.

  ### Plan gating

  Access is by tier, not by individual model — every non-Anthropic model is registered at the `sonnet` tier:

  | Plan       | Tiers available           |
  | ---------- | ------------------------- |
  | Free       | `haiku`, `sonnet`         |
  | Standard   | `haiku`, `sonnet`         |
  | Pro        | `haiku`, `sonnet`, `opus` |
  | Enterprise | `haiku`, `sonnet`, `opus` |

  Defaults live in code and are overridable per environment via `app_configs.config.planFeatures`.

  ### Credit calculation

  ```
  credits = costUsd / creditUsdRate
  ```

  Credits are derived from actual API cost, which is why model choice changes consumption directly. The rate is configurable (`config.credits.usdRate`). Per-model spend is aggregated from `credit_transactions` and surfaced as **Usage by Model** on the billing page.
</Accordion>

***

## What's Next?

<CardGroup cols={2}>
  <Card title="Prompt Guide" icon="message" href="/get-started/prompt-guide">
    Write prompts that get better results from any model.
  </Card>

  <Card title="Plans & Credits" icon="credit-card" href="/billing/plans-and-credits">
    See how credits are allocated and what each plan includes.
  </Card>
</CardGroup>
