(extra?: Record<string, string>)
| 105 | } |
| 106 | |
| 107 | private buildHeaders(extra?: Record<string, string>): Record<string, string> { |
| 108 | const headers: Record<string, string> = { |
| 109 | "Content-Type": "application/json", |
| 110 | ...extra, |
| 111 | }; |
| 112 | if (this.apiKey) { |
| 113 | headers["Authorization"] = `Bearer ${this.apiKey}`; |
| 114 | } |
| 115 | return headers; |
| 116 | } |
| 117 | |
| 118 | private async fetchWithRetry( |
| 119 | url: string, |