Skip to content

feat: switch xai provider to responses API#18175

Open
Jaaneek wants to merge 1 commit intoanomalyco:devfrom
Jaaneek:feat/xai-responses-api
Open

feat: switch xai provider to responses API#18175
Jaaneek wants to merge 1 commit intoanomalyco:devfrom
Jaaneek:feat/xai-responses-api

Conversation

@Jaaneek
Copy link

@Jaaneek Jaaneek commented Mar 19, 2026

Issue for this PR

Closes #18179 #3890

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Switches xAI provider from completions API to responses API. The reason for this change is to use 'reasoning.encrypted_content' with reasoning models. This should improve performance in long multi turn conversations.

How did you verify your code works?

I did a lot of manual testing also told agent to test the changes e2e. I tried reading files, writing code, opening images etc..

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 19, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Jaaneek Jaaneek changed the title feat: switch xai provider to responses API feat: switch xai provider to responses API and hide Multi Agent model Mar 19, 2026
seenToolCalls.add(part.call_id);
controller.enqueue({
type: "tool-input-start",
\ No newline at end of file
Copy link
Author

Choose a reason for hiding this comment

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

ai-sdk/xai responses API only work with the latest versions, those patches align the functionality to the latest version

Ideally we should just bump ai-sdk to v6

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah im planning on doing that in next few days (bumping sdk)

Currently blocked by gitlab provider

Copy link
Author

@Jaaneek Jaaneek Mar 19, 2026

Choose a reason for hiding this comment

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

Should we merge this anyway so there is an instant improvement? Im happy to help with the migration if needed

Comment on lines +191 to +193
for (const modelID of Object.keys(provider.models)) {
if (modelID.includes("multi-agent")) delete provider.models[modelID]
}
Copy link
Author

Choose a reason for hiding this comment

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

not sure if thats the best way to do it but works. We need to hide multi agent until it supports client side tools

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I updated models.dev, should sync everywhere soon

Copy link
Author

@Jaaneek Jaaneek Mar 19, 2026

Choose a reason for hiding this comment

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

thank you, I will remove it from here

I will also open PR to rename the models to drop the "beta" from the name. Unless you can quickly do it.

@Jaaneek Jaaneek force-pushed the feat/xai-responses-api branch from 615bc30 to 2b8a267 Compare March 19, 2026 11:21
@Jaaneek Jaaneek force-pushed the feat/xai-responses-api branch from 2b8a267 to 80d2d37 Compare March 19, 2026 11:24
@Jaaneek Jaaneek changed the title feat: switch xai provider to responses API and hide Multi Agent model feat: switch xai provider to responses API Mar 19, 2026
@Jaaneek Jaaneek requested a review from rekram1-node March 19, 2026 16:30
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.

[FEATURE]: xAI provider is using completions API instead of responses API, multi agent model is listed but does not work

2 participants