Integrate
Production checklist
What to check before shipping your integration.
Authentication & credentials
- The API key lives only on your backend — grep your built frontend bundle to make sure it never ended up in JavaScript shipped to the browser.
- If you use a signed identity (
user-hash),identity_secretstays on the backend only,expires_atis never more than 24 hours from when you sign it, and you re-sign on every page render (don't cache a signature longer than necessary). - Allowed origins (Console → Integration) lists your actual
production domain — not
localhost. Check bothwww.and bare, if your site serves both. - If you use
token-url, that endpoint authenticates the caller itself (a session cookie, or equivalent) before callingPOST /v2/token— it isn't an open proxy anyone can call.
Error handling
- Program against
code, notmessage(see Errors) —messagecan change without notice. - Handle
rate_limitedby waitingretry_afterseconds before retrying, not retrying immediately. - Handle
budget_exceededwith a clear message to the end-user ("service is temporarily at capacity") instead of a generic error. -
redis_unavailableon the stream endpoint doesn't mean the answer was lost — poll the conversation instead, don't surface it as a user-facing error.
Streaming
- Handle a dropped connection mid-run: call
GET /v2/runs/{run_id}/streamagain, don't resend the message. - Ignore any SSE line starting with
:(thekeepalivecomment) instead of treating it as a parse error. - Don't use the browser's native
EventSourceif you need theAuthorizationheader — see Streaming.
Limits & idempotency
- Send
Idempotency-Keyon every message-sending call, especially if your client can auto-retry on timeout. - The cap of 3 concurrent runs per end-user isn't a bug — if your UI
lets someone send messages in quick succession, disable input while
waiting for the previous run to finish, or handle
scope: "active_runs"explicitly.
Operations
- Review Usage & Quotas in the console before launch — set a sensible daily token budget for the org/agent if you want a hard cost ceiling.
- Know how to read Runs & traces in the console to debug a bad answer — every tool call and citation is reviewable.
- Have a plan for blocking or deleting an end-user (Console → Conversations & End-users) if your product needs it (spam, data deletion requests).