You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Support traditional Chat Completions API for OpenAI provider #7793
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Description
The OpenAI provider in opencode uses the new Responses API format (SSE event stream) instead of the traditional Chat Completions API. Most OpenAI-compatible proxies only implement the Chat Completions API, causing compatibility issues.
Current Behavior
When configuring the OpenAI provider to point to an OpenAI-compatible proxy (e.g., Antigravity, LM Studio, Ollama, etc.), the proxy returns standard Chat Completions format, but opencode expects Responses API format, resulting in parse failures.
Error Message
AI_TypeValidationError: Type validation failed
Invalid input: expected "response.output_text.delta"
Reproduction Steps
Configure OpenAI provider to point to an OpenAI-compatible proxy:
opencode's OpenAI provider uses OpenAI's new Responses API format instead of the widely-adopted Chat Completions API. Most OpenAI-compatible proxies only implement Chat Completions API.
Workaround
Use Anthropic provider instead:
If your proxy supports Anthropic API format (/v1/messages):
Traditional Chat Completions API (for compatibility with most proxies)
New Responses API (for official OpenAI)
Or at least provide a configuration option to choose between them.
Proposed Solutions
Add a useResponsesApi or apiVersion option in OpenAI provider config
Fallback to Chat Completions if Responses API is not supported
Support both formats based on provider configuration
Additional Notes
This is a design limitation, not a bug per se. However, it significantly reduces compatibility with OpenAI-compatible proxies, which are widely used by developers.
Reacted by codgician, Nuno Vieira, Bianca Lodoli and Hexiang Geng
These issues all relate to OpenAI-compatible provider configuration and API compatibility. Your feature request about supporting traditional Chat Completions API may be partially addressed by fixing the underlying issues with how options are passed to custom OpenAI-compatible providers.
Feel free to ignore if none of these address your specific case.
I think your issue is that you're not using the Openai-compatible provider and trying to use the openai provider directly. The openai-compatible uses chat/completions
Activity
github-actions commentedon Jan 11, 2026
This issue might be a duplicate of existing issues. Please check:
These issues all relate to OpenAI-compatible provider configuration and API compatibility. Your feature request about supporting traditional Chat Completions API may be partially addressed by fixing the underlying issues with how options are passed to custom OpenAI-compatible providers.
Feel free to ignore if none of these address your specific case.
joshrad-dev commentedon Jan 26, 2026
I think your issue is that you're not using the Openai-compatible provider and trying to use the openai provider directly. The openai-compatible uses chat/completions
augusto3691 commentedon Mar 25, 2026
for some reason im getting
The requested operation is unsupportedwhen using those openai-compatiblefeat(provider): add Chat Completions API mode for gateway/proxy provi…
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.