From 7bf51d5489c55398c4bf42ddef69fe3a3d9cd03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB?= Date: Sat, 30 May 2026 18:39:47 -0700 Subject: [PATCH] fix: pass apiKey in provider options (ai-sdk does not read OPENAI_API_KEY) --- container/entrypoint.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/container/entrypoint.py b/container/entrypoint.py index b5394ea..172c61f 100644 --- a/container/entrypoint.py +++ b/container/entrypoint.py @@ -94,10 +94,6 @@ def write_opencode_config(secrets: dict, role: str) -> None: litellm_key = secrets.get("litellm-key", "") - # Set the LiteLLM API key as env var — opencode reads OPENAI_API_KEY for - # openai-compatible providers - os.environ["OPENAI_API_KEY"] = litellm_key - config = { "$schema": "https://opencode.ai/config.json", "model": "litellm/copilot/claude-sonnet-4.6", @@ -107,6 +103,7 @@ def write_opencode_config(secrets: dict, role: str) -> None: "name": "LiteLLM", "options": { "baseURL": f"{LITELLM_BASE_URL}/v1", + "apiKey": litellm_key, }, "models": { "copilot/claude-sonnet-4.6": {"name": "copilot/claude-sonnet-4.6"},