MCPcopy Create free account
hub / github.com/Jackywine/Bella / setAPIKey

Method setAPIKey

cloudAPI.js:50–60  ·  view source on GitHub ↗
(provider, apiKey)

Source from the content-addressed store, hash-verified

48
49 // Set API key
50 setAPIKey(provider, apiKey) {
51 if (this.apiConfigs[provider]) {
52 if (provider === 'openai' || provider === 'qwen' || provider === 'glm') {
53 this.apiConfigs[provider].headers['Authorization'] = `Bearer ${apiKey}`;
54 } else if (provider === 'ernie') {
55 this.apiConfigs[provider].accessToken = apiKey;
56 }
57 return true;
58 }
59 return false;
60 }
61
62 // Switch AI service provider
63 switchProvider(provider) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected