MCPcopy Create free account
hub / github.com/ShipSecAI/studio / buildProviderEnv

Function buildProviderEnv

worker/src/components/ai/opencode.ts:361–382  ·  view source on GitHub ↗
(model?: { provider: string; apiKey?: string })

Source from the content-addressed store, hash-verified

359}
360
361function buildProviderEnv(model?: { provider: string; apiKey?: string }): Record<string, string> {
362 if (!model?.apiKey) {
363 return {};
364 }
365
366 switch (model.provider) {
367 case 'openai':
368 return { OPENAI_API_KEY: model.apiKey };
369 case 'openrouter':
370 return { OPENROUTER_API_KEY: model.apiKey };
371 case 'anthropic':
372 return { ANTHROPIC_API_KEY: model.apiKey };
373 case 'groq':
374 return { GROQ_API_KEY: model.apiKey };
375 case 'xai':
376 return { XAI_API_KEY: model.apiKey };
377 case 'deepseek':
378 return { DEEPSEEK_API_KEY: model.apiKey };
379 default:
380 return {};
381 }
382}
383
384componentRegistry.register(definition);

Callers 1

executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected