GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add OpenAI-compatible `/v1/models` endpoint to OpenCode Zen for automatic model discovery · Issue #2901 · anomalyco/opencode

Add OpenAI-compatible /v1/models endpoint to OpenCode Zen for automatic model discovery #2901

New issue
Copy link
New issue
Copy link
Closed
Closed
Add OpenAI-compatible /v1/models endpoint to OpenCode Zen for automatic model discovery#2901
Copy link
Assignees
fwang

Description

@danilevy1212
danilevy1212
opened on Oct 1, 2025
Issue body actions

problem

opencode zen currently doesn't expose a /v1/models endpoint, which prevents openai-compatible clients (like openwebui) from automatically discovering available models.

this forces users to manually add each model id to their client configuration, which is:

  • time-consuming (11+ models to add manually)
  • error-prone (typos in model ids)
  • not future-proof (requires manual updates when new models are added)

proposed solution

implement a /v1/models endpoint that returns an openai-compatible response listing all available opencode zen models.

endpoint: get /v1/models

response format (openai-compatible):

{
  "object": "list",
  "data": [
    {
      "id": "claude-3-5-haiku",
      "object": "model",
      "created": 1234567890,
      "owned_by": "anthropic"
    },
    {
      "id": "claude-sonnet-4",
      "object": "model",
      "created": 1234567890,
      "owned_by": "anthropic"
    }
  ]
}

the model data is already available at https://models.dev/api.json under .opencode.models, making implementation straightforward:

# current model list (11 models)
curl https://models.dev/api.json -s | jq '.opencode.models | keys'

use cases

this would enable openwebui and other openai-compatible clients to:

  • ✅ automatically discover available opencode zen models on startup
  • ✅ dynamically refresh model lists when new models are added
  • ✅ provide better ux without manual configuration
  • ✅ reduce support burden for integration issues

current workaround

building a local proxy server that:

  1. intercepts /v1/models requests
  2. fetches from models.dev/api.json
  3. transforms to openai-compatible format
  4. forwards all other requests to opencode

however, native support in opencode would be cleaner and more maintainable.

references

  • openai models api: https://platform.openai.com/docs/api-reference/models
  • models source: https://models.dev/api.json
  • openwebui integration docs: https://docs.openwebui.com/
Reacted by Gerardo Doro

Activity

  1. rekram1-node
    assigned
    fwang
    on Oct 1, 2025
  2. rekram1-node commented on Oct 1, 2025

    @rekram1-node
    rekram1-node
    on Oct 1, 2025
    Member
    More actions

    makes sense, thanks for raising

    Reacted by Daniel Levy Moreno
  3. danilevy1212 commented on Nov 2, 2025

    @danilevy1212
    danilevy1212
    on Nov 2, 2025
    Author
    More actions

    Looks like it works now!

    curl -s https://opencode.ai/zen/v1/models | jq
    {
      "object": "list",
      "data": [
        {
          "id": "claude-opus-4-1",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "claude-sonnet-4",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "claude-sonnet-4-5",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "claude-3-5-haiku",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "claude-haiku-4-5",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "gpt-5",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "gpt-5-codex",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "qwen3-coder",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "glm-4.6",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "big-pickle",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "an-gbt",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "kimi-k2",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "minimax-m2",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        },
        {
          "id": "grok-code",
          "object": "model",
          "created": 1762047082,
          "owned_by": "opencode"
        }
      ]
    }
  4. danilevy1212
    closed this as completedon Nov 2, 2025
  5. dhruvkej9 commented on Apr 25, 2026

    @dhruvkej9
    dhruvkej9
    on Apr 25, 2026
    More actions

    @rekram1-node Also can there be a config option config.json similar to this which handles the models using the v1/models? for any link?

  6. robertsreberski
    added 2 commits that reference this issue on Jun 2, 2026

    feat(providers): add opencode-zen OpenAI-compatible provider type

    9c4bb9a

    fix(providers): harden OpenCode Zen model discovery

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

Metadata

Metadata

Assignees

  • @fwang
    fwang

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.