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.

bash
export ZDR_API_KEY=duck-...

Chat completions#

bash
curl -sSf https://api.zdr.sh/v1/chat/completions \  -H "Authorization: Bearer $ZDR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Reply with the single word: ready."}]}'

-N turns off buffering, so events appear as they arrive. Chat completions lists every parameter.

Anthropic messages#

bash
curl -sSf https://api.zdr.sh/v1/messages \  -H "x-api-key: $ZDR_API_KEY" \  -H "anthropic-version: 2023-06-01" \  -H "Content-Type: application/json" \  -d '{"model": "glm-5.3", "max_tokens": 128, "messages": [{"role": "user", "content": "Reply with the single word: ready."}]}'

The count answers {"input_tokens": N} and is never billed. Messages has the details.

Responses#

bash
curl -sSf https://api.zdr.sh/v1/responses \  -H "Authorization: Bearer $ZDR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model": "deepseek-v4.1-flash", "input": "Reply with the single word: ready."}'
bash
curl -sSf https://api.zdr.sh/v1/models \  -H "Authorization: Bearer $ZDR_API_KEY"

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.