> Source: https://wexa.ai/docs/agents/set-model

# set-model

[Can be held for approval](/docs/sdks-and-apis/how-every-tool-call-works#lifecycle-and-governance)

Set this organization's default AI model, the one every agent uses unless it names its own, or clear it. It affects every project in the organization, so it needs an admin role and the `fabric:model.write` grant.

**Return to the platform default**

**Wexa MCP server**

```bash
curl -sS -X POST https://fabric.wexa.ai/mcp/$FABRIC_PROJECT_ID \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H "content-type: application/json" -H "accept: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"set-model","arguments":{"clear":true}}}'
```

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000172\",\"result\":{\"changed\":true,\"default\":\"\",\"previous\":\"mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8\"}}"
    }
  ],
  "isError": false
}
```

**REST API**

```bash
curl -sS https://fabric.wexa.ai/v1/set-model \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{"clear":true}'
```

```json
{
  "lifecycle_id": "qlc_000172",
  "result": {
    "changed": true,
    "default": "",
    "previous": "mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8"
  }
}
```

**TypeScript SDK**

```ts
import { Fabric } from '@wexa-fabric/sdk'

const fabric = new Fabric()
const result = await fabric.setModel({
  clear: true
})
```

```ts
// result is the payload itself, with no `.result` to read
{
  changed: true,
  default: '',
  previous: 'mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8'
}
```

**Python SDK**

```python
from wexa import Fabric

fabric = Fabric()
out = fabric.set_model(clear=True)
```

```python
# out is the result, already unwrapped
{
    "changed": True,
    "default": "",
    "previous": "mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8"
}
```

## Parameters

| Parameter | Type | Required | Notes |
| --- | --- | --- | --- |
| `model` | string | Optional | Registry model id to make the organization default (`list-models` `settable`). Omit when clearing. One of `model` or `clear` is needed, not both. `system_model` and `default` are refused, as is an id the organization has not configured. |
| `clear` | boolean | Optional | Return the organization to the platform default instead of choosing a model. |
| `fallback` | string | Optional | A second model id used when the default is unavailable. Stored with the organization's other model settings, not in the registry. Refused when the organization has not configured it. |

**Errors**

- `ValidationError` (422): the credential does not hold an admin role (`OWNER`, `ORG_ADMIN` or `PROJECT_ADMIN`).

**Show full response**

A real response, captured from a live call to `set-model`:

**Result of set-model**

**REST API**

```json
{
  "lifecycle_id": "qlc_000172",
  "result": {
    "changed": true,
    "default": "",
    "note": "the organization is back on the platform default. written to the AI Models registry, the same store the console's AI Models page shows and every execution resolves through. Agents that name their own `llm.model` are unaffected.",
    "previous": "mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8",
    "scope": "organization 6a79a770b6c128ccc24bfca8 \u2014 every project in it"
  }
}
```

**Wexa MCP server**

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000172\",\"result\":{\"changed\":true,\"default\":\"\",\"note\":\"the organization is back on the platform default. written to the AI Models registry, the same store the console's AI Models page shows and every execution resolves through. Agents that name their own `llm.model` are unaffected.\",\"previous\":\"mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8\",\"scope\":\"organization 6a79a770b6c128ccc24bfca8 \\u2014 every project in it\"}}"
    }
  ],
  "isError": false
}
```

**TypeScript SDK**

```ts
// the object you get back IS the result — there is no `.result` to read
{
  changed: true,
  default: '',
  note: 'the organization is back on the platform default. written to the AI Models registry, the same store the console\'s AI Models page shows and every execution resolves through. Agents that name their own `llm.model` are unaffected.',
  previous: 'mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8',
  scope: 'organization 6a79a770b6c128ccc24bfca8 — every project in it'
}

// The TS SDK names these camelCase — lifecycleId, traceId — where Python uses
// lifecycle_id and trace_id. Both are non-enumerable: readable, but omitted by
// Object.keys() and JSON.stringify(). `result.lifecycleId` here is undefined.
result.lifecycleId // 'qlc_000172'
```

**Python SDK**

```python
# a dict subclass; `result` is already unwrapped
{
 "changed": True,
 "default": "",
 "note": "the organization is back on the platform default. written to the AI Models registry, the same store the console's AI Models page shows and every execution resolves through. Agents that name their own `llm.model` are unaffected.",
 "previous": "mdl_bx_anthropic-claude-haiku-4-5-20251001-v1_28ccc24bfca8",
 "scope": "organization 6a79a770b6c128ccc24bfca8 \u2014 every project in it"
}

out.lifecycle_id  # 'qlc_000172' — an attribute, not a key
```

**More details**

In the console, open **Settings**, then **Org**, then **AI Models**. Open the actions menu on a model and choose **Set default**, or **Clear default** to return to the platform default. Agents created later without a model get the new default. Older agents still on `system_model` follow it immediately. Agents that name their own model, including every agent stored with the default at creation, are unaffected.

It refuses a model id, or a `fallback`, that the organization has not configured. That protects you: an accepted id that resolves to nothing would break every agent in the organization on its next run. To change one agent, put the id in that agent's `llm.model` and leave this alone; see [list-models](/docs/agents/list-models).

Every tool call works the same way: [How every tool call works](/docs/sdks-and-apis/how-every-tool-call-works).
