Troubleshooting
Solve common issues when integrating with KushRouter.
Authentication errors (401)
- Double-check that you are using the correct header:
- OpenAI-compatible routes:
Authorization: Bearer $API_KEY - Anthropic-compatible routes:
x-api-key: $API_KEY
- OpenAI-compatible routes:
- Verify the key is active in the dashboard and has remaining credits.
Validation errors (400)
- Ensure
streamis a boolean value, not a string. - Confirm all required provider-specific parameters are provided (e.g.,
max_tokensfor Anthropic models). - Review the
Schemaspage for full validation rules.
Rate limits (429)
- Requests are throttled per API key and IP.
- Use exponential backoff with jitter and honor
Retry-Afterwhen present (numeric seconds or HTTP-date). - Spread bursts and coordinate concurrency across workers.
- Check usage dashboards for burst patterns.
Retryability quick guide
- 400/401/402/413 — non‑retryable; fix the request/auth/size first
- 429 — retryable with backoff; reduce concurrency; follow
Retry-After - 5xx — retryable with capped exponential backoff
Payload too large (413)
- Compress prompts or split conversations into smaller batches.
- For long-running jobs, consider the Batches API.
Tool calls missing arguments
- KushRouter streams incremental tool deltas, but some providers emit final arguments only at completion. We inject a final delta to ensure downstream clients receive full JSON.
- Verify your client handles both incremental and final tool call frames.
Provider-specific pitfalls
- OpenAI Chat: ensure the final
finish_reasonchunk is handled, and whenstream_options.include_usage=true, read the usage-only chunk before[DONE]. - OpenAI Responses: tools require
response.requires_actionhandling and a follow-upsubmit_tool_outputscall. - Anthropic Messages: always send
max_tokens; setanthropic-versioncorrectly (usevertex-2023-10-16on Vertex AI).
Need more help?
- Contact support.
- Enable verbose logging in your SDK and capture request IDs when reporting issues.