Skip to content

gpt-5, gpt-4o do not work when using with opencode #40

@matifali

Description

@matifali

Problem

A few observations when trying to use AI Bridge with opencode

  • gpt-5-codex first screenshot needs v1/responses (May get fixed by Implement the OpenAI /v1/responses #16)
  • gpt-5 and gpt-4o 2nd screenshot. Unsupported parameter "max_tokens". Use "max_completion_tokens" instead.
  • gpt-4.1 works smoothly

Now I think this could be the same issue with the Cursor not working with GPT-5 and only working with GPT-4.1 #32

GPT-5 Codex

Image

GPT-5 and GPT-4o

Image

How to Reproduce

  1. opencode auth login --> Choose Other --> Name it aibridge-openai --> Paste Coder Token
  2. Then create a file opencode.json with the following content
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "aibridge-openai": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "AI Bridge",
          "options": {
            "baseURL": "https://dev.coder.com/api/experimental/aibridge/openai/v1"
          },
          "models": {
            "gpt-5": {
              "name": "GPT-5"
            },
            "gpt-5-codex": {
              "name": "GPT-5 Codex"
            },
            "gpt-4.1": {
              "name": "GPT-4.1"
            },
            "gpt-4o": {
              "name": "GPT 4o"
            }
          }
        }
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions