Validate a provider API key during onboarding
POST /api/onboarding/validate-provider
Makes a lightweight validation call for an OpenAI or Anthropic API key of at least 20 characters. Returns {valid: true} on success; invalid keys or a failed validation call return {valid: false} with 422. The key is not included in logs or the response.
Authenticate with a portal session token.
Request body
application/json object
api_keystring requiredproviderstring required
Generated sample
{
"api_key": "string",
"provider": "string"
}Responses
200 Provider key validated.
application/json object
providerstring requiredOne of:"openai","anthropic"validboolean requiredValue:true
Generated sample
{
"provider": "openai",
"valid": true
}401 Missing or invalid bearer token.
application/json object
Any keys are accepted.
403 The caller does not meet the route requirements: accepted Terms of Service and Privacy Policy.
application/json object
Any keys are accepted.
422 Key is invalid, input validation failed, or provider validation call failed.
application/json object
errorstringproviderstringvalidbooleanValue:false
429 The request was rate limited. API-generated responses are JSON;
Response headers
Retry-Afterstring headerSeconds to wait before retrying, when provided.
X-RateLimit-Scopestring headerIdentifies the scope of the request limit, when provided.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string