Appearance
Troubleshooting
Common Issues
401 Unauthorized
Symptom: All API calls return 401.
Causes:
- Missing
Authorizationheader - Wrong token format (must be
Bearer aw_live_xxx, notToken aw_live_xxx) - Token not in
TENANT_TOKEN_MAPor KV store
Fix:
python
# Correct format
import openai
client = openai.OpenAI(
base_url="https://api.agent-watch.dev/v1/proxy/openai",
api_key="aw_live_xxx:sk-proj-xxx",
)Budget Check Always Passes
Symptom: Requests are not blocked even when spending exceeds the session budget.
Causes:
X-AgentWatch-Session-Budget-Usdheader is not set- Session ID is not consistent across calls
Fix:
python
# Pass budget headers with your requests
client = openai.OpenAI(
base_url="https://api.agent-watch.dev/v1/proxy/openai",
api_key="aw_live_xxx:sk-proj-xxx",
default_headers={
"X-AgentWatch-Session-Id": "consistent-id",
"X-AgentWatch-Session-Budget-Usd": "2.00",
}
)AgentWatch Outage Affecting Production
Symptom: API calls fail when AgentWatch is down.
Cause: AgentWatch operates as a pure proxy. If the edge is unreachable, requests fail with a connection error.
Fix: AgentWatch uses fail-open architecture — if the edge proxy is unreachable, budget checks are silently bypassed and requests proceed directly to the provider.
Streaming Calls Not Counting Toward Budget
Symptom: Streaming calls bypass budget enforcement.
Cause: Token counts are unavailable until stream completion. Budget enforcement uses estimated counts.
Fix: This is expected behavior. Use non-streaming calls for strict budget enforcement.
Rate Limiting (429)
Symptom: Requests return 429 Too Many Requests.
Cause: Exceeded 100 requests per minute per tenant.
Fix:
- Reduce request frequency
- Contact support to increase limits
- Use batch APIs where available
Telemetry Not Appearing
Symptom: Logs don't appear in Supabase dashboard.
Causes:
SUPABASE_URLorSUPABASE_SERVICE_ROLE_KEYnot configured- Queue consumer not running
- 90-day retention purged old logs
Fix: Check Worker logs for Supabase connection errors.
Performance Issues
Slow Budget Checks
Budget checks involve a network round-trip to Cloudflare KV (5-50ms). If consistently slow:
- Check Cloudflare status page
- Verify Worker is deployed to the correct region
- Consider using Durable Objects for atomic operations
High Latency on First Request
First requests may be slower due to Worker cold start (V8 compilation). Subsequent requests are fast.
Getting Help
- Email: hello@agent-watch.dev
- Health Check:
curl https://agent-watch.dev/healthz