Skip to content

feat(provider): support responses api for @ai-sdk/openai-compatible providers#10142

Open
scratchmex wants to merge 2 commits intoanomalyco:devfrom
scratchmex:issue-9628--support-responses-api-openai-compatible
Open

feat(provider): support responses api for @ai-sdk/openai-compatible providers#10142
scratchmex wants to merge 2 commits intoanomalyco:devfrom
scratchmex:issue-9628--support-responses-api-openai-compatible

Conversation

@scratchmex
Copy link
Contributor

@scratchmex scratchmex commented Jan 23, 2026

What does this PR do?

it supports the responses api for providers using @ai-sdk/openai-compatible. I used your wrapper for github copilot provider which exposes the .responses api. could not do it natively because @ai-sdk does not supports it, see vercel/ai#11970

I plan to add documentation about the new parameters once the approach is approved

closes #9628

How did you verify your code works?

set breakpoint in the lines changed and verifying the override for languageModel was working

bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts serve --port 4096
opencode attach http://localhost:4096

then tried the model several times and worked ok

config used

{
  "provider": {
    "customprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "<URL>/litellm",
        "headers": {
          "client": "opencode",
        },
        "litellmProxy": true,
      },
      "models": {
        "customprovider/gpt-5-codex": {
          "name": "OpenAI GPT 5 codex",
          "options": {
            "responsesApiSupported": true,
            "store": false,
          },
        },
      }
    }
  }
}

the store: false is needed to avoid sending item_reference messages, here

otherwise you will get the error Zero Data Retention Organizations are incompatible with the Responses API. see openai/openai-agents-python#605 for context

@github-actions
Copy link
Contributor

Hey! Your PR title support responses api for openai-compatible providers doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@scratchmex scratchmex changed the title support responses api for openai-compatible providers feat(provider): support responses api for @ai-sdk/openai-compatible providers 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.

[FEATURE]: enable responses API in openai compatible provider

1 participant