cURL
curl --request POST \ --url http://localhost:63372/api/captain/providers/test \ --header 'Content-Type: application/json' \ --cookie captain_session= \ --data ' { "provider_name": "anthropic", "api_key_env": "ANTHROPIC_API_KEY", "api_key": "sk-ant-...", "model": "claude-sonnet-4-5-20250929", "base_url": "https://api.anthropic.com" } '
{ "ok": true, "message": "Connection successful", "latency_ms": 123 }
Test an LLM provider’s connection. Either api_key_env or api_key must be provided.
HMAC-signed session cookie returned by /api/captain/auth/login. Valid for 7 days. Invalidated when password changes.
"anthropic"
Environment variable name containing the API key
"ANTHROPIC_API_KEY"
Direct API key value
"sk-ant-..."
"claude-sonnet-4-5-20250929"
"https://api.anthropic.com"
Provider test result
"Connection successful"
123