Test an AI provider key
SDK platic.aiProviders.verify()
Retest the provider's stored key without sending its value. Use this after adding balance, enabling a model, or resolving a key in the invalid state.
Example
curl -X POST https://api.platic.ai/v1/ai-providers/openai/verify \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.aiProviders.verify("openai"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
provider | string | openai, google, anthropic, or xai | ✓ |
It has no body.
Response
200 OK with the provider after the test, in the shape of list AI providers. message is Key verified if it works, or The key does not work: see lastError if it does not.
{
"status": "success",
"message": "The key does not work: see lastError",
"data": {
"provider": "openai",
"name": "OpenAI",
"status": "invalid",
"health": "no_credit",
"fallback": "platform",
"lastVerifiedAt": "2026-11-13T17:05:00.000Z",
"lastError": "NO_CREDIT",
"secretName": "OpenAI key",
"models": [
{ "id": "gpt-6.1-sol", "name": "GPT-6.1 Sol", "status": "unavailable", "code": "NO_CREDIT", "ownKeyOnly": false },
{ "id": "gpt-6.1-terra", "name": "GPT-6.1 Terra", "status": "unavailable", "code": "NO_CREDIT", "ownKeyOnly": false },
{ "id": "gpt-6-luna", "name": "GPT-6 Luna", "status": "unavailable", "code": "NO_CREDIT", "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 use secrets |
404 | PROVIDER_NOT_FOUND | The provider has no key. Connect it with connect an AI provider key |
429 | VERIFICATION_RATE_LIMITED | There were already 10 tests of that provider in the last hour |
503 | VERIFICATION_FAILED | The key could not be tested with the provider. Get the provider before retrying |
Notes
- As when connecting, the test spends a few tokens from your provider account and can take up to 200 seconds.
- From an AI agent, the tool is
verify_ai_provider.