websearch.fast
КонсольПолучить ключ

Ошибки

Основные пути отдают ошибки в одном формате. Это объект ошибки из API моделей, поэтому обработка ошибок в OpenAI SDK продолжает работать. К нему добавлен request_id на верхнем уровне.

{
  "error": {
    "code": "fetch_failed",
    "message": "The page could not be read. (request id: 20261128120008123456789a1b2c3d4Kx7Qm2Ph)",
    "type": "invalid_request_error",
    "param": "url"
  },
  "request_id": "20261128120008123456789a1b2c3d4Kx7Qm2Ph"
}
ПолеОписание
error.codeПостоянный код для программ. Сначала смотрите на HTTP-статус, затем на этот код.
error.messageТекст для людей. Он на английском, заканчивается идентификатором запроса и может меняться.
error.typeinvalid_request_error (большинство 4xx), authentication_error (401), permission_error (403), rate_limit_error (429), server_error (5xx).
error.paramПоле, заголовок или параметр строки запроса, в котором ошибка, с полным путём, если он есть.
error.detailНеобязательные подробности к коду, например retry_after_seconds и limit для лимита частоты.
request_idСовпадает с заголовком X-Request-Id.

Совместимые пути добавляют на верхний уровень message и statusCode. MCP-сервер возвращает ошибки инструментов как результаты инструментов с isError: true и тем же code.

Коды

Ни одна ошибка не оплачивается. Таблица ниже дана только на английском.

StatusCodeWhen
400invalid_requestA field, header or query parameter is missing, malformed, out of range, or conflicts with another; a duplicate JSON key; an unknown field on a native path. param names it.
400invalid_urlA URL is not http(s), is malformed, points to a private, loopback or reserved address, or to a non-standard port.
400invalid_schemaA JSON Schema of extract breaks its rules. param is the JSON pointer.
400invalid_imagelens could not load or decode the image, or it is too large.
401invalid_tokenThe key is missing, unknown, disabled, expired or exhausted. Message Invalid token.
402insufficient_user_quotaThe balance does not cover the maximum price of the call, or the max_cost_usd of a job.
403pre_consume_token_quota_failedThe spending limit of the key is used up.
403access_deniedThe key has an IP allowlist and the caller is not on it.
403web_not_allowedThe key may not use the Web API (a key restriction set by the account).
404not_foundUnknown or expired job, place_id or page_token.
404invalid_endpointUnknown path under /v1/web.
405method_not_allowedWrong method on a known path.
409idempotency_conflictIdempotency-Key reused with a different request.
409request_in_progressA create with this Idempotency-Key is still running. Has Retry-After.
413read_request_body_failedThe request body is over the size limit; the message states the limit.
415unsupported_contentThe page or file is of a type that is not read: video, archive, executable or unknown binary.
422fetch_failedThe page could not be read: DNS failure, connection refused, TLS failure, the site answered 4xx or 5xx, an empty body, or more than 10 redirects.
422site_refusedThe robots.txt of the site does not allow automated agents to read this URL, or the site declined the request.
422page_too_largeThe page or file is larger than the read limit and could not be read even in part.
422extraction_failedextract could not produce data that validates, or a required value is not in the pages.
429rate_limitedThe key or account is over its rate limit. Has Retry-After and the X-RateLimit-* headers.
429concurrency_limitedToo many calls or jobs of this key at the same time. Has Retry-After: 1.
429api_key_temporarily_frozenThe key is paused for a while after too many invalid requests. Has Retry-After.
500internal_errorSomething failed on our side. Retry; with Idempotency-Key a create retry is safe.
501api_not_implementedThe endpoint, type, option or compatibility path has not shipped yet.
503source_unavailableNo source could answer in time. Has Retry-After.
503web_api_disabledThe Web API or this endpoint is switched off for the moment, or no price is set for it.
503billing_busyThe charge could not be prepared for a moment. Has Retry-After: 1.
503token_cache_busyThe key check is busy for a moment. Has Retry-After: 1.
504timeoutNothing complete before the deadline of the call (timeout_ms or the endpoint maximum).

Предупреждения

Предупреждения не считаются ошибками. В ответе 200 может быть поле warnings, список объектов с полем code.

CodeWhen
no_resultsThe call ran and found nothing. Not charged.
content_partialFewer content pages were read than asked. Only the pages delivered are charged.
partialSome parts of the call could not be delivered. Only the delivered parts are charged.
all_failedNo part of the call could be delivered. Nothing is charged.
reach_reducedThe call ran without the extra attempts for pages and searches that are hard to reach.

reach_reduced появляется, когда последние вызовы аккаунта потребовали больше работы, чем за них списано, например после многих страниц, которые не удалось прочитать. На такой вызов приходит обычный ответ, но труднодоступные страницы и поиски мы в нём не пробуем вторым, более дорогим способом. Полный охват возвращается с каждым платным вызовом и сам восстанавливается в течение суток. Текущее состояние видно в key.reach ответа GET /v1/web/status с вашим ключом.

Сбои задач (research, crawl, асинхронный batch) приходят в поле error задачи с теми же кодами, к которым добавляются budget_exhausted и job_expired. Задача, которой не хватило бюджета, завершается со статусом succeeded и stop_reason: "budget".

Когда повторять

ОтветПовторять
429Да, после Retry-After.
500, 503, 504Да, с экспоненциально растущей паузой, случайным разбросом и ограничением числа попыток. При 504 может помочь больший timeout_ms или меньшее content.pages.
409 request_in_progressДа, после Retry-After, с тем же Idempotency-Key и тем же телом.
422 fetch_failedВозможно, позже. Сам сайт иногда какое-то время не отвечает.
422 site_refusedНет. Повтор вернёт тот же результат.
Остальные 4xxНет. Сначала исправьте запрос.