()
| 10 | * @throws Error if XAI_API_KEY is not found |
| 11 | */ |
| 12 | export function getGrokApiKeyFromEnv(): string { |
| 13 | try { |
| 14 | return getApiKeyFromEnv('XAI_API_KEY') |
| 15 | } catch { |
| 16 | throw new Error( |
| 17 | 'XAI_API_KEY is required. Please set it in your environment variables or use the factory function with an explicit API key.', |
| 18 | ) |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Returns a Grok client config with the default xAI base URL applied |
no test coverage detected