Markdown
All docs

Errors and charges

Look up any error code for its cause and what to do. An error means nothing was charged, with one exception: settlement_unknown means it is not known yet whether you were charged.

What an error looks like

A failed request has a non-2xx HTTP status and an error code in code. Branch on code, never on the wording of message.

{
  "code": "insufficient_balance",
  "request_id": "…",
  "message": "The balance is too low",
  "message_zh": "余额不足",
  "charged": false,
  "retry": "after_fix",
  "retry_after_seconds": null,
  "param": null,
  "docs_url": "https://www.askcrawl.com/docs/errors#insufficient_balance",
  "required": "0.015",
  "available": "0.05",
  "top_up_url": "https://www.askcrawl.com/console/billing"
}
FieldTypeDescription
codestringThe error code. Branch on this, not on message
request_idstringThe request ID. Include it when you contact us
messagestringExplanation in English
message_zhstringExplanation in Chinese
chargedboolean | nullfalse: nothing was charged. null: not known yet, so ask again with the same Idempotency-Key
retry"no" | "yes" | "once" | "after_fix" | "same_key"Whether to retry. no: do not. yes: later. once: one more time at most. after_fix: after changing the request. same_key: only with the same Idempotency-Key
retry_after_secondsinteger | nullHow many seconds to wait before retrying, or null
paramstring | nullThe parameter or header at fault, or null
docs_urlstring | nullLink to the explanation of this error
problemsstring[]What exactly is wrong with the parameters. Present only when there is something to list
reasonstringA more specific reason. Present only sometimes
requiredstringHow many US dollars the request needs. Present when the balance or your limit does not cover it
availablestringHow many US dollars are available now. Present when the balance is too low
top_up_urlstringWhere to top up. Present when the balance is too low or trial credit cannot be used
next_stepstringWhat to do next, in English. Present only sometimes
next_step_zhstringWhat to do next, in Chinese. Present only sometimes

Include the request_id when you contact us, so we can find the request quickly.

Were you charged

  • charged is false: the request cost nothing, and anything held for it has been released.
  • charged is null: not known yet. Only settlement_unknown does this. Send the request again with the same Idempotency-Key, never a new one. See Idempotency.

In a collection job, one answer failing does not fail the request. That answer's status is failed and it is not charged, while the others settle as usual. Answered, no-answer and refused results are charged; see Billing, holds and settlement.

Should you retry

The retry field tells you what to do, and the codes below are grouped the same way.

  • When retry_after_seconds is set, wait that long first. The Retry-After response header carries the same number.
  • When retrying a request that can be charged, send the same Idempotency-Key as the first time.
  • Free requests, such as checking progress or reading answers, can simply be retried.

Send again only with the same Idempotency-Key

call_in_progressHTTP 409Not charged

The call under this Idempotency-Key is still running; ask again with the same key shortly. Send it again with the same Idempotency-Key, not a new one.

settlement_unknownHTTP 500Billing status unknown

Whether this was charged is not known yet; ask again with the same Idempotency-Key. Send it again with the same Idempotency-Key, not a new one.

Fix the request, then send it again

invalid_paramsHTTP 400Not charged

A parameter is invalid. Fix it and send it again; the same request will fail the same way.

parameter_not_supportedHTTP 400Not charged

This engine does not support that parameter. Fix it and send it again; the same request will fail the same way.

engine_unavailableHTTP 400Not charged

This engine is not available now. Fix it and send it again; the same request will fail the same way.

max_price_exceededHTTP 400Not charged

The most this could cost is above the limit you set. Fix it and send it again; the same request will fail the same way.

cursor_mismatchHTTP 400Not charged

The cursor was issued for another endpoint or other parameters. Fix it and send it again; the same request will fail the same way.

insufficient_balanceHTTP 402Not charged

The balance is too low. Fix it and send it again; the same request will fail the same way.

key_budget_exceededHTTP 402Not charged

This key's spending limit does not cover it. Fix it and send it again; the same request will fail the same way.

trial_not_availableHTTP 403Not charged

Trial credit cannot be used with this engine; it is available after a top-up. Fix it and send it again; the same request will fail the same way.

idempotency_conflictHTTP 409Not charged

This Idempotency-Key was used for a different request. Fix it and send it again; the same request will fail the same way.

report_too_largeHTTP 400Not charged

Too many answers for one report; use fewer jobs, or filter by engine or prompt. Fix it and send it again; the same request will fail the same way.

Retry later

rate_limitedHTTP 429Not charged

Too many requests, or too many calls in progress. You can retry later. When the response has retry_after_seconds, wait that long.

job_limit_exceededHTTP 429Not charged

Too many unfinished answers, or too much held; submit again when some have finished. You can retry later. When the response has retry_after_seconds, wait that long.

cost_cap_exceededHTTP 429Not charged

This account's allowance for today is used up. You can retry later. When the response has retry_after_seconds, wait that long.

uncharged_cost_limitHTTP 429Not charged

Too many of this account's requests today returned nothing and were not charged; try again tomorrow (UTC). You can retry later. When the response has retry_after_seconds, wait that long.

internal_errorHTTP 500Not charged

The service failed. You can retry later. When the response has retry_after_seconds, wait that long.

upstream_failedHTTP 502Not charged

No result came back this time and nothing was charged; retry shortly. You can retry later. When the response has retry_after_seconds, wait that long.

cursor_unavailableHTTP 502Not charged

This cursor is unavailable now; retry later or start again from the first page. You can retry later. When the response has retry_after_seconds, wait that long.

upstream_busyHTTP 503Not charged

Busy now; retry shortly. You can retry later. When the response has retry_after_seconds, wait that long.

capability_pausedHTTP 503Not charged

This endpoint is paused. You can retry later. When the response has retry_after_seconds, wait that long.

overloadedHTTP 503Not charged

The service is busy; retry shortly. You can retry later. When the response has retry_after_seconds, wait that long.

timeoutHTTP 504Not charged

The data did not arrive in time; nothing was charged. You can retry later. When the response has retry_after_seconds, wait that long.

Retrying will not help

cursor_invalidHTTP 400Not charged

The cursor does not exist. Retrying will not help.

unauthorizedHTTP 401Not charged

No credential was sent, or it is invalid, disabled or expired. Retrying will not help.

account_suspendedHTTP 403Not charged

The account is suspended. Retrying will not help.

forbiddenHTTP 403Not charged

Not allowed. Retrying will not help.

key_scope_deniedHTTP 403Not charged

This key may not use that endpoint or engine. Retrying will not help.

not_foundHTTP 404Not charged

It does not exist, is private or was deleted. Retrying will not help.

unknown_endpointHTTP 404Not charged

There is no such endpoint. Retrying will not help.

cursor_expiredHTTP 410Not charged

The cursor expired; start again from the first page. Retrying will not help.

result_expiredHTTP 410Not charged

The saved result has expired and was deleted. Retrying will not help.