---
docId: doc_ef6a5496d7d847e1b1df31aa659b0daf
title: Change the fallback
description: "Choose what agents do when a provider key fails."
api:
  group: proveedores-de-ia
  auth: bearer
  operations:
    - operationId: updateAiProvider
      method: PATCH
      path: '/v1/ai-providers/{provider}'
      postmanName: Change the fallback
---

<script>
  import { Ways } from '$lib/components';
</script>

# Change the fallback

Choose how agents respond when a connected provider key fails. Changing the fallback does not modify or test the key.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/ai-providers/openai \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fallback": "none" }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.aiProviders.update("openai", { fallback: "none" });
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `provider` | string | `openai`, `google`, `anthropic`, or `xai` | ✓ |

## Request body

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `fallback` | string | `platform`: they answer with Platica's account and those messages charge AI, except models that only work with your own key. `none`: they do not answer with this provider's models | ✓ |

```json
{
  "fallback": "none"
}
```

## Response

`200 OK` with the provider, in the shape of [list AI providers](/api-reference/ai-providers/list#the-provider).

```json
{
  "status": "success",
  "message": "Fallback updated",
  "data": {
    "provider": "openai",
    "name": "OpenAI",
    "status": "connected",
    "health": "ok",
    "fallback": "none",
    "lastVerifiedAt": "2026-11-13T16:20:00.000Z",
    "lastError": null,
    "secretName": "OpenAI key",
    "models": [
      { "id": "gpt-6.1-sol", "name": "GPT-6.1 Sol", "status": "available", "code": null, "ownKeyOnly": false },
      { "id": "gpt-6.1-terra", "name": "GPT-6.1 Terra", "status": "available", "code": null, "ownKeyOnly": false },
      { "id": "gpt-6-luna", "name": "GPT-6 Luna", "status": "unavailable", "code": "MODEL_OR_DEPLOYMENT_NOT_FOUND", "ownKeyOnly": false }
    ]
  }
}
```

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_PROVIDER` | `{provider}` is not one of the four |
| `400` | `INVALID_REQUEST` | `fallback` is missing, is neither `platform` nor `none`, or the body has another field. `details.issues` says which |
| `403` | `FORBIDDEN` | The person behind the token cannot manage secrets |
| `404` | `PROVIDER_NOT_FOUND` | The provider has no key. When you [connect it](/api-reference/ai-providers/connect-key) you can send `fallback` |

## Notes

- From an AI agent, the tool is [`update_ai_provider`](/mcp/tools#ai-providers).
