Ai-gateway: add endpoint-model compatibility matrix to REST API docs.mdx#31743
Open
dpiteira95 wants to merge 1 commit into
Open
Ai-gateway: add endpoint-model compatibility matrix to REST API docs.mdx#31743dpiteira95 wants to merge 1 commit into
dpiteira95 wants to merge 1 commit into
Conversation
… docs.mdx The AI Gateway REST API documentation currently lists four endpoints (/ai/run, /ai/v1/chat/completions, /ai/v1/responses, /ai/v1/messages) without clarifying which endpoints support Workers AI models (@cf/) versus third-party models only. This has led to user confusion, as the "/ai/v1/messages" endpoint (Anthropic SDK compatible) rejects Workers AI models with: "AiError: Anthropic Messages API is not supported for model" despite the "unified API" messaging implying broad compatibility. Changes proposed: - Add a compatibility matrix to the Endpoints section showing support for third-party models and Workers AI models per endpoint - Add an explicit warning note below the matrix clarifying that /ai/v1/messages supports Anthropic/third-party models only, and Workers AI models should use /ai/run, /ai/v1/chat/completions, or /ai/v1/responses instead Proposed matrix: | Endpoint | Format | Third-party models | Workers AI models (@cf/) | |----------|--------|-------------------|---------------------------| | POST /ai/run | Universal envelope | Yes | Yes | | POST /ai/v1/chat/completions | OpenAI SDK compatible | Yes | Yes | | POST /ai/v1/responses | OpenAI Responses API compatible | Yes | Yes | | POST /ai/v1/messages | Anthropic SDK compatible | Yes | No | This aligns the documentation with actual API behavior.
Contributor
Review✅ No issues found in commit Fan Out Code ReviewThis code review is in beta and may not always be helpful — use your judgment. ✅ No code review issues found. Style Guide Review✅ No style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AI Gateway REST API documentation currently lists four endpoints (/ai/run, /ai/v1/chat/completions, /ai/v1/responses, /ai/v1/messages) without clarifying which endpoints support Workers AI models (@cf/) versus third-party models only.
This has led to user confusion, as the "/ai/v1/messages" endpoint (Anthropic SDK compatible) rejects Workers AI models with: "AiError: Anthropic Messages API is not supported for model" despite the "unified API" messaging implying broad compatibility.
Changes proposed:
Proposed matrix:
This aligns the documentation with actual API behavior.