account

Your consumption this month and today

GET/v1/usage

Authentication: CF-Access-Client-Id + CF-Access-Client-Secret. Operation id getUsage.

Parameters

This route takes no parameters.

Request example

Shell
curl -s https://api.mint.xcorp.cc/v1/usage \
  -H "CF-Access-Client-Id: $MINT_ID" \
  -H "CF-Access-Client-Secret: $MINT_SECRET"

Responses

200Usage.

Headers

x-request-idstringRequest id. Quote it when contacting support.

Body application/json

Schema: Usage

FieldTypeDescription
monthstring pattern ^\d{4}-\d{2}$
ends_on optionalnull | DateLast day of your access period.
recordsCounter
requests_todayCounterRequests today (Brasília), including this one.
images_todayCounter
as_of optionalDate

Example

JSON
{
  "month": "2026-11",
  "ends_on": "2027-01-31",
  "records": {
    "used": 840,
    "limit": 5000,
    "remaining": 4160
  },
  "requests_today": {
    "used": 37,
    "limit": 5000
  },
  "images_today": {
    "used": 12,
    "limit": 1000
  },
  "as_of": "2026-11-08"
}
400Invalid, unknown or repeated parameter (bad_request, with detail = {param, why}), date before the window (window, first accepted date in detail.first_date) or invalid cursor (bad_cursor: tampered, expired, from another credential, other filters or another day; restart without cursor). BadRequest

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "window",
  "message": "Dates before 2026-10-09 are outside the 30-day window. Use since/from on or after that date; for older trends use /v1/stats.",
  "detail": {
    "first_date": "2026-10-09"
  }
}
403No valid credential (forbidden), access disabled (disabled) or access period over (access_ended). Do not retry; contact XCORP. Forbidden

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "access_ended",
  "message": "Your access period has ended. Contact XCORP."
}
405Only GET is allowed (HEAD and OPTIONS too return 405). MethodNotAllowed

Headers

allow"GET"Allowed methods: GET.

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "method_not_allowed",
  "message": "This API is read-only. Use GET."
}
429A limit of your access plan was reached. detail.limit is minute (requests per minute), day (requests per day), images (images per day) or budget (distinct messages per month). Wait retry-after seconds. Your limits: /v1/usage. RateLimited

Headers

retry-afterintegerSeconds to wait before retrying.
x-request-idstringRequest id. Quote it when contacting support.

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "rate_limited",
  "message": "Too many requests per minute. Wait for retry-after seconds, then continue.",
  "detail": {
    "limit": "minute"
  }
}
500Unexpected error (internal). Retry later; quote x-request-id to support. Internal

Headers

x-request-idstringRequest id. Quote it when contacting support.

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "internal",
  "message": "Unexpected error. Retry later and quote x-request-id if it persists."
}
503Service temporarily disabled for all clients (disabled). Retry after retry-after seconds. Disabled

Headers

retry-afterintegerSeconds to wait before retrying.
x-request-idstringRequest id. Quote it when contacting support.

Body application/json

Schema: Error

FieldTypeDescription
errorstring one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal"
messagestringWhat happened and what to do, in English.
detail optionalanyExtra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited.

Example

JSON
{
  "error": "disabled",
  "message": "The service is temporarily disabled. Try again later."
}