Skip to content

[AI Gateway] document error 7003 and other error codes - #34875

Merged
ethulia merged 10 commits into
productionfrom
aig-error-7003-troubleshooting
Nov 5, 2026
Merged

ethulia merged 10 commits into
productionfrom
aig-error-7003-troubleshooting

Conversation

@ngayerie

@ngayerie ngayerie commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Documents AI Gateway error codes on the Troubleshooting page, following the pattern of the existing 2044 section, and fixes related notes.

  • Troubleshooting:
    • New "400: Bad request (7003)" section explaining what the code means, how to find the underlying reason (including binding errors that omit it), and a table of known causes.
    • New sections for 2009 (provider credentials rejected), Unified Billing and credit errors (2049, 2052, 2021, 2018, 7005), account access errors (2042, 2036), and provider failures (2002, 2005).
  • Logging: corrects the cf-aig-collect-log: false note. Requests billed through Unified Billing still get a log entry with billing details, without bodies.
  • Workers bindings: note on the input format for third-party models, linking to the 7003 section.
  • Dynamic routing: notes that /ai/run does not support dynamic routes and returns 7003.
  • Limits: the Unified Billing rate limit footnote now names error code 2018.
  • Workers AI errors: note pointing users who receive AiGatewayError: <CODE>: <MESSAGE> to AI Gateway troubleshooting.

Related: DEE-4064

Documentation checklist

Add a troubleshooting section for error 7003 with known causes, correct the
cf-aig-collect-log note for Unified Billing requests, and add related notes
to the Workers bindings and dynamic routing pages.

DEE-4064
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://aig-error-7003-troubleshooting.previews.developers.cloudflare.com (commit f42a99f)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://435e8d2d.previews.developers.cloudflare.com f42a99f 2026-11-05T00:34:28.940Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://e257c86b.previews.developers.cloudflare.com f0fac68 2026-11-03T08:14:56.993Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://25356c3b.previews.developers.cloudflare.com c5d3d94 2026-11-03T07:20:00.958Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://012fc9bf.previews.developers.cloudflare.com 6ee066a 2026-11-03T07:02:28.550Z Visit the dashboard ↗
  • Build: In progress 🔵

View logs ↗
0e04567 2026-11-03T06:49:46.983Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://97cd3e0e.previews.developers.cloudflare.com ac5b512 2026-11-03T06:44:02.234Z Visit the dashboard ↗

@github-actions github-actions Bot added the product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Add troubleshooting sections for AI Gateway error codes 2002, 2005, 2009,
2018, 2021, 2036, 2042, 2049, 2052, and 7005. Reference error 2018 from the
Unified Billing rate limit on the Limits page, and point Workers AI users
who receive AiGatewayError responses to AI Gateway troubleshooting.

DEE-4064
@github-actions github-actions Bot added the product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ label Nov 3, 2026
@ngayerie ngayerie changed the title [AI Gateway] document error 7003 troubleshooting [AI Gateway] document error 7003 and other error codes Nov 3, 2026
Use the exact error messages for 2005, 2009, 2018, 2021, 2036, 2042, 2049,
2052, and 7005. Document the per-cause messages for 2049 and the two cases
for 2021. Note that 7003 keeps the underlying HTTP status, add known causes
for 403, 404, 413, and 451, and explain why the AI binding only shows the
error category.

DEE-4064
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed f42a99f · 0 findings · incremental

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

@ngayerie

ngayerie commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @ethulia
Would it be possible for you to review this doc PR for AI Gateway?
Thanks!


:::note
If `cf-aig-collect-log` is set to `false`, the entire log entry (including metadata) is skipped regardless of the `cf-aig-collect-log-payload` value. Use `cf-aig-collect-log-payload: false` on its own if you only want to suppress payload storage while retaining metadata logs.
If `cf-aig-collect-log` is set to `false`, AI Gateway does not store the request and response bodies, regardless of the `cf-aig-collect-log-payload` value. AI Gateway also skips the rest of the log entry, except for requests billed through [Unified Billing](/ai-gateway/features/unified-billing/). For those requests, AI Gateway always records a log entry with billing details, such as model, tokens, cost, and status, so that it can bill the request. This entry appears in your logs without the request and response bodies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could shorten the second half of this to something like "For Unified Billing requests, AI Gateway will always log the request billing details, regardless of the the collect logs headers."

Address review feedback: shorten the Unified Billing logging note, remove
duplicated fixes and cross-reference hops, simplify the AI binding 7003
guidance, and make 2002/2005 H3 headings for consistent navigation.
Replace the 7003 callout with a short intro, merge duplicate resolution
steps, and use actual error text in the known causes table so readers can
match what they see.
The dynamic routing page moved under features/routing/ on production, so
link directly to it instead of relying on the redirect.
@ethulia
ethulia enabled auto-merge November 5, 2026 00:26
@ethulia
ethulia added this pull request to the merge queue Nov 5, 2026
Merged via the queue into production with commit e566907 Nov 5, 2026
15 checks passed
@ethulia
ethulia deleted the aig-error-7003-troubleshooting branch November 5, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants