> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shinzo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Provider Key

> Test an AI provider API key without storing it.

# 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.

## Authentication

No authentication required.

<ParamField body="provider" type="string" required>Provider name (`anthropic`)</ParamField>
<ParamField body="provider_api_key" type="string" required>The API key to test</ParamField>
<ParamField body="provider_base_url" type="string">Custom base URL (for proxies or self-hosted)</ParamField>

## Example Request

```bash theme={null}
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)

```json theme={null}
{
  "valid": true,
  "provider": "anthropic",
  "message": "API key is valid"
}
```

## Response (Invalid Key)

```json theme={null}
{
  "valid": false,
  "provider": "anthropic",
  "error": "Authentication failed: Invalid API key"
}
```

## Status Codes

| Code  | Description                                            |
| ----- | ------------------------------------------------------ |
| `200` | Test completed (check `valid` field for result)        |
| `400` | Invalid request (missing fields, unsupported provider) |

## Supported Providers

| Provider  | Value       |
| --------- | ----------- |
| Anthropic | `anthropic` |

## 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
