Skip to main content
POST
/
api
/
captain
/
providers
/
test
Test provider connection
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
}

Authorizations

captain_session
string
cookie
required

HMAC-signed session cookie returned by /api/captain/auth/login. Valid for 7 days. Invalidated when password changes.

Body

application/json
provider_name
string
required
Example:

"anthropic"

api_key_env
string

Environment variable name containing the API key

Example:

"ANTHROPIC_API_KEY"

api_key
string

Direct API key value

Example:

"sk-ant-..."

model
string
Example:

"claude-sonnet-4-5-20250929"

base_url
string
Example:

"https://api.anthropic.com"

Response

Provider test result

ok
boolean
required
message
string
required
Example:

"Connection successful"

latency_ms
integer
Example:

123