Production checklist
Check an integration before launch: the key kind, memory and rules on every request, idempotency, timeouts and retries, stream completion, request IDs, status.
Run through this list before a Cruxy integration serves real traffic. Each item
says what to do, why, and where the details live. The request below already
does most of it: a developer API key, memory and rules set explicitly, a pinned
Cruxy-Version, an Idempotency-Key, a client timeout above the tier's
deadline, and the IDs logged.
# One Idempotency-Key per logical request; reuse it on every retry of it.
# -i prints the X-Request-Id and Cruxy-Version headers to log with the body.
curl -i https://api.cruxy.ai/api/v1/chat \
--max-time 120 \
-H "Authorization: Bearer $CRUXY_API_KEY" \
-H "Content-Type: application/json" \
-H "Cruxy-Version: 2026-10-18" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "saga",
"memory": { "recall": false, "capture": false },
"rules": false,
"messages": [
{ "role": "user", "content": "Summarize a refund policy in two sentences." }
]
}'import { randomUUID } from 'node:crypto'
// One key per logical request: keep it, and send it again on every retry.
const idempotencyKey = randomUUID()
const res = await fetch('https://api.cruxy.ai/api/v1/chat', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CRUXY_API_KEY}`,
'Content-Type': 'application/json',
'Cruxy-Version': '2026-10-18',
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
model: 'saga',
// Explicit on every request, whatever the key's defaults are.
memory: { recall: false, capture: false },
rules: false,
messages: [{ role: 'user', content: 'Summarize a refund policy in two sentences.' }],
}),
// Your client timeout, not an API limit: above saga's 90-second deadline.
signal: AbortSignal.timeout(120_000),
})
const ids = {
x_request_id: res.headers.get('X-Request-Id'),
cruxy_version: res.headers.get('Cruxy-Version'),
}
const body = await res.json()
if (!res.ok) {
// Branch on code, never on the message. Log the ids, never the key.
console.error(JSON.stringify({ status: res.status, code: body.code, request_id: body.request_id, ...ids }))
throw new Error(`chat failed: ${res.status} ${body.code}`)
}
console.log(
JSON.stringify({
request_id: body.cruxy.request_id,
routed_tier: body.cruxy.routed_tier,
finish_reason: body.finish_reason,
...ids,
}),
)
console.log(body.message.content)Keys
- Run servers on a developer API key, never a signed-in credential. A key from device login carries its owner's memory and standing rules into every request by default, and expires 90 days after issue. A developer API key, created in the Cruxy Console, has memory and rules off by default, never expires, and is rotated or revoked in the Console. See Get your API key.
- Confirm the key kind at startup.
bucketonGET /api/v1/limitsisapikeyfor a developer key andsubscriptionfor a signed-in credential; Security shows the check. - Keep the key in the environment or a secrets manager, one key per environment. See Security.
Memory and rules
- Set
memoryandruleson every chat request. Left out, the key decides, and the two kinds of key decide differently. Sendingmemory: {"recall": false, "capture": false}andrules: falsemakes a request behave the same whichever key sends it. Opt in withtrueonly where you mean it; see Memory and Standing rules. - Pin
Cruxy-Version2026-09-26 or later when you rely onfalse. A gateway that predates the field would ignore it and capture anyway; with the pin, it refuses the request instead.
Versioning
- Pin
Cruxy-Versionon every request, at the version you tested against, and move it deliberately. Responses name the tier by its current id from2026-10-18. See Request IDs and metadata. - Ignore JSON fields you do not recognize. New
cruxy.*fields ship without a version change.
Timeouts and retries
- Set client timeouts above the tier's deadline. A
stream: falsecall gets one attempt: 90 seconds oncantoandsaga, 45 seconds onepos, then504upstream_timeout. A stream may run for up to five minutes. See Reliability. - Do not retry a
504unchanged. It takes as long again. Stream the turn, or lowermax_tokensorreasoning_effort. - Retry only what the API marks retryable, honouring
Retry-After, with exponential backoff and jitter, and a cap on attempts and total wait. Stop on a budget or spend-cap429: it clears only at itsreset_at. See Errors and retries.
Idempotency
- Send an
Idempotency-Keyon every request that takes one, and reuse it on every retry of the same logical request. A success is stored for 24 hours and replayed without billing again. The same key with a different body is409idempotency_conflict. See Errors and retries. - Expect a stream to replay nothing. A retried stream generates again; when both attempts complete, the request is billed once.
Streams
- Accept a streamed answer only once it finished. On
POST /api/v1/chat,data: [DONE]is the only success signal; onPOST /api/v2/chat, the stream ends with exactly onefinishorerrorframe. A stream that ends any other way failed: send the request again with the sameIdempotency-Key. See Streaming. - Check
choicesbefore you readchoices[0]. The usage frame on every successful stream haschoices: []. - Treat
finish_reason: "length"with empty content as a spent budget, not an empty answer. Oncanto, thinking spendsmax_tokens; see Reasoning effort.
Logging
- Log the IDs of every call, success or failure: the
X-Request-Idheader, the per-callrequest_id(cruxy.request_idon a success), theCruxy-Versionheader, andcruxy.routed_tier. Withmodel: "auto", the router can pick differently for two similar requests, so log the tier that served. See Request IDs and metadata. - Log the
key_id, never the key, and never the request body when it can carry personal data.
Status
- Watch status.getcruxy.com, the Cruxy status
page, and read
GET /api/statusfrom your own monitoring. It takes no key.GET /api/healthreports only that the gateway's HTTP listener is up; do not read it as platform status. See Reliability. - Know where to report a problem. Support lists what to send.
Next steps
- Security: keys, memory, and anonymous traffic.
- Tier and effort for cost and latency: size each call.
- Reliability: deadlines, retries, and stream checks in full.
- Known limitations: what to plan around before launch.