| @@ -310,8 +310,14 @@ | ||
| 310 | 310 | * @return array Response data |
| 311 | 311 | * @throws \Exception If request fails |
| 312 | 312 | */ |
| 313 | 313 | private function make_request(string $endpoint, array $body = []): array { |
| 314 | + // The user's daily ceiling and kill switch are enforced here, at the | |
| 315 | + // one place every outbound OpenRouter call passes through, so no feature | |
| 316 | + // path can bypass them by forgetting to ask first (#448). | |
| 317 | + Spend_Guard::guard(); | |
| 318 | + Spend_Guard::record(); | |
| 319 | + | |
| 314 | 320 | $url = self::API_BASE_URL . '/' . ltrim($endpoint, '/'); |
| 315 | 321 | |
| 316 | 322 | $args = [ |
| 317 | 323 | 'timeout' => $this->timeout, |