Skip to main content
POST
/
auth
/
provider_keys
/
test
Test Provider Key
curl --request POST \
  --url https://api.example.com/auth/provider_keys/test

Test Provider Key

Validate that an AI provider API key is working correctly without storing it in the Shinzo Platform. This is useful for verifying credentials before saving them.

Endpoint

POST /auth/provider_keys/test

Authentication

No authentication required.

Request Body

FieldTypeRequiredDescription
providerstringYesProvider name (anthropic)
provider_api_keystringYesThe API key to test
provider_base_urlstringNoCustom base URL (for proxies or self-hosted)

Example Request

curl -X POST https://api.app.shinzo.ai/auth/provider_keys/test \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "anthropic",
    "provider_api_key": "sk-ant-api03-..."
  }'

Response (Valid Key)

{
  "valid": true,
  "provider": "anthropic",
  "message": "API key is valid"
}

Response (Invalid Key)

{
  "valid": false,
  "provider": "anthropic",
  "error": "Authentication failed: Invalid API key"
}

Status Codes

CodeDescription
200Test completed (check valid field for result)
400Invalid request (missing fields, unsupported provider)

Supported Providers

ProviderValue
Anthropicanthropic

Notes

  • This endpoint does not store the API key
  • The test makes a minimal API call to verify the key is valid
  • Custom base URLs are supported for enterprise or self-hosted deployments