Skip to main content

Error response shape

{
  "error": {
    "code": "INVALID_INPUT_TYPE",
    "message": "This API only supports TEXT input. IMAGE content was included.",
    "type": "invalid_request_error",
    "param": "messages[0].content"
  }
}

Error codes

HTTPCodeCauseTypical fix
400INVALID_INPUT_TYPEData type doesn’t match the API’s bound InputType.Send the correct type, or use an API that’s bound to the right InputType.
400SETTINGS_VIOLATIONExceeds max_text_length, max_file_size, or allowed_file_type.Trim content or split requests.
400INVALID_REQUESTMalformed JSON, missing messages, etc.Validate the payload.
401UNAUTHORIZEDMissing or invalid Authorization header.Check Bearer token.
403API_INACTIVEAPI key deactivated or revoked.Rotate the key in Citadel.
404API_NOT_FOUNDThe {api-id} doesn’t exist.Verify the URL with your administrator.
500POLICY_NOT_FOUNDThe bound Guard Policy can’t be loaded.Contact your administrator.
502GUARDIAN_ERRORGuardian returned an internal error.Retry with exponential backoff.
503GUARDIAN_UNAVAILABLEGuardian is temporarily unreachable.Retry with exponential backoff.

Retry strategy

CodeRetry?
400, 401, 403, 404No — fix the request or key.
500, 502, 503Yes — exponential backoff, max 3 attempts.