Skip to content

pinning OpenRouter provider doesn't work #10557

Closed as not planned
Closed as not planned

Description

@olk

Description

Configuration should pin the provider of LLM MiniMax-M 2.1 to Minimax:

			"minimax/minimax-m2.1": {
				"name": "MiniMax-M2.1",
				"options": {
					"provider": {
						"order": [
							"minimax"
						],
						"allow_fallbacks": false
					}
				}
			}

Unfortunately the usage log at openrouter.ai/activity shows the arbitrary providers of the MiniMax-M2.1 LLM are used.

Replacing "order" by "only" doesn't change the behavior.

Pinning to one specific provider seams not to work.

OpenCode version

1.1.34

Operating System

Arch Linux

Terminal

kitty

Activity

  1. added
    bugSomething isn't working
    on Jan 25, 2026
  2. github-actions commented on Jan 25, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. TheHamkerCat commented on Jan 31, 2026

    @TheHamkerCat

    @thdxr Openrouter requests are going to random providers, this is kinda serious

  4. TheHamkerCat commented on Jan 31, 2026

    @TheHamkerCat

    I'm 100% sure OC doesn't include provider in the request

    Image

    I chose amazon-bedrock in config and it shows Ncompass here:

    "openai/gpt-oss-120b": {
        "name": "GPT OSS 120B",
        "options": {
            "OpenRouter": {
                "provider": {
                    "order": [
                        "amazon-bedrock"
                    ],
                    "allow_fallbacks": false,
                }
            }
        }
    }
    Image

    Can we also have tests for this so it doesn't happen again, because sending your data to a random provider is pretty bad for privacy :(

  5. rekram1-node commented on Jan 31, 2026

    @rekram1-node
    Contributor

    If I set:

    "openrouter": {
          "models": {
            "openai/gpt-oss-120b": {
              "name": "GPT OSS 120B",
              "options": {
                "provider": {
                  "order": ["amazon-bedrock"],
                  "allow_fallbacks": false,
                },
              },
            },
          },
        },
    

    and look in the request body sent to openrouter, I see:

    {
        "model": "openai/gpt-oss-120b",
        "max_tokens": 32000,
        "provider": {
            "order": [
                "amazon-bedrock"
            ],
            "allow_fallbacks": false
        },
    
    .....
    }
    

    Is this incorrect?

  6. rekram1-node commented on Jan 31, 2026

    @rekram1-node
    Contributor

    the options under a model should be sent directly as is in the request body, unless it is a special ai sdk field

  7. TheHamkerCat commented on Jan 31, 2026

    @TheHamkerCat

    @rekram1-node

    I see, i was wrong, looks like in my case, this was the issue:

        "options": {
            "OpenRouter": {
                "provider": {

    there shouldn't have been a

      "OpenRouter": {

    instead

        "options": {
            "provider": {

    Thanks, this fixed it

    But OP's config looks correct, and he still has issues

  8. rekram1-node commented on Jan 31, 2026

    @rekram1-node
    Contributor

    I tested op config, I can't replicate the issue, now that doesnt mean it doesnt exist but I don't see anything in our code that WOULDNT be sending the params as is

  9. olk commented on Feb 2, 2026

    @olk
    Author

    I tested op config, I can't replicate the issue, now that doesnt mean it doesnt exist but I don't see anything in our code that WOULDNT be sending the params as is

    what is the correct config? "order" or "only"?
    If I look at OpenRouters openrouter.ai/activity page for my account I see that varying providers are used for calling MiniMax-M2.1

  10. mindplay-dk commented on Feb 11, 2026

    @mindplay-dk

    @thdxr Openrouter requests are going to random providers, this is kinda serious

    Came to report this.

    Requests in the same session are going to all random providers - I just had a 100K tokens go out to 5 different providers... without caching. 😐💸

    Needing to manually configure providers isn't a good default experience - one would hope the client is smart enough to choose wisely on it's own at the beginning of a session, e.g. the currently fastest available provider that supports caching, and then stick with the same provider for the session, in order to actually benefit from caching.

  11. Syazvinski commented on Feb 14, 2026

    @Syazvinski

    Please, this would be an amazing feature. Allow the user in the frontend of opencode to select a provider for openrouter.

    I'm not sure how many people use OpenRouter, but it's my main, and having a random provider or having to go mess around with JSON for every new model kills the experience.

    Hell, I can even code the feature.

  12. mindplay-dk commented on Feb 18, 2026

    @mindplay-dk

    @Syazvinski do you have any idea how to do it?

    I pored over the OpenRouter docs, and I don't see any direct way to get the provider ID - response.metadata just seems to come back empty. Ironically, error responses have provider_name in the metadata, but successful responses don't seem to have this property - I can find nothing in the docs, or in the actual response body, or headers.

    My best/only clue is the id returned with a response, but docs don't say what type of ID this is - there's zero documentation for this. There is another API here, which does return a provider_id, but for the same type input ID? You'd have to just try it and find out, but that's my best guess at the moment. Why is their documentation so bad. 😅

  13. mindplay-dk commented on Mar 8, 2026

    @mindplay-dk

    To others looking, here's how to pin your OpenRouter provider via opencode.jsonc:

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "openrouter": {
          "models": {
            "minimax/minimax-m2.5": {
              "name": "Minimax M2.5 (official)",
              "options": {
                "provider": {
                  "only": [
                    "minimax/fp8"
                  ]
                }
              }
            }
          }
        }
      }
    }

    I overpaid again today because I forgot I have to configure OpenCode on every system. 🤦‍♂️

  14. removed
    bugSomething isn't working
    on May 3, 2026
  15. XantreDev commented on May 12, 2026

    @XantreDev

    Weird enough, but the property only in providr field fails json schema check

    Image
  16. github-actions commented on Jul 12, 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.

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