The Desearch JavaScript SDK wraps common Desearch API calls for Node.js and server-side JavaScript applications.
Do not expose production API keys in browser bundles. Call Desearch from your backend or server-side runtime.
Billable API responses expose request cost in USD through X-Desearch-Cost-Usd. Compatible JSON object responses may also include:
If your SDK call returns only parsed JSON, use the SDK's raw-response or metadata option when you need headers. Arrays, text responses, and streaming responses keep their body shape, so headers are the source of truth for cost metadata.
401 — check the API key and server environment variable.422 — check request body fields, enum values, and endpoint-specific required fields.429 — add backoff/retry or review account limits.For all endpoint schemas, use the API Reference.