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

# Default model

> Set the model a call uses when it doesn't name one, per organization or project, with a route rule in the Management API.

A default-model rule picks the model for calls that don't pass `model`. Set it once for an organization or project, then change it without touching code.

A typical use: your app runs on `openai/gpt-5-mini` everywhere, then you move a single high-stakes project to `anthropic/claude-opus-5` by editing one rule.

## Set a default model

Default-model rules are managed through the [Management API](https://docs.opper.ai/control-plane/management-api.md) with a management key that has the `controls:write` scope. The Rules page in the platform does not edit them. Create a `route` rule whose config holds the model in `default_model`. Send `default_model` without a `type` field:

```bash theme={null}
curl -X POST https://api.opper.ai/management/v1/controls/rules \
  -H "Authorization: Bearer $OPPER_MANAGEMENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "'$(uuidgen | tr A-Z a-z)'",
    "kind": "route",
    "name": "Default model",
    "enabled": true,
    "scope": {"type": "org"},
    "config": {"default_model": "openai/gpt-5-mini"}
  }'
```

| Scope | `scope` value | Applies to |
| - | - | - |
| Organization | `{"type": "org"}` | Every call in your organization. |
| Projects | `{"type": "projects", "project_uuids": ["…"]}` | Calls made with those projects' API keys. |

The most specific rule wins: a project default overrides the organization default. Setting `"default_model": null` on a project rule records an explicit "no default" for that project.

To change the model later, send the new `config` with `PATCH /management/v1/controls/rules/{uuid}`. List existing rules with `GET /management/v1/controls/rules`. See the [rules reference](https://docs.opper.ai/v3-api-reference/management/list-control-rules.md) for every field.

Rules are a Control Plane feature. On the Gateway plan, creating the rule answers `402` with `plan_required`.

### The default must be allowed at its scope

A default model has to pass [model access](https://docs.opper.ai/control-plane/rules/model-access.md) at the same scope. If it doesn't, the API refuses the rule with `400`:

```
default_model "anthropic/claude-opus-5" is not allowed by the comply allowlist at this scope — relax the allowlist or pick a different model
```

The reverse is checked too: saving a model-access change that would exclude an
existing default model is refused with `400` until you change or remove that
default.

## Callers can still pick a model

Passing an explicit `model` always takes precedence over the default, as long as model access allows it. Use this for per-call trade-offs: cheaper models for background jobs, higher-quality ones for user-facing replies.

If the requested model isn't allowed, the call fails with `403` and says which condition failed; it doesn't fall back to the default. See [what a blocked call returns](https://docs.opper.ai/control-plane/rules/model-access.md#what-a-blocked-call-returns).

A call with no `model` and no default-model rule in its scope is refused; the Messages endpoint, for example, answers `400` with `model is required`. Opper does not pick a model for you.

> [!TIP]
>
> Keep model names out of application code. Set a default per scope and switch models by editing the rule. To choose between several models per request, use a [dynamic route](https://docs.opper.ai/capabilities/routes/overview.md) instead.


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