Skip to content

feat: Add OpenAI-compatible API proxy #42

@chindris-mihai-alexandru

Description

Summary

Implement an OpenAI-compatible HTTP server mode to allow using Puter models directly in Zed's model dropdown (and other tools that support custom OpenAI endpoints).

Proposed CLI

npx opencode-puter-auth serve --openai --port 3000

Configuration in Zed

"language_models": {
  "openai": {
    "api_url": "http://localhost:3000/v1",
    "available_models": [
      { "name": "puter/claude-opus-4-5", "displayName": "Claude Opus (Puter)" },
      // ...
    ]
  }
}

Implementation Details

  • Use express or standard node http.
  • Implement /v1/models (list models).
  • Implement /v1/chat/completions (streaming and non-streaming).
  • Map OpenAI request body to Puter API format.
  • Handle authentication via existing auth.ts.

Benefits

  • Models appear directly in Zed's dropdown.
  • No need to use "tools" or indirect prompting.
  • Better UX for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:highHigh priorityroadmapTracked in roadmap/meta issuesstatus:backlogPlanned but not in progress

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions