/v1/messages the response is held back until the upstream sends message_start. If the stream drops before that, the request runs again — your client never sees the stump.Cloudflare Worker · one file · no dependencies
Point Claude Code, an OpenAI SDK, or plain curl at your own worker URL. It attaches the headers the upstream expects, drops the parameters it rejects, and refuses to hand you a broken stream.
Start on your own machine. Everything works against localhost first — deploy only once you have seen it answer.
http://localhost:8787
/v1/messages the response is held back until the upstream sends message_start. If the stream drops before that, the request runs again — your client never sees the stump.temperature and top_p are stripped. Empty properties: [] schemas become {}. Tool results with no matching call are dropped before they cause a 400.data: null events — which strict Anthropic clients treat as fatal — are removed from the stream./v1/chat/completions, so a misconfigured client still lands somewhere real.| POST | /v1/messages | Anthropic Messages |
|---|---|---|
| POST | /v1/chat/completions | OpenAI Chat Completions |
| POST | /v1/completions | OpenAI Completions |
| GET | /v1/models | Available models |
| GET | / | Setup page, printing the live base URL |
UPSTREAM_ORIGIN | Where requests are forwarded. Defaults to https://agentrouter.org. | |
|---|---|---|
API_KEY | Used only when a client sends no key of its own. Optional. | |
Set both in wrangler.toml under [vars], or in the Cloudflare dashboard. Keys sent by a client are forwarded upstream and never written down.