Skip to content

Ask the Gateway again after a 503 before paying OpenRouter - #89

Merged
kev1n merged 1 commit into
mainfrom
jev-gateway-503-retry
Sep 19, 2026
Merged

kev1n merged 1 commit into
mainfrom
jev-gateway-503-retry

Conversation

@kev1n

@kev1n kev1n commented Sep 19, 2026

Copy link
Copy Markdown
Member

A quarter of judge calls (507 of 2,047 measured locally on 2026-09-19, and about a third in prod) come back 503 from Vercel's AI Gateway in about a second and are then paid for on OpenRouter. The 503s arrive in short spells and are not tied to request size: in a probe of 80 calls, 9 hit a 503, 8 cleared after a 400ms wait and the last after a further 1.2s.

askGateway now waits 400ms, then 1200ms, and asks the Gateway again on a 503 before falling back. Every attempt still writes its own llm_usage row. A 429, a timeout and a too-large request behave as before.

Worst case adds about 3.5s to a call that ends up on OpenRouter anyway.

🤖 Generated with Claude Code

A quarter of judge calls came back 503 from the Gateway in about a second and
were paid for on OpenRouter. They arrive in short spells and clear on a wait of
under two seconds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kev1n
kev1n merged commit f7ffc15 into main Sep 19, 2026
1 check passed
@kev1n
kev1n deleted the jev-gateway-503-retry branch September 19, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant