Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pratikbuilds
Copy link

Adds support for xAI's new Responses API while maintaining backward compatibility with the deprecated Chat Completions endpoint.

Changes

  • Add XAIAPIType enum with chat_completions (default) and responses variants
  • Update XAIProvider to support both API types in streaming and non-streaming modes
  • Reuse OpenAI Responses implementation for xAI Responses API
  • Change visibility of OpenAI Responses types to pub(crate) for cross-provider reuse
  • Add test configuration for Responses API (grok_4_1_fast_non_reasoning_responses)

Testing

  • cargo check passes
  • cargo fmt passes
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • Test configuration added for the new API type

Fixes #5774

Adds support for xAI's new Responses API while maintaining backward
compatibility with the deprecated Chat Completions endpoint.

Changes:
- Add XAIAPIType enum with chat_completions (default) and responses variants
- Update XAIProvider to support both API types in streaming and non-streaming modes
- Reuse OpenAI Responses implementation for xAI Responses API
- Change visibility of OpenAI Responses types to pub(crate) for cross-provider reuse
- Add test configuration for Responses API (grok_4_1_fast_non_reasoning_responses)

Fixes tensorzero#5774
@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@pratikbuilds
Copy link
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

github-actions bot added a commit that referenced this pull request Jan 23, 2026
@pratikbuilds
Copy link
Author

I tried running the UI and e2e tests but i get error cause i don't have xAI api key to test it

@pratikbuilds pratikbuilds changed the title Add xAI Responses API support with backward compatibility Add xAI Responses API support Jan 23, 2026
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.

Update xAI API integration to use Responses

2 participants