Skip to content
Sign in Create account

Save BYOK provider API key

POST /api/providers/{provider}/key

Validates a submitted key with a read-only provider request when an endpoint is supported, then stores it encrypted. A rejected key returns provider_key_rejected without replacing the saved row. Network failure or an unsupported endpoint stores the key as not verified. The response never echoes the submitted key.

Authenticate with a portal session token.

Parameters

  • provider string path required

Request body

application/json object

  • api_key string (password) required

Generated sample

{
  "api_key": "string"
}

Responses

200 Provider key saved; verification status reflects the provider response.

application/json object

  • active boolean required
    Value: true
  • message string required
  • provider string required
  • verification_status string required
    One of: "verified", "not_verified"
  • verification_reason string required
    One of: "accepted", "unavailable", "unsupported"
  • verification_message string required

Generated sample

{
  "active": true,
  "message": "string",
  "provider": "string",
  "verification_status": "verified",
  "verification_reason": "accepted",
  "verification_message": "string"
}
401 Missing or invalid bearer token.

application/json object

Any keys are accepted.

403 Authenticated caller lacks the required permission, ability, or role.

application/json object

Any keys are accepted.

422 Malformed input, unknown provider, or provider rejected the key (provider_key_rejected).

application/json any

One of

  • GenericError
  • object
    • error object required
      • type string required
        Value: "provider_key_error"
      • code string required
        Value: "provider_key_rejected"
      • message string required
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