Skip to content

opencode serve requires HTTP auth, breaking SDK / third-party clients #31254

Closed as not planned

Description

@keepkeen

Problem

opencode serve (v1.15.13, installed via Homebrew) returns HTTP 401 for all API endpoints:

$ curl -s http://127.0.0.1:18750/provider
HTTP 401
www-authenticate: Basic realm="Secure Area"

All endpoints tested return 401: /provider, /api/provider, /config/providers, /session, etc.

Impact

This breaks any third-party tool using the OpenCode SDK (@opencode-ai/sdk) to communicate with a local server. For example, Paseo can no longer integrate with OpenCode >= 1.15.0.

The SDK v1.16.2 supports HTTP auth via Config.auth (basic / bearer), but the server credentials are not discoverable:

  • No auth info in stdout/stderr
  • No auth tables in ~/.local/share/opencode/opencode.db
  • No relevant environment variables
  • The SDK does not auto-authenticate

Request

One of:

  1. Add a --no-auth / --insecure flag for local development
  2. Document how external SDK clients should authenticate (e.g., generate and expose a server token)
  3. Update the SDK to auto-authenticate when connecting to a local server

Environment

  • opencode: 1.15.13 (Homebrew)
  • macOS 15
  • Node v24

Activity

  1. github-actions commented on Jun 7, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use one of the three available templates: Bug Report, Feature Request, or Question. Since this appears to be a combination of a bug report and feature request, consider filing them separately using the appropriate templates (Bug Report for the undiscoverable auth credentials, Feature Request for the --no-auth flag / token exposure).

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Jun 7, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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