Production Guide
Use this guide when you move a PolyBridge client from a prototype to a service.
Beta compatibility: API endpoints and response schemas may evolve. Clients should tolerate unknown fields, nullable values, and documented version changes.
Timeouts
Use separate client timeouts for Search and Forecast. Forecast can take longer than Search.
- See Rate Limits for current timeout values.
- Use
include_graph=falsewhen you do not need graph data. include_graph=falseomitscausal_graphand reduces response size.
Retries
Retry after the time in Retry-After when a request returns 429.
- Use one retry path for temporary
502or503errors. - Do not retry
401,403, or422until you fix auth, access, or request body. - See Rate Limits for exact limits and retry header behavior.
Errors
Handle PolyBridge status codes by cause. Forecast can also return a 200 response with no probability.
| Status | Meaning |
|---|---|
| 401 | Missing auth on auth-required paths, or invalid/malformed auth on anonymous-supported paths. |
| 403 | The key does not have access to that endpoint. |
| 422 | Invalid request shape. |
| 429 | Rate limit or in-flight request limit. |
| 502 or 503 | Temporary service or upstream error. |
Forecast can return 200 with probability: null, an error, and metadata when the question is rejected or cannot produce a forecast.
Invalid or malformed auth does not fall back to anonymous mode. Remove the Authorization header to use anonymous mode where supported.
Request IDs
Send X-Request-ID when your system already has a request ID.
- Log
X-Request-IDfrom responses. - Log the
request_idfield from Search and Forecast response bodies. - Include request IDs when contacting support. Do not send API keys.
Monitoring
Track endpoint, status code, latency, X-Request-ID, and response request_id.
- Track
429,502, and503responses. - Track Forecast responses with
probability: null.
Auth and Security
API keys provide higher-limit authenticated usage. Keep them in server-side code, scripts, or trusted agent-client environments.
- Do not put API keys in browser code or query strings.
- Do not log API keys.
- Rotate a key if it is exposed.
- Use the narrowest endpoint access that works for your client.