anomalyco / anomalyco/opencode

Openrouter says Opencode May Not Be Passing Provider Object to OpenRouter

Open
#41,810 2 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 11, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Guys, I am using Opencode with OpenRouter. Several times i have seen bill spikes. Upon closer inspection via the Account UI - https://openrouter.ai/logs/, i could see that OpenROuter was routing me to providers THAT WERE NOT DEFINED in my opencode.jsonc ( attached here ).

I sent email to 'Linus (Support) support@openrouter.ai' and long story short - this dude says 'OpenCode may not be passing the provider object to OpenRouter at all'. I have provided my opencode.jsonc file 2x ( along with other screenshots ) but they have refused to investigate or clarify clearly what is the issue.

Fyi, the relevant snippet in my opencode.jsonc is;

    "openrouter": {
    
        "npm": "@ai-sdk/openai-compatible",
        "name": "OpenRouter",
        
        "options": {
          "baseURL": "https://openrouter.ai/api/v1",
          "apiKey": "sk-or-v1-my-key-here",
          "setCacheKey": true          
        },
    
        "models": {
        
           "deepseek/deepseek-v4-pro": {
           
               "name": "DeepSeek V4 Pro",
               "tool_call": true,
               "reasoning": true,
               "temperature": true,
               "attachment": true,
               
               "modalities": {
               
                 "input": ["text" ],
                 "output": ["text"]
               },
               
               "limit": { 
               
                    "context": 1048576, 
                     "output": 393216  
               },

               "options": { 
               
                    "reasoningEffort": "high",               // high, xhigh
                    
                    "provider": {                            // Tell OpenRouter to use only this endpoint
                    
                         "only": ["deepseek"],
                         "allow_fallbacks": false
                    }
                    // end provider 
               }
               // end options
           }
           // end 
          
        }
        // end models 
    }
    // end openrouter 

What can i do ? Anything wrong in my config or is OpenRouer just giving me the run-around.
Thanks in advance.

Plugins

None

OpenCode version

1.18+

Steps to reproduce
  1. Any model - choose a provider and just see it drift to another model in their https://openrouter.ai/logs/ ?
Screenshot and/or share link

No response

Operating System

AlmaLinux 9.5

Terminal

XFCE Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.