For the complete documentation index, see llms.txt. This page is also available as Markdown.

Errors and retries

Every error returns the same envelope. Branch on error.code, never on message — messages change, codes are part of the compatibility contract.

json
{ "error": { "type": "invalid_request_error", "code": "parameter_missing", "message": "Missing required parameter: query.", "param": "query", "doc_url": "https://docs.scispace.com/api-reference/searches", "request_id": "req_2f9a7c41d0" } }

Error types

error.type is an exhaustive enum.

HTTPtypeRetry?Meaning
400invalid_request_errornoMalformed, missing, or out-of-range parameters
401authentication_errornoMissing, malformed, or revoked key
402insufficient_credits_errornoBalance or per-key cap exhausted
403permission_errornoKey lacks the required scope, or content is not licensed to you
404not_found_errornoUnknown, expired, or deleted resource
409conflict_errornoResource is in the wrong state for this call
413payload_too_large_errornoInput or source count over the cap
422unprocessable_errornoWell-formed but unusable — unparseable PDF, unsupported language
429rate_limit_erroryes, after Retry-AfterToo many requests
500api_erroryes, with backoffOur fault
503service_unavailable_erroryes, with backoffTemporary capacity

Common codes

codeTypeWhere
parameter_missing, parameter_invalid, parameter_unknown400everywhere
query_too_long400searches — 1,000 character cap
no_sources400chats, extractions
schema_invalid400extractions
csl_invalid400citations
unsupported_file_type, file_too_large400files
insufficient_credits402any metered call
scope_missing403any
full_text_not_licensed403papers
paper_not_found, resource_expired404papers, async resources after 90 days
document_not_ready409chats, extractions
search_not_cancelable409searches
too_many_sources413chats (50), extractions (500)
text_too_long413paraphrases (5,000 words), ai-detections (15,000 words)
document_unparseable422documents
language_unsupported422any language parameter — see chats
rate_limit_exceeded429any

Retry strategy

Retry only 429, 500, and 503.

Text
attempt 1 → wait 1s ± jitter attempt 2 → wait 2s ± jitter attempt 3 → wait 4s ± jitter attempt 4 → wait 8s ± jitter attempt 5 → give up, surface the request_id

On 429, honour Retry-After instead of your own schedule. Always send Idempotency-Key so a retry cannot be charged twice — a replay within 24 hours returns the original response.

Failed jobs are not transport errors

An async resource that reaches status: "failed" returns 200 with an error object on the resource. Read it and fix the input; retrying an identical failed job costs credits and fails again.

Getting help

Every response carries X-Request-Id. Quote it — see get-support.

conventions · rate-limits · job · troubleshooting

Last updated