Skip to main content
Menu
Tools / SDKs
Tools

SDKs

Which libraries to use with Panward, and how to read Panward's headers and keep the raw bytes with them.

4 minute readUpdated 15 November 2026curl · Python · TypeScript

Use the OpenAI SDK you already have#

Any OpenAI SDK works with Panward when you change two settings: the base URL becomes https://api.panward.ai/v1 (or a regional host) and the key becomes your Panward key. The samples on these pages use the official Python and Node SDKs.

$ pip install openai

The compatibility page lists what differs from OpenAI.

Read Panward's headers#

Panward adds nothing to the response body. What it tells you about a request is in the response headers, so ask the SDK for the raw response: with_raw_response in Python, .withResponse() or .asResponse() in Node.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.panward.ai/v1",
    api_key=os.environ["PANWARD_API_KEY"],
)

raw = client.chat.completions.with_raw_response.create(
    model="z-ai/glm-5.3",
    messages=[{"role": "user", "content": "Hello"}],
)
for name in ("panward-request-id", "panward-receipt-id", "panward-tier", "panward-region", "panward-model"):
    print(name, raw.headers.get(name))

request_bytes = raw.http_response.request.content  # hashed in request.received
response_bytes = raw.http_response.content  # hashed in response.emitted
reply = raw.parse()
HeaderWhat it holds
panward-request-idThe request id. Quote it to support.
panward-receipt-idThe id of the request's receipt, streamed or not.
panward-tiersealed or routed: the tier that served the request.
panward-regionThe code of the region that served the request.
panward-modelThe model that answered.

Step 4 of verification compares the hashes of the exact request and response bytes with the receipt. Keep the raw bytes when you need that step: a parsed and re-serialised body does not match (Verification guide).

Panward SDKs#

Not available yet
The packages panward (Python) and @panward/sdk (JavaScript) are not published. Everything on these pages works with the OpenAI SDKs and plain HTTP. What is not available yet.

Verifier packages#

Verification does not depend on an SDK. warden is the open-source verifier of receipts and attestations, with a command line, a JavaScript front end (@panward/warden) and a Python front end (panward-warden) over one Rust core.

Not available yet
Build the warden command line from the gateway repository (Warden command line). What is not available yet.

Configuration#

  • Read the key from the PANWARD_API_KEY environment variable or your secret manager. Never put it in source control, a browser or a mobile app.
  • Use a regional host (https://api.eu.panward.ai/v1) when your organization pins regions (Regions and residency).
  • Set the client's timeout for your longest request, and stream long answers (Timeouts).
  • Retry only what the limits page says can be retried, with back-off, and wait at least Retry-After when it is sent.

Other languages#

Any HTTP client works. Send Authorization: Bearer with your key and Content-Type: application/json, and optionally panward-tier, panward-fallback, panward-hold-until-verified and X-Request-Id (Request headers). Write the body to a file and send that file, so the bytes you keep are the bytes that were sent.

Plain HTTP: the headers to send, the bytes to keep, the headers to read
cat > request.json <<'EOF'
{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Summarise this discharge note."}]}
EOF

curl https://api.eu.panward.ai/v1/chat/completions \
  -D headers.txt -o response.bin \
  -H "Authorization: Bearer $PANWARD_API_KEY" \
  -H "Content-Type: application/json" \
  -H "panward-tier: sealed" \
  -H "X-Request-Id: order-4711" \
  --data-binary @request.json

grep -i '^panward-' headers.txt

Versions#

The API is versioned in its path (/v1) and changes additively. Warden and the receipt and attestation formats are versioned too (Versioning and notice).

Was this page helpful?Suggest an edit