Skip to content
Sign in Create account

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_key string required
  • provider string required

Generated sample

{
  "api_key": "string",
  "provider": "string"
}

Responses

200 Provider key validated.

application/json object

  • provider string required
    One of: "openai", "anthropic"
  • valid boolean required
    Value: 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

  • error string
  • provider string
  • valid boolean
    Value: false
429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string