Search API
Errors, limits, and billing
Handle API failures, request limits, retries, and completed-request billing.
Error responses
API failures use a stable JSON error body. Branch on the HTTP status and machine-readable reason, not the human-readable message. Include X-Request-ID when contacting support.
400— inspectvalidationwhen present, correct every listed request field, then retry.401— provide a valid, active API key.402— review billing and spend limits before retrying.403— use a key with Search API permission.429— wait forRetry-After, then retry with backoff. Inspectreasonto distinguish an account policy (rate_limit_exceeded) from provider throttling (model_provider_rate_limited).503withmodel_provider_overloaded— the selected model provider has no temporary capacity. HonorRetry-Afterwhen present, or select another allowed model whenrecovery.can_change_modelis true.- Other
502or503responses — retry temporary service failures with capped backoff and jitter.
Validation errors
A 400 response may include validation, the same bounded report returned by MCP at
structuredContent.error.validation:
{
"code": "invalid_request",
"reason": "malformed_request",
"message": "invalid request: request body violates the public contract",
"recovery": null,
"agent_session_id": null,
"validation": {
"contract": "SearchPostRequest",
"issues": [
{
"code": "required",
"path": "/query",
"suggestion": "Add the required `query` field."
}
],
"truncated": false
}
} contract names the published request schema. Each issue has a stable code, an RFC 6901
path, and a suggestion. When allowed_values is present, use one of those exact JSON scalar
values. A root error uses an empty path.
Correct every listed issue before retrying. If truncated is true, validate the corrected
request again because the report omitted additional issues. Do not retry an unchanged rejected
request. Stop if the same output fails again, and use a small fixed repair ceiling for each
request. Validation errors are not transient, so backoff does not repair them.
Result and request limits
limit accepts 1 through 50 results. The API has no pagination. Changing the limit can change ranking, so do not combine separate calls as pages of one result set.
Rate limits are enforced by the active account and key policy. The API returns 429 and Retry-After when a request should wait; this documentation does not publish a fixed numeric rate that could differ from the configured policy.
Provider throttling and overload use the same reason and recovery fields as product rate limits. recovery.kind is retry, retry_after_ms preserves the provider hint, and recovery.can_change_model tells an agent client whether selecting another allowed model is a valid recovery. Direct HTTP failures carry Retry-After as the RFC 9110 retry header in whole seconds. Responses with 429 are emitted with Cache-Control: no-store, preserving the RFC 6585 caching requirement.
Every agent execution mints an agent_session_id before calling the model provider. A synchronous REST failure returns it in the error body; MCP returns the same structured error; and a background run keeps it in the accepted response and every polled status. A failed background status remains a successful status lookup (200) whose error contains the same provider reason and recovery. The session id is useful for status and support correlation, but it is not a credential.
Billing
Balanced costs $4 per 1,000 completed requests. A failed search execution is not charged. Account spend limits can reject a request with 402 before execution.
The documentation console sends real API requests. Normal billing, spend limits, and rate limits apply.
Recovery checklist
- Record the HTTP status,
X-Request-ID, andagent_session_idwhen present. - Read the stable error
reason. - Correct non-retryable failures before sending another request.
- Honor
Retry-Afterand use jitter for retryable failures.
Return to the HTTP integration guide or inspect the generated API reference.