You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
@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.
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.
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. 😅
Activity
github-actions commentedon Jan 25, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
TheHamkerCat commentedon Jan 31, 2026
@thdxr Openrouter requests are going to random providers, this is kinda serious
TheHamkerCat commentedon Jan 31, 2026
I'm 100% sure OC doesn't include provider in the request
I chose amazon-bedrock in config and it shows Ncompass here:
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 :(
rekram1-node commentedon Jan 31, 2026
If I set:
and look in the request body sent to openrouter, I see:
Is this incorrect?
rekram1-node commentedon Jan 31, 2026
the options under a model should be sent directly as is in the request body, unless it is a special ai sdk field
TheHamkerCat commentedon Jan 31, 2026
@rekram1-node
I see, i was wrong, looks like in my case, this was the issue:
there shouldn't have been a
"OpenRouter": {instead
Thanks, this fixed it
But OP's config looks correct, and he still has issues
rekram1-node commentedon Jan 31, 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
olk commentedon Feb 2, 2026
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
mindplay-dk commentedon Feb 11, 2026
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.
Syazvinski commentedon 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.
mindplay-dk commentedon Feb 18, 2026
@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.metadatajust seems to come back empty. Ironically, error responses haveprovider_namein themetadata, 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
idreturned 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 aprovider_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. 😅mindplay-dk commentedon Mar 8, 2026
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. 🤦♂️
XantreDev commentedon May 12, 2026
Weird enough, but the property
onlyinprovidrfield fails json schema checkgithub-actions commentedon Jul 12, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.