Bearer token, so any HTTP client works — curl, fetch, requests, or your language’s standard library.
The clients below are unofficial, community examples. They’re pinned to the public wire contract (POST /v1/search → poll GET /v1/jobs/:id → read each child Envelope) and are meant to be copied into your project and adapted. Nothing here needs a dependency beyond your language’s standard HTTP tooling.
Set your key once in the environment:
What these clients do
Both clients follow the same shape:Submit
POST /v1/search with a query and one or more surfaces. This returns 202 with a parent job id and a children[] list — one child per surface × region.Poll to terminal
GET /v1/jobs/:parentId until the parent reaches a terminal state (completed, partial, failed, canceled, or expired). On 429, back off using Retry-After.Read each child
For every child,
GET /v1/jobs/:childId to fetch the canonical Envelope — answer, evidence, and provenance for that one surface.Clients
A child id is dotted — for example
job_8t2q.chatgpt.us — while a parent id has no dots (job_8t2q). The clients above never construct child ids by hand; they use the ids the parent job hands back in children[].Handling empty surfaces
A child can complete with no answer. When a surface returns nothing, that child is stillcompleted with provenance.surfacePresent: false, a surface_absent warning, and an empty answer. Treat it as a normal terminal result, not an error:
Sync shortcut
If you only need one surface and want the Envelope inline, skip polling entirely. Add?mode=sync (or send the header Prefer: wait) and the request returns 200 with the full Envelope in the response body instead of a 202 parent job:
POST /v1/search/:surface (e.g. /v1/search/chatgpt) is sync-by-default for a single surface and accepts prompt (an alias of query) plus a flat country:
cURL
Next steps
The Envelope
Every field these clients read back, section by section.
Webhooks
Skip polling for fan-out: get each child Envelope pushed to you on terminal state.
Errors
Every error code, including the 429s the clients back off on.
Search endpoint
Full request body,
mode=sync, and idempotency.