MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / resolveZenApiKey

Function resolveZenApiKey

src/zenModels.ts:24–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22let providers: ProviderBundle | undefined;
23
24function resolveZenApiKey(): string {
25 for (const envName of API_KEY_ENV_VARS) {
26 const value = process.env[envName]?.trim();
27 if (value) {
28 return value;
29 }
30 }
31
32 assert(
33 false,
34 [
35 "Missing OpenCode Zen API key.",
36 "Set OPENCODE_API_KEY before running the CLI.",
37 "See https://opencode.ai/docs/zen/ for instructions.",
38 ].join(" "),
39 );
40}
41
42function resolveZenBaseUrl(): string {
43 const configured = process.env.OPENCODE_ZEN_BASE_URL?.trim();

Callers 1

ensureProvidersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected