API reference

Response headers

The headers that the Check API sets, and the responses that carry each one.

Request ID, version, and region

HeaderDescription
X-Request-IdThe ID of the request. The Check API writes req_ followed by 26 letters and digits. The ID is equal to data.requestId of a 200 and to traceId of an error.
X-Api-VersionThe API version from the path, such as v1.
X-RegionThe region that answered. JP for https://api.jp.flowmask.ai.

The Check API always sets its own X-Request-Id. It ignores an X-Request-Id header in the request. Log the ID with each request. Support asks for it when you report a problem.

Most responses have these three headers. These responses have no X-Api-Version and no X-Region.

  • A 404 api_version_not_supported response, because the version in the path does not exist.
  • A 404 not_found response for a path outside /api/<version>/, such as /check.
  • A 400 or a 503 from the network in front of the Check API. That network answers 400 validation_failed with the field error text_too_long for a body over 8 MiB. It answers 503 service_unavailable when the Check API does not answer, or answers too late. Its X-Request-Id does not start with req_.
  • A 403 that is not JSON, or an HTML 502, 503, or 504, from the network in front of the Check API. Such a response can also have no X-Request-Id. See Answers outside the envelope.

Headers on a 200

HeaderDescription
Cache-Controlno-store. Do not cache the answer.
X-Ignored-FieldsThe top-level fields of the body that the Check API ignored, such as lang, userId. Present only when the body had such a field. See Unknown fields.
X-RateLimit-RemainingThe requests left in the current minute.
X-RateLimit-ResetThe seconds until the count of the minute starts again.
X-Quota-Tokens-RemainingThe input tokens left this month.
X-Quota-ResetThe time when the monthly quota starts again.

Rate limits and quota describes the last four headers.

Headers by response

Every response in this table but the last row has X-Request-Id. The table lists the other headers of each response.

ResponseHeaders
200X-Api-Version, X-Region, Cache-Control, X-RateLimit-Remaining, X-RateLimit-Reset, X-Quota-Tokens-Remaining, and X-Quota-Reset. Also X-Ignored-Fields when the Check API ignored a field.
429 rate_limitedX-Api-Version, X-Region, Retry-After, X-RateLimit-Remaining, X-RateLimit-Reset, X-Quota-Tokens-Remaining, and X-Quota-Reset
429 monthly_quota_exceededX-Api-Version, X-Region, Retry-After, X-RateLimit-Remaining, X-Quota-Tokens-Remaining, and X-Quota-Reset
400, 401, 500, 503, and 404 not_found for a path under /api/v1/X-Api-Version and X-Region
404 api_version_not_supportedNone
404 not_found for a path outside /api/<version>/None
400 or 503 from the network in front of the Check APINone
403 that is not JSON, or HTML 502, 503, or 504None. X-Request-Id can be absent too.

On this page