Skip to content

[Feature Request] Support traditional Chat Completions API for OpenAI provider #7793

Closed as not planned

Description

@boyan250422-code

Feature hasn't been suggested before.

  • 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

  1. Configure OpenAI provider to point to an OpenAI-compatible proxy:
{
  "provider": {
    "openai": {
      "options": {
        "apiKey": "your-api-key",
        "baseURL": "http://localhost:8045/v1"
      }
    }
  }
}
  1. Run any opencode command
  2. Parse error occurs

Environment

  • OS: Windows 11
  • opencode version: v1.0.150+
  • oh-my-opencode version: v2.14.0

Root Cause

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):

{
  "provider": {
    "anthropic": {
      "options": {
        "apiKey": "your-api-key",
        "baseURL": "http://localhost:8045/v1"
      }
    }
  }
}

Expected Behavior

Ideally, opencode should support both:

  1. Traditional Chat Completions API (for compatibility with most proxies)
  2. New Responses API (for official OpenAI)

Or at least provide a configuration option to choose between them.

Proposed Solutions

  1. Add a useResponsesApi or apiVersion option in OpenAI provider config
  2. Fallback to Chat Completions if Responses API is not supported
  3. 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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 11, 2026
  2. github-actions commented on Jan 11, 2026

    @github-actions
    Contributor

    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.

  3. joshrad-dev commented on Jan 26, 2026

    @joshrad-dev

    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

  4. augusto3691 commented on Mar 25, 2026

    @augusto3691

    for some reason im getting The requested operation is unsupported when using those openai-compatible

  5. added a commit that references this issue on Apr 29, 2026
    9a4aeb6
  6. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  7. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions