-
Notifications
You must be signed in to change notification settings - Fork 11.3k
feat(xai): 为xAI渠道添加/v1/responses支持 #2897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+39
−21
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
edf6226
feat(xai): 为xAI渠道添加/v1/responses支持
funkpopo dd91b8e
Add video generation model to constants
funkpopo 384d9a1
Merge branch 'QuantumNous:main' into main
funkpopo cac8ec9
Merge branch 'QuantumNous:main' into main
funkpopo f3a185a
Merge branch 'QuantumNous:main' into main
funkpopo 1a9e9eb
fix: 修正先前更改中对于grok-3-mini的思考预算和"-search"设计
funkpopo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,32 @@ | ||
| package xai | ||
|
|
||
| var ModelList = []string{ | ||
| // grok-4 | ||
| "grok-4", "grok-4-0709", "grok-4-0709-search", | ||
| // grok-3 | ||
| "grok-3-beta", "grok-3-mini-beta", | ||
| // grok-3 mini | ||
| "grok-3-fast-beta", "grok-3-mini-fast-beta", | ||
| // extend grok-3-mini reasoning | ||
| "grok-3-mini-beta-high", "grok-3-mini-beta-low", "grok-3-mini-beta-medium", | ||
| "grok-3-mini-fast-beta-high", "grok-3-mini-fast-beta-low", "grok-3-mini-fast-beta-medium", | ||
| // image model | ||
| "grok-2-image", | ||
| // legacy models | ||
| "grok-2", "grok-2-vision", | ||
| "grok-beta", "grok-vision-beta", | ||
| // language models | ||
| "grok-4-1-fast-reasoning", | ||
| "grok-4-1-fast-non-reasoning", | ||
| "grok-code-fast-1", | ||
| "grok-4-fast-reasoning", | ||
| "grok-4-fast-non-reasoning", | ||
| "grok-4-0709", | ||
| "grok-3-mini", | ||
| "grok-3", | ||
| "grok-2-vision-1212", | ||
| // search variants | ||
| "grok-4-1-fast-reasoning-search", | ||
| "grok-4-1-fast-non-reasoning-search", | ||
| "grok-4-fast-reasoning-search", | ||
| "grok-4-fast-non-reasoning-search", | ||
| "grok-4-0709-search", | ||
| "grok-3-mini-search", | ||
| "grok-3-search", | ||
| // grok-3-mini reasoning effort variants | ||
| "grok-3-mini-high", "grok-3-mini-low", | ||
| // image generation models | ||
| "grok-imagine-image-pro", | ||
| "grok-imagine-image", | ||
| "grok-2-image-1212", | ||
| // video generation model | ||
| "grok-imagine-video", | ||
| } | ||
|
|
||
| var ChannelName = "xai" | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
xAI grok API supported models 2026💡 Result:
As of February 2026, the xAI (Grok) API supports these model IDs (as shown in xAI’s API models/pricing UI and docs):
Language (text) models
grok-4-1-fast-reasoning[1]grok-4-1-fast-non-reasoning[1]grok-4-fast-reasoning[1]grok-4-fast-non-reasoning[1]grok-code-fast-1[1]grok-4[1]grok-3(aliases includegrok-3-latest,grok-3-beta,grok-3-fast,grok-3-fast-latest,grok-3-fast-beta) [2]grok-3-mini[1]grok-2-vision-1212[1]grok-2-1212[1]grok-vision-beta[1]grok-beta[1]Image generation
grok-2-image-1212[1]grok-imagine-image[3]Video generation
grok-imagine-video[4]Source list: xAI API models/pricing page [1], xAI Grok-3 model doc (aliases) [2], xAI Image Generations guide [3], xAI Video Generations guide [4].
Remove unsupported models and update to match current xAI API.
Two models in this list are not currently supported by the xAI API and will cause request failures:
grok-4-0709(deprecated)grok-imagine-image-pro(not available; onlygrok-imagine-imageis supported)Additionally, the following currently available models are missing:
grok-4,grok-2-1212,grok-vision-beta,grok-betagrok-imagine-videoUpdate this list to reflect the current xAI API as of February 2026.
🤖 Prompt for AI Agents