| 180 | signal: abortController?.signal, |
| 181 | onProgress: onAccessProgress, |
| 182 | modelId, |
| 183 | reasoningEnabled |
| 184 | }, request => request._streamCompletion(messages, modelId, token, onChunk, |
| 185 | onTokenUpdate, files, searchEnabled, abortController, onStreamOpen, |
| 186 | onReasoningChunk, reasoningEnabled, reasoningEffort)); |
| 187 | } |
| 188 | |
| 189 | // Get API key - only use ticket-based key |
| 190 | getApiKey() { |
| 191 | const key = apiKeyStore.getApiKey(); |
| 192 | if (!key) return null; |
| 193 | if (apiKeyStore.isExpired()) return null; |
| 194 | return key; |
| 195 | } |
| 196 | |
| 197 | getCachedModels() { |
| 198 | const cachedModels = loadModelCatalog(OPENROUTER_BACKEND_ID); |
| 199 | if (!Array.isArray(cachedModels)) { |
| 200 | return []; |