Quickstart
First request in under ten minutes with the OpenAI SDK.
Change the base URL
Built, not launched. Install the official openai package for Node or Python, point baseURL at https://api.parezen.com/v1 and set the API key to a pz_ key from the dashboard. Project and environment come from that key, not from a header. The gateway exists and runs in development; the hosted address goes live once provider-key protection (encryption in transit, encrypted storage, rate limiting) is confirmed. Chat completions, with streaming, is the shape it serves. Embeddings and other modalities are planned.
Tag the request
Headers are optional. The sample sends route and task with defaultHeaders in Node or extra_headers in Python. Trace and cache bypass are per-request examples. A route header only changes the model once a routing policy for that route is switched on, which needs a passed shadow test. Names:
- X-Parezen-Route selects the policy route.
- X-Parezen-Task is the outcome tag.
- X-Parezen-Agent and X-Parezen-Workflow group agent spend.
- X-Parezen-Trace ties one agent run together.
- X-Parezen-Cache: off skips the response cache for that request.
First call
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.parezen.com/v1",
apiKey: process.env.PAREZEN_API_KEY, // pz_ key. Project and environment come from this key.
defaultHeaders: {
"X-Parezen-Route": "support-reply",
"X-Parezen-Task": "ticket_resolved",
},
});
await client.chat.completions.create({
model: "anthropic/claude-sonnet-4.5",
messages: [{ role: "user", content: "Summarise the latest customer ticket." }],
});
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.parezen.com/v1",
api_key=os.environ["PAREZEN_API_KEY"], # pz_ key. Project and environment come from this key.
)
client.chat.completions.create(
model="anthropic/claude-sonnet-4.5",
messages=[{"role": "user", "content": "Summarise the latest customer ticket."}],
extra_headers={
"X-Parezen-Route": "support-reply",
"X-Parezen-Task": "ticket_resolved",
},
)
Default samples send X-Parezen-Route and X-Parezen-Task with defaultHeaders in Node or extra_headers in Python. Project and environment come from the pz_ key, not a header. Optional per-request headers are X-Parezen-Trace and X-Parezen-Cache: off. Self-hosted default is http://localhost:3002/v1. No-SDK snippets only work for apps already on the OpenAI format.
curl https://api.parezen.com/v1/chat/completions \
-H "Authorization: Bearer $PAREZEN_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Parezen-Route: support-reply" \
-H "X-Parezen-Task: ticket_resolved" \
-d '{"model":"anthropic/claude-sonnet-4.5","messages":[{"role":"user","content":"Summarise the latest customer ticket."}]}'
Optional per-request headers
// Optional per-request headers. The client still uses PAREZEN_API_KEY.
await client.chat.completions.create(
{
model: "anthropic/claude-sonnet-4.5",
messages: [{ role: "user", content: "Summarise the latest customer ticket." }],
},
{
headers: {
"X-Parezen-Trace": "trace_example",
"X-Parezen-Cache": "off",
},
},
);
# Optional per-request headers. The client still uses PAREZEN_API_KEY.
client.chat.completions.create(
model="anthropic/claude-sonnet-4.5",
messages=[{"role": "user", "content": "Summarise the latest customer ticket."}],
extra_headers={
"X-Parezen-Trace": "trace_example",
"X-Parezen-Cache": "off",
},
)
# Optional per-request headers
curl https://api.parezen.com/v1/chat/completions \
-H "Authorization: Bearer $PAREZEN_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Parezen-Trace: trace_example" \
-H "X-Parezen-Cache: off" \
-d '{"model":"anthropic/claude-sonnet-4.5","messages":[{"role":"user","content":"Summarise the latest customer ticket."}]}'
Planned (months 3–4): report whether the task succeeded after the fact with POST /v1/tasks/{traceId}/outcome and { "succeeded": true }.
curl -X POST https://api.parezen.com/v1/tasks/trace_example/outcome \
-H "Authorization: Bearer $PAREZEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"succeeded": true}'
If Parezen is down
Retry from your app only when Parezen cannot be reached. A budget hard stop or kill switch answers 403, so a retry on 5xx or a network error never bypasses it. A plan or trial limit never blocks traffic. Fail-open pattern.