Skip to content

Unexpected endpoint or method #9

Open

Description

@inquam

Doens't seem to locate models. In the dev-tab of LM Studio I see:

Unexpected endpoint or method. (GET /v1/models). Returning 200 anyway

Using LM Studio 0.4.2

Activity

  1. HarelMil commented on Mar 6, 2026

    @HarelMil
    Contributor

    +1

    I noticed that it happens on my configuration where an Authorization header is required.
    In other words, if I enforce Authorization with a Bearer token the plugin is probably not using it (a guess). When I downgraded the security by omitting this requirement it worked.

  2. agustif commented on Jun 21, 2026

    @agustif
    Owner

    opencode-lmstudio@1.0.0-rc.1 is now available and should address both behaviors reported here.

    The RC performs discovery with GET /api/v0/models, while the provider's inference URL remains OpenAI-compatible under /v1. When an apiKey is configured, discovery sends it as an Authorization: Bearer ... header. Both endpoint construction and authenticated discovery are covered by the release tests.

    Could you retest with the exact RC, including the authenticated configuration if applicable?

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-lmstudio@1.0.0-rc.1"]
    }

    Please confirm whether LM Studio now receives a successful GET /api/v0/models, whether models appear in OpenCode, and your OpenCode/LM Studio versions. Do not post the token itself. If discovery works without the unexpected /v1/models warning or authentication failure, please confirm that this issue can be closed; otherwise, include the sanitized provider configuration and current LM Studio status/error.

    See #34 for the full RC configuration and feedback template.

  3. agustif commented on Jun 21, 2026

    @agustif
    Owner

    opencode-lmstudio@1.0.0-rc.2 now implements LM Studio 0.4's documented endpoint and authentication boundary.

    Discovery uses native GET /api/v1/models; inference remains /v1/chat/completions. A configured provider apiKey is sent as a Bearer token for discovery and inference. Local/private automatic lookup uses LM_API_TOKEN, then LMSTUDIO_API_KEY. Authentication failures and invalid native responses do not silently fall back to another endpoint.

    Please pin "plugin": ["opencode-lmstudio@1.0.0-rc.2"], restart OpenCode, and retest with your LM Studio 0.4.x setup, including required authentication if applicable. If models appear without an unexpected /v1/models request or 401/403, please confirm this issue can be closed. Otherwise, include the exact versions, sanitized provider configuration, requested path, and HTTP status—never the token itself. See #34 for the shared template.

  4. aelfwyne commented on Jul 6, 2026

    @aelfwyne

    Please just add proper support for the request. End users need it to work in a compatible way.

  5. agustif commented on Jul 7, 2026

    @agustif
    Owner

    Please just add proper support for the request. End users need it to work in a compatible way.

    could you explain exactly what you mean? Does it not work now for you while using the latest rc.2 version?

    will make a regular 1.0 release soon, just wanted to daily-drive it myself for a while before pushing it out of beta.

    Did you find any issues with it?

  6. self-assigned this
    on Jul 7, 2026
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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions