# API timeouts and retries when your app calls AI backends you own

When your owned app calls a model or AI HTTP API, the client timeout budget and retry policy live in *your* code — not in a sandbox dashboard. Sandbox builders (Lovable, Bolt, and similar) often hide connect/read latency behind a platform proxy; once the same feature ships from your repo, every hung `/v1/chat` call can pin a worker, cascade into user-facing stalls, or silently burn tokens on duplicate POSTs. The production answer is explicit: set connect and total timeouts, classify which failures are retryable, back off with jitter, and attach an idempotency key when you retry a POST.

This post is about **outbound** HTTP from your service to an AI backend you configure with `$AI_API_BASE`.

---

*This is an excerpt. Read the full post at [otf-kit.dev/blog/api-timeouts-retries-ai-backends](https://otf-kit.dev/blog/api-timeouts-retries-ai-backends) — full-stack kits your AI coding agent can actually ship to production. [Browse the kits →](https://otf-kit.dev)*
