Skip to content

Filter OpenRouter models by user provider preferences, privacy settings, and guardrails #35506

Closed as not planned

Description

@ChihweiLHBird

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

When a user connects an OpenRouter API key to OpenCode, the model list currently comes from the static models.dev snapshot (provider.ts → models.dev). It is not filtered by the user's OpenRouter account settings (provider preferences, privacy settings, guardrails, etc.). This causes OpenCode to display models that users explicitly disabled in their OpenRouter accounts.

OpenRouter provides a dedicated endpoint for this:

Using this endpoint when the user is authenticated with OpenRouter would ensure the model list reflects the user's actual available models.

If this idea is accepted, I may open a PR with the proposed changes mentioned below.

Current behavior

OpenCode shows all OpenRouter models from models.dev regardless of user preferences.

Proposed behavior

When a user has authenticated OpenRouter in OpenCode:

  1. Call GET https://openrouter.ai/api/v1/models/user with the stored OpenRouter API key.
  2. Use the returned model IDs to filter/disable models in the OpenCode OpenRouter provider catalog.
  3. Keep the rich metadata (capabilities, limits, pricing) from models.dev.
  4. Cache the filtered list per API key with a reasonable TTL (e.g. 5–15 minutes) to avoid excessive API calls.
  5. Gracefully fall back to the full models.dev OpenRouter list if the request fails.

Why this matters

  • Users see models they are actually allowed to use.
  • It respects user's privacy/guardrail settings in OepnRouter account.
  • It avoids the current mismatch where OpenCode lists models that OpenRouter rejects at request time.

Activity

  1. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  2. ChihweiLHBird commented on Sep 5, 2026

    @ChihweiLHBird
    Author

    This still matters. Can we re-open it?

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