Skip to content

[FEATURE] Add custom headers support (x-opencode-session) for OpenCode Go compatibility #1315

Description

@MKLKCDG

Is your feature request related to a problem? Please describe.
OpenCode Go requires a mandatory custom header (x-opencode-session) and specific User-Agent handling for all requests to its OpenAI-compatible endpoint (https://opencode.ai/zen/go/v1).
Currently, Strix fails during connection verification with Error code: 400 - MissingSessionID when using OpenCode Go via LiteLLM because these extra headers are not injected.

Describe the solution you'd like

  1. Pass through custom HTTP headers from environment variables (e.g., LITELLM_EXTRA_HEADERS) directly into LiteLLM completion calls.
  2. Alternatively, add native header injection support for x-opencode-session when connecting to OpenCode base URLs.

Describe alternatives you've considered
Currently, the only working workaround is running a local Flask/mitmproxy reverse proxy to manually inject x-opencode-session and User-Agent headers into outgoing requests.

Additional context
Example configuration that currently fails due to missing headers:

export LLM_API_KEY="sk-..."
export LLM_API_BASE="[https://opencode.ai/zen/go/v1](https://opencode.ai/zen/go/v1)"
export STRIX_LLM="openai/kimi-k2.6"

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions