cURL
Everything zdr.sh serves can be reached with one binary and one environment variable. Each block below is runnable as it stands, with ZDR_API_KEY set.
Chat completions#
-N turns off buffering, so events appear as they arrive. Chat completions lists every parameter.
Anthropic messages#
The count answers {"input_tokens": N} and is never billed. Messages has the details.
Responses#
Models, usage and search#
A search is billed per answered query. A browse is free. Web search and Web browse have the shapes.
Reading the headers#
Add -D - to print the response headers, or -i for headers and body together. x-request-id is on every response, x-token-cost on a request the balance paid for (as a trailer on a stream, which curl prints after the body with -D -), x-ratelimit-* when the key has limits, and x-token-cache and x-token-notice when they apply. retry-after appears on a 429 or 503. Errors lists what each status means.