Disconnect an AI provider key
SDK platic.aiProviders.disconnect()
Stop using the provider key, remove its authorization, and delete the secret created when it was connected. The provider returns to not_connected, and agents use Platica's account again.
Example
curl -X DELETE https://api.platic.ai/v1/ai-providers/openai \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.aiProviders.disconnect("openai"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
provider | string | openai, google, anthropic, or xai | ✓ |
Response
200 OK with the provider now without a key, in the shape of list AI providers.
{
"status": "success",
"message": "Key disconnected",
"data": {
"provider": "openai",
"name": "OpenAI",
"status": "not_connected",
"health": null,
"fallback": null,
"lastVerifiedAt": null,
"lastError": null,
"secretName": null,
"models": [
{ "id": "gpt-6.1-sol", "name": "GPT-6.1 Sol", "status": "unverified", "code": null, "ownKeyOnly": false },
{ "id": "gpt-6.1-terra", "name": "GPT-6.1 Terra", "status": "unverified", "code": null, "ownKeyOnly": false },
{ "id": "gpt-6-luna", "name": "GPT-6 Luna", "status": "unverified", "code": null, "ownKeyOnly": false }
]
}
} Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_PROVIDER | {provider} is not one of the four |
403 | FORBIDDEN | The person behind the token cannot manage secrets |
Warning
Agents that use a model that only works with your own key stop answering with it.
Notes
- The secret that created the connection is deleted (for example,
OpenAI key): its encrypted value disappears and cannot be recovered. If you renamed it or another integration uses it, it stays in Secrets without authorization for the provider; delete it if it is no longer useful. - Disconnecting a provider without a key changes nothing and answers the same.
- From an AI agent, the tool is
disconnect_ai_provider.