error.code, and error.message to decide whether to fix the request or retry it.
Quick triage
For an image request that returned a task ID, retrieve the existing task after a timeout. Repeating a creation request can generate another image and incur another charge. If you have no task ID, keep the request ID and timestamp for support before submitting it again.
Error envelope
Many RunBridge AI failures use an error body like this:code empty. When the status is 500, treat error.code and error.message as the deciding signal.
400 Bad Request
A 400 usually means the request body failed validation before the request could be processed normally.
Common causes:
- Missing required fields such as
model - Invalid JSON shape
- Sending a field with the wrong type
- Reusing model-specific parameters that the selected endpoint does not accept
your-model-id with any current model ID from the RunBridge AI Models page.
Do not assume every malformed chat request returns 400. Missing required chat fields such as messages can also surface as 500 with error.code: invalid_request.
500 Internal Server Error
Most 500 responses indicate a service failure. For Chat Completions, some malformed requests can also surface as 500 while still carrying error.code: invalid_request.
One example is a request that omits messages:
500 response has error.code: invalid_request, treat it as a request problem:
- Fix the request body.
- Compare the payload against the endpoint schema.
- Retry only after correcting the payload.
500 response does not point to an invalid request, keep the request id and use backoff.
401 Invalid Token
A token failure usually looks like this:
- For OpenAI-compatible requests, use
Authorization: Bearer $RUNBRIDGE_API_KEY. For Anthropic Messages or Gemini, follow the authentication headers in the matching API reference. - Make sure your app is not loading an old key from
.env, shell history, or a deployed secret store. - If one key fails and another key works on the same request, treat this as a token issue, not an endpoint issue.
403 Forbidden
403 is most often one of these situations:
- The request is blocked by a platform-side rule such as WAF filtering
- The token or route is not allowed to use the requested model or request shape
- The chosen model rejects one of the advanced parameters you passed
- Retry with a very simple text request against a known-good model.
- Remove advanced and model-specific fields, then add them back gradually.
- If the response includes a request id, keep it before contacting support.
Wrong base URL or wrong path
On RunBridge AI, a path mistake may surface as:- A redirect
- A non-JSON HTML response if your client follows redirects
- A parsing error inside your SDK
- A request that never reaches the API layer cleanly
Recommended checks:
- Confirm the base URL matches the SDK configuration in the API reference.
- Confirm the complete request URL matches the documented operation path.
- Disable automatic redirect following while debugging path problems.
413 Request Entity Too Large
If you see 413, treat it as a request size problem first. Common suspects are:
- Large base64 payloads
- Oversized image, audio, or video inputs embedded in a multimodal LLM request
- Very large multipart or JSON bodies
- Reduce or compress attached content.
- Split large jobs into smaller requests.
- Do not assume plain text length is the only cause.
429 Too Many Requests
Treat 429 as retryable:
- Use exponential backoff with jitter.
- Reduce burst concurrency.
- Keep request logging on so you can see which route and model are saturating first.
503, 504, and 524
These statuses are server-side or timeout-class failures.
Practical guidance:
503: service temporarily unavailable504and524: a request timed out
- Retry with backoff.
- Keep the
request id, endpoint, model, and timestamp. - If the same failure repeats across multiple retries, contact support with that context.
Before you contact support
Capture these details first:- HTTP method
- Endpoint path
- Model ID
- Sanitized request body JSON
- Query parameters if the failing request used them
- Exact response body if your client captured it
- Full HTTP status
- The exact
error.message - Any
request id - Approximate timestamp
- Whether the same request works with another model or another token
- Field names and text values you sent alongside the file
- File name, file type, and approximate file size
- Whether the file was uploaded directly, referenced by URL, or embedded as base64