Skip to content

Docs / troubleshooting

BrokenGPT API errors and troubleshooting

Diagnose BrokenGPT API authentication, validation, context, rate-limit, quota, streaming, and temporary service errors with safe retry guidance.

UPDATED 01 Aug 20268 MIN READTECHNICAL GUIDE
01

Read the status, error code, and request ID together.

BrokenGPT returns typed JSON errors for public API failures and includes a request identifier where the route can provide one. Preserve that identifier in your logs and support report, but never include the bearer credential.

The HTTP status tells you the broad class. The error code provides the more specific cause. The message can help a person, but production control flow should not depend on exact prose.

ERROR ENVELOPE

{"error":{"message":"Invalid API key","type":"authentication_error","code":"invalid_api_key","param":null}}
02

Map each status class to one bounded action.

BrokenGPT API troubleshooting matrix
StatusTypical causeClient action
400Invalid JSON, field, context, or unsupported combinationFix the request; do not retry unchanged
401Missing or invalid API keyReplace the credential
403Key lacks the required scopeUse or create a correctly scoped key
404Unknown public model aliasUse broken-one from current docs
409Idempotency key reused with a different bodyUse a new key or the original body
413Request body exceeds the route limitReduce or split the payload
429Rate, key limit, budget, or credit exhaustionInspect the code; back off only when time can resolve it
500-503Temporary service or accounting failureRetry with jitter and a hard attempt limit
03

Treat context errors as a sizing problem, not an outage.

The input plus an explicit output cap must fit inside the advertised context window. A large character count is not an exact token count, and tools or structured schemas also contribute to serialized input.

  • Remove duplicated instructions and irrelevant history.
  • Summarize or retrieve only the passages needed for the current turn.
  • Lower the requested output cap when it is explicit.
  • Use the token-count route for planning, then keep a margin for serialization differences.
04

Streaming failures need state-aware handling.

  • Do not blindly replay a request after displaying partial output; a retry can duplicate user-visible work.
  • Treat the terminal [DONE] marker and finish reason as completion signals.
  • If the caller disconnects, cancel upstream work when your runtime supports it.
  • For structured JSON, use a non-streamed request because validation happens before delivery.

STRAIGHT ANSWERS

Frequently asked questions

01Should I retry every 429 response?

No. A short-term request-rate limit may clear with backoff, but exhausted credits, a hard budget, or a per-key spend limit requires configuration or funding changes.

02What should I send to support?

Send the request ID, timestamp, endpoint, status, and error code. Do not send the API key or sensitive prompt content.

03Can structured JSON stream?

No. Structured JSON is validated before delivery and the current route rejects combining it with streaming.

BUILD WITH THE LIVE CONTRACT

Test one real request end to end.

Create a scoped key, send a representative prompt, and verify output, usage, limits, and error handling before expanding the integration.

Create an account