-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Feature Request: Support Dynamic API Keys with apiKeyHelper
Add support for rotating JWT tokens or API keys by allowing users to configure a helper script in their configuration which opencode can then call to refresh a token based on a configurable refresh interval time.
Problem
Currently, opencode only supports static API keys. This creates friction for users who integrate to models via, for example, a liteLLM proxy using rotating tokens or api keys with short expiration times.
Requested Feature
Support an apiKeyHelper
configuration option that executes a user-defined script to generate API keys dynamically, and accepts a token refresh interval as configuration via the config files and/or env vars.
Reference
Claude Code implements this feature as explained here https://docs.anthropic.com/en/docs/claude-code/llm-gateway#litellm-configuration