Skip to content

open_ai: Use responses API for all models#54910

Merged
bennetbo merged 3 commits intomainfrom
openai-prefer-responses-api
Apr 27, 2026
Merged

open_ai: Use responses API for all models#54910
bennetbo merged 3 commits intomainfrom
openai-prefer-responses-api

Conversation

@bennetbo
Copy link
Copy Markdown
Member

@bennetbo bennetbo commented Apr 26, 2026

From the docs:

Better performance: Using reasoning models, like GPT-5, with Responses will result in better model intelligence when compared to Chat Completions. Our internal evals reveal a 3% improvement in SWE-bench with same prompt and setup.
Agentic by default: The Responses API is an agentic loop, allowing the model to call multiple tools, like web_search, image_generation, file_search, code_interpreter, remote MCP servers, as well as your own custom functions, within the span of one API request.
Lower costs: Results in lower costs due to improved cache utilization (40% to 80% improvement when compared to Chat Completions in internal tests).
Stateful context: Use store: true to maintain state from turn to turn, preserving reasoning and tool context from turn-to-turn.
Flexible inputs: Pass a string with input or a list of messages; use instructions for system-level guidance.
Encrypted reasoning: Opt-out of statefulness while still benefiting from advanced reasoning.
Future-proof: Future-proofed for upcoming models.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

  • Always use Responses API for OpenAI models
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 26, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 26, 2026
@bennetbo bennetbo changed the title openai: Prefer responses API for models that support it Apr 26, 2026
@maxdeviant maxdeviant changed the title openai: Use responses API for all models Apr 26, 2026
@bennetbo bennetbo marked this pull request as ready for review April 27, 2026 07:05
@bennetbo bennetbo requested review from benbrandt and rtfeldman April 27, 2026 07:09
pub fn uses_responses_api(&self) -> bool {
match self {
Self::Custom {
supports_chat_completions,
Copy link
Copy Markdown
Member Author

@bennetbo bennetbo Apr 27, 2026

Choose a reason for hiding this comment

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

We should probably rename this to use_chat_completions or something, but we need a settings migration for that, so I left it as is for now so we can cherry-pick this to Preview/Stable

@bennetbo bennetbo added this pull request to the merge queue Apr 27, 2026
@bennetbo
Copy link
Copy Markdown
Member Author

/cherry-pick preview

@bennetbo
Copy link
Copy Markdown
Member Author

/cherry-pick stable

Merged via the queue into main with commit 83cc2ec Apr 27, 2026
38 checks passed
@bennetbo bennetbo deleted the openai-prefer-responses-api branch April 27, 2026 09:55
zed-zippy Bot added a commit that referenced this pull request Apr 27, 2026
…eview) (#54990)

Cherry-pick of #54910 to preview

----
From the

[docs](https://developers.openai.com/api/docs/guides/migrate-to-responses#responses-benefits):

> Better performance: Using reasoning models, like GPT-5, with Responses
will result in better model intelligence when compared to Chat
Completions. Our internal evals reveal a 3% improvement in SWE-bench
with same prompt and setup.
Agentic by default: The Responses API is an agentic loop, allowing the
model to call multiple tools, like web_search, image_generation,
file_search, code_interpreter, remote MCP servers, as well as your own
custom functions, within the span of one API request.
Lower costs: Results in lower costs due to improved cache utilization
(40% to 80% improvement when compared to Chat Completions in internal
tests).
Stateful context: Use store: true to maintain state from turn to turn,
preserving reasoning and tool context from turn-to-turn.
Flexible inputs: Pass a string with input or a list of messages; use
instructions for system-level guidance.
Encrypted reasoning: Opt-out of statefulness while still benefiting from
advanced reasoning.
Future-proof: Future-proofed for upcoming models.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Always use Responses API for OpenAI models

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
tomhoule pushed a commit that referenced this pull request Apr 27, 2026
From the
[docs](https://developers.openai.com/api/docs/guides/migrate-to-responses#responses-benefits):

> Better performance: Using reasoning models, like GPT-5, with Responses
will result in better model intelligence when compared to Chat
Completions. Our internal evals reveal a 3% improvement in SWE-bench
with same prompt and setup.
Agentic by default: The Responses API is an agentic loop, allowing the
model to call multiple tools, like web_search, image_generation,
file_search, code_interpreter, remote MCP servers, as well as your own
custom functions, within the span of one API request.
Lower costs: Results in lower costs due to improved cache utilization
(40% to 80% improvement when compared to Chat Completions in internal
tests).
Stateful context: Use store: true to maintain state from turn to turn,
preserving reasoning and tool context from turn-to-turn.
Flexible inputs: Pass a string with input or a list of messages; use
instructions for system-level guidance.
Encrypted reasoning: Opt-out of statefulness while still benefiting from
advanced reasoning.
Future-proof: Future-proofed for upcoming models.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Always use Responses API for OpenAI models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

2 participants