GRANSKA

AI service availability

GEThttps://api.granska.cloud/v1/ai-status

Reads the latest saved AI service availability verdict. Takes a bearer token but spends no runs.

Bearer tokenSpends no quota

Read before a review

Call GET /v1/ai-status with your usual bearer token when an integration needs to tell a user whether a live AI review is likely to work. It reports the same saved production measurement as the public service status page. Staging also reads that production measurement. Calling it never starts a model call. This request spends no analysis run. Polling every minute is sufficient; the measurement is normally produced every 15 minutes.

GET /v1/health only confirms that the gateway answers requests. It does not measure the AI service. A healthy AI status is a recent synthetic check, not a promise that an individual review will succeed. Likewise, an analysis can succeed while the aggregate says Degraded. Continue to handle the result or error of POST /v1/analyze as the authority for that request.

Request
curl https://api.granska.cloud/v1/ai-status \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "checkedAt": "2026-10-14T09:15:00.000Z",
  "nextExpectedAt": "2026-10-14T09:30:00.000Z",
  "state": "operational",
  "lastCheckPassed": true,
  "responseTimeMs": 1200,
  "recentChecksPassed": 3,
  "recentChecksTotal": 3,
  "delivery": "normal",
  "history": []
}

Interpret the response

state is a stable code: operational, degraded, major_disruption, unavailable, or unknown. Localize these codes in your own interface; the API does not translate them.

checkedAt is when the most recent probe completed. nextExpectedAt is the next planned check. responseTimeMs is the duration of the entire model response, or null if that check received no usable response. lastCheckPassed says whether the last check received a usable response. recentChecksPassed and recentChecksTotal summarize the last three checks. delivery summarizes recent real analysis delivery. history contains up to 48 half-hour status buckets.

A measurement older than 30 minutes has state: "unknown", even if its last probe succeeded; its timestamps remain so you can show when it was last checked. If the saved feed is unavailable, the endpoint still answers 200 with state: "unknown", checkedAt: null, nextExpectedAt: null, lastCheckPassed: null, responseTimeMs: null, zero recent checks and an empty history. Unknown means the status cannot be verified. A completed probe with no usable response is classified from that observed failure; it is not the same as a missing feed.

The values are advisory. Do not convert a warning into an automatic 503 for your users or infer that Google caused the condition. The actual analysis request remains available to try.

curl https://api.granska.cloud/v1/ai-status \
  -H "Authorization: Bearer $TOKEN"
{
  "checkedAt": null,
  "nextExpectedAt": null,
  "state": "unknown",
  "lastCheckPassed": null,
  "responseTimeMs": null,
  "recentChecksPassed": 0,
  "recentChecksTotal": 0,
  "delivery": "unavailable",
  "history": []
}

Errors

An invalid or missing bearer token follows the same authentication errors as other protected routes. An unavailable status feed is different: the request succeeds with an Unknown verdict.

ErrorWhen
401
UNAUTHORIZED
The Authorization header is missing, is not a readable bearer token, or names no tenant.
401
TOKEN_EXPIRED
The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime.
500
INTERNAL_ERROR
An unexpected server-side failure. Not probable from outside — reaching it means something is wrong.