Documentation

AI API Troubleshooting

This page lists common LLMPool AI API errors, their likely causes, and recommended actions. First confirm that the request uses the correct protocol:

  • OpenAI-compatible Base URL: https://api.benpay.ai/openai/v1
  • Anthropic-compatible Base URL: https://api.benpay.ai/anthropic/v1

See Error Responses for the response fields.

How to read the tables: Use the HTTP status to identify the broad error category, then use OpenAI error.code or Anthropic error.type to select the specific handling. Do not use message text for programmatic decisions.

Recommended diagnostic order

  1. Record the HTTP status, request path, and request identifiers from response headers. Do not record credentials or the complete request body.
  2. Even for a non-2xx status, first determine whether the body is a structurally valid business object for the endpoint, such as a Response with status: "failed"; otherwise parse the protocol error envelope.
  3. For OpenAI, diagnose with the HTTP status and error.code. For Anthropic, use the HTTP status and error.type. Treat message as human-readable text only.
  4. Use the tables below to decide whether to correct the request, contact platform support, or retry a limited number of times. Before retrying, confirm that the operation is safe to replay.

Authentication and access

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
invalid_api_keyauthentication_error401NoThe API key is missing, malformed, invalid, expired, disabled, unbound, or belongs to an unavailable accountVerify the header and Base URL; check the key in API Keys and create a new key if necessary
ip_not_allowedauthentication_error with error.code=ip_not_allowed403NoThe source IP is outside the API key allowlist, or a proxy did not pass the expected client IPCheck the API key IP allowlist, outbound IP, and reverse-proxy X-Forwarded-For / X-Real-IP configuration

For OpenAI, use:

Authorization: Bearer YOUR_API_KEY

For Anthropic, prefer:

x-api-key: YOUR_API_KEY

Anthropic also accepts Authorization: Bearer YOUR_API_KEY. When both headers are present, LLMPool prefers x-api-key.

Balance and billing

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
insufficient_walletsinvalid_request_error, no distinct value402NoAvailable wallet and subscription balance is insufficientFund the account or contact the organization owner, then submit the request again
meter_price_rules_errorNot applicable400 or 500NoMissing or incomplete meter rules return 400; failure to load the rules returns 500Select another available model or contact platform support; retrying unchanged will not fix it

Requests and parameters

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
invalid_requestinvalid_request_error400NoJSON, Content-Type, or framework parsing failedCheck the JSON, Content-Type, field types, and required fields
invalid_request_errorinvalid_request_error400 or 422NoThe upstream rejected a parameter or field combinationCheck the parameters and content types supported by the target model
missing_modelinvalid_request_error, no distinct value400NoThe request body has no model or the model value is emptyUse a Product ID shown on the Models page
context_length_exceededinvalid_request_error, no distinct value400NoInput plus expected output exceeds the model context windowShorten conversation history, attachments, or maximum output tokens, or select a model with a larger context window
conversion_errorNot applicable400NoA Chat Completions request cannot be converted into the target Responses requestSimplify the input and remove unsupported Responses fields or content types
request_too_largerequest_too_large413NoThe complete HTTP request body exceeds the service limitReduce text, image, or file size; do not embed large files directly in the request
method_not_allowedinvalid_request_error405NoThe route exists but the HTTP method is wrongUse the documented GET, POST, or DELETE method
not_foundnot_found_error404NoThe API route or requested general resource does not existCheck the Base URL, versioned path, and resource ID

Upstream parameter failures are replaced with a safe, normalized message. Clients should not depend on an individual provider's original error text.

Models and routing

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
invalid_modelinvalid_request_error, no distinct value400NoThe model identifier is empty or malformedCopy the Product ID from Models; do not use an upstream model fullname
model_not_foundnot_found_error404NoThe Product cannot be foundCheck the spelling and confirm that the model is still shown on Models
model_not_supportedinvalid_request_error, no distinct value400NoThe Product does not support the selected protocol or feature, such as images, audio, Batch, or ResponsesSelect a model that supports the operation, or use an API supported by the model
service_unavailableoverloaded_errorOpenAI 503 / Anthropic 529YesThe Product exists but has no currently available matching model or capacityRetry with backoff or select another available model from Models

Appearing in the model catalog means a model can be discovered, but does not guarantee current inference capacity. Inference also requires an available Product and a matching online model.

Rate limits

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
rate_limit_exceededrate_limit_error429YesA client IP, API key, platform, or upstream request limit was reachedHonor Retry-After when present, use exponential backoff, and reduce concurrency
rate_limitedrate_limit_error429YesEvery candidate upstream for the model is currently rate limitedRetry with backoff or change models; do not immediately replay the request concurrently

A reasonable backoff can start around 1s, double between attempts, and add random jitter. Always set a maximum attempt count and overall deadline.

Upstream services

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
upstream_configuration_errorapi_errorOpenAI 502 / Anthropic 500NoThe upstream rejected its credential, the model mapping is wrong, or the platform upstream configuration is invalidContact platform support; repeatedly changing your own API key will not help
upstream_unavailableapi_error502YesThe upstream connection failed or the service is temporarily unavailableRetry with backoff, change models if necessary, and contact support if it persists
upstream_timeoutapi_error504YesThe upstream did not respond before the timeoutRetry with backoff; for long inputs, consider shortening the context or expected output
Not applicableoverloaded_error529YesAn Anthropic-compatible upstream is overloadedRetry with backoff or select another model

LLMPool may try multiple upstream candidates. The final error is selected by failure class, so do not infer which provider was used from the message text.

Internal service errors

OpenAI error.codeAnthropic error.typeHTTPAuto retryCauseResolution
internal_errorapi_error500LimitedA database, mapping, decryption, or other internal operation failed; Anthropic api_error can also be an upstream configuration problemRetry a limited number of times after a delay, then stop and contact support
file_service_errorNot applicable500LimitedInternal image or attachment processing failedVerify the attachment format and size, retry, and contact support if it persists
response_conversion_errorNot applicable500LimitedA Chat Completions upstream response could not be converted into a Responses objectRetry a limited number of times or change models, then contact support if it persists

Internal errors intentionally hide implementation details. Clients should not expect database, upstream address, or configuration information in the message.

Interrupted streams

After a stream starts, the HTTP status may remain 200 even when a later stream_error or Anthropic event: error is received.

Recommended handling:

  1. End the current stream immediately and do not treat partial output as complete.
  2. Record the structured error and local request time without logging the complete API key or sensitive request body.
  3. Submit a new request with backoff only after confirming that retry is safe.
  4. Change models and contact support if interruptions continue.

See Error Responses for the streaming event structures.

Common scenarios

Every request returns 401

  • Confirm that the request is sent to the LLMPool OpenAI or Anthropic Base URL, not the Dashboard URL.
  • Do not use an Admin Token or Tenant Access Token as an AI API key.
  • Copy the key again and check whitespace and header syntax.
  • Check whether the key is expired or disabled in the Dashboard.

The model returns 404

  • Copy the model name from Models.
  • Use a Product ID, not an internal provider model fullname.
  • Confirm that the protocol and operation match the model capabilities.

Requests frequently return 429

  • Reduce concurrency and requests per second.
  • Coordinate retries across application instances instead of retrying immediately from every instance.
  • Honor Retry-After and add random jitter.
  • Select another available model when only one model remains limited.

Requests frequently return 5xx or 529

  • First use a limited number of backoff retries and try another model.
  • Record the time, protocol, path, HTTP status, structured error type/code, and model Product ID.
  • Contact support when the issue persists or affects multiple models.

Contacting support

Provide:

  • Time of occurrence and time zone
  • OpenAI or Anthropic protocol
  • Request path and HTTP method
  • HTTP status, error.type, and error.code when present
  • Model Product ID
  • Whether the request was streaming and whether the issue is reproducible
  • Request identifiers from response headers when present

Do not provide complete API keys, request bodies, GraphQL documents or variables, file contents, or full URLs containing query parameters.