Docs menu: Errors and billing

Errors and billing

Errors use standard HTTP status codes and a JSON body with a stable code. Failed requests are not charged.

Error format

402 Payment Required
{
  "detail": "credit too low; add credit to continue",
  "error": {
    "code": "credit_too_low",
    "message": "credit too low; add credit to continue",
    "requestId": "8f2c…"
  }
}

Branch on error.code, not the message. Every response has an x-request-id header; include it when contacting support. You can send your own X-Request-ID (letters, digits, ., _, -, up to 80 characters).

Common codes

StatusCodeMeaningWhat to do
400validation_errorA parameter has the wrong format.Fix the request.
400limit_removedlimit was sent to a live route.Remove it and paginate with cursor.
401unauthorizedMissing or invalid API key.Check the Authorization header.
402credit_too_lowBalance cannot cover one page.Add credit.
402queued_balance_too_lowJobs need $1 of available balance.Add credit.
404user_not_found, tweet_not_found, community_not_found, job_not_foundThe requested item does not exist or is not public.Do not retry.
429overloaded, capacity_limited, rate_limitedThe service or upstream capacity is busy.Retry after Retry-After seconds, or with backoff.
502upstream_transport, malformed_upstreamX returned an unusable response.Retry with backoff.
503account_unavailable, retry_exhaustedNo upstream session could complete the request.Retry later.
504upstream_timeoutX did not answer in time.Retry with backoff.

Retries

Retry 429 and 5xx with exponential backoff and a cap on attempts. Fix the request before retrying 400, 401, 402 or 404. A successful retry is charged once.

How credit is charged

  • A request needs at least $0.001 of balance, and enough to cover the largest possible page for that route.
  • That maximum is reserved when the request starts. When the page arrives you pay for the records it contains and the rest is returned.
  • A request that fails is refunded in full.
  • Single lookups (profile, account information, post, community) cost $0.001 each.
  • Collections are priced per record; see pricing. The response level does not change the price.