pinning OpenRouter provider doesn't work #7553

Open
opened 2026-02-16 18:07:33 -05:00 by yindo · 10 comments
Owner

Originally created by @olk on GitHub (Jan 25, 2026).

Originally assigned to: @R44VC0RP on GitHub.

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

Originally created by @olk on GitHub (Jan 25, 2026). Originally assigned to: @R44VC0RP on GitHub. ### 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
yindo added the bug label 2026-02-16 18:07:33 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

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

  • #10272: Hidden calls Haiku (nearly identical - configured MiniMax M2.1 but Claude Haiku 4.5 appears in usage logs)
  • #4579: Openrouter unwated requests to Claude Haiku 4.5 (same root cause with OpenRouter provider)
  • #5674: Custom OpenAI-compatible provider options not being passed to API calls (provider configuration not respected)
  • #1010: Allow selection of inference provider when using OpenRouter (related feature request)
  • #8896: subagent provider/id parser is dead (provider configuration parsing issues)

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

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #10272: Hidden calls Haiku (nearly identical - configured MiniMax M2.1 but Claude Haiku 4.5 appears in usage logs) - #4579: Openrouter unwated requests to Claude Haiku 4.5 (same root cause with OpenRouter provider) - #5674: Custom OpenAI-compatible provider options not being passed to API calls (provider configuration not respected) - #1010: Allow selection of inference provider when using OpenRouter (related feature request) - #8896: subagent provider/id parser is dead (provider configuration parsing issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@TheHamkerCat commented on GitHub (Jan 30, 2026):

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

@TheHamkerCat commented on GitHub (Jan 30, 2026): @thdxr Openrouter requests are going to random providers, this is kinda serious
Author
Owner

@TheHamkerCat commented on GitHub (Jan 30, 2026):

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 :(

@TheHamkerCat commented on GitHub (Jan 30, 2026): I'm 100% sure OC doesn't include provider in the request <img width="1269" height="444" alt="Image" src="https://github.com/user-attachments/assets/42aaeb58-31bd-4ac0-b300-6ea4a3ce27ca" /> I chose amazon-bedrock in config and it shows Ncompass here: ```json "openai/gpt-oss-120b": { "name": "GPT OSS 120B", "options": { "OpenRouter": { "provider": { "order": [ "amazon-bedrock" ], "allow_fallbacks": false, } } } } ``` <img width="1239" height="182" alt="Image" src="https://github.com/user-attachments/assets/b54c19d4-a66a-49cf-84a2-42bced885fbe" /> 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 :(
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

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?

@rekram1-node commented on GitHub (Jan 30, 2026): 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?
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

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

@rekram1-node commented on GitHub (Jan 30, 2026): the options under a model should be sent directly as is in the request body, unless it is a special ai sdk field
Author
Owner

@TheHamkerCat commented on GitHub (Jan 30, 2026):

@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

@TheHamkerCat commented on GitHub (Jan 30, 2026): @rekram1-node I see, i was wrong, looks like in my case, this was the issue: ```json "options": { "OpenRouter": { "provider": { ``` there shouldn't have been a ```json "OpenRouter": { ``` instead ```json "options": { "provider": { ``` Thanks, this fixed it But OP's config looks correct, and he still has issues
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

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

@rekram1-node commented on GitHub (Jan 30, 2026): 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
Author
Owner

@olk commented on GitHub (Feb 2, 2026):

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

@olk commented on GitHub (Feb 2, 2026): > 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
Author
Owner

@mindplay-dk commented on GitHub (Feb 11, 2026):

@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.

@mindplay-dk commented on GitHub (Feb 11, 2026): > [@thdxr](https://github.com/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.
Author
Owner

@Syazvinski commented on GitHub (Feb 14, 2026):

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.

@Syazvinski commented on GitHub (Feb 14, 2026): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7553