Skip to content

[FEATURE]: Allow custom model headers #3499

Closed

Description

@istarkov

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

https://github.com/sst/opencode/blob/3c56dbcf5840e540eb8970805a6c725cce8e4f85/packages/opencode/src/session/prompt.ts#L271-L277

Im using anthropic models like sonnet 3.7
And there are beta headers flags which I use in my workflows

"anthropic-beta": "fine-grained-tool-streaming-2025-05-14,token-efficient-tools-2025-02-19",

fine-grained-tool-streaming-2025-05-14 - affects tools streaming (Some tools I use has really huge input (like think tool, where I'm asking the model to call tool with generated input) and would be interesting to see this streaming on the fly

token-efficient-tools-2025-02-19 for some reason allows parallel tools calls for sonnet 3.7

Pretty sure other provider/models with various flags exists.

I would like to define such headers in opencode.jsonc like

{
  "model": "...",
  "headers": {
    "openrouter/anthropic/*": {
      "anthropic-beta": "fine-grained-tool-streaming-2025-05-14,token-efficient-tools-2025-02-19"
    }
  }
}

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Oct 28, 2025
  2. rekram1-node commented on Oct 28, 2025

    @rekram1-node
    Collaborator

    itd probably make more sense under model definition, but yeah we can add this, something like allowing u to do this:

    {
     "provider": {
        "anthropic": {
          "models": {
            "claude-sonnet-4": {
              "headers": {
                // string : string pairs
              }
            }
          }
        }
      }
    }
    

    but for whatever provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussiongood first issueGood for newcomershelp-wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions