provod.ai / docs
API

Get current key

Spending, limits and remaining allowance for the credential making the request.

Last updated on

GET /v1/key

Read the credential used for this request, its actual spending and remaining key allowance.

Authentication

Authorization: Bearer <API_KEY>: an inference or management key.

The credential determines the workspace. X-Org-Id is unsupported.

Parameters

No request body or parameters are required.

Response · 200

The data object contains the following fields. usage* is based on ledger posting time; later refunds do not rewrite these original charges. usage_weekly and usage_monthly are not the calendar reset windows of a limit.

FieldTypeDescription
labelstringMasked key prefix; never the secret.
currencystringBilling currency: RUB.
checked_atstring (date-time)Time at which this snapshot was read.
time_zonestringReset timezone, UTC or Europe/Moscow. Read this field for existing cabinet limits.
limitnumber | nullCompatibility ceiling; null when no single limit is represented.
limit_resetstring | nulldaily, weekly, monthly; null for lifetime or no limit.
limit_remainingnumber | nullAllowance after spending and reservations, clamped to zero; null without a represented limit.
usagenumberAll-time actual charges attributed to the key.
usage_dailynumberCharges since 00:00 UTC today.
usage_weeklynumberCharges since 00:00 UTC six days ago, including today.
usage_monthlynumberCharges since 00:00 UTC 29 days ago, including today.
spend_limitsobject[]Exact limit states; empty when there is no key spending ceiling. See fields below.
creator_user_idstringUser who created the key.
workspace_idstring | nullWorkspace selected by the credential.
expires_atstring | nullISO timestamp or null for no expiration.
is_management_keybooleanTrue for management credentials.
is_provisioning_key, is_free_tierbooleanBoth false.
include_byok_in_limitbooleanAlways false; BYOK is unsupported.
byok_usage, byok_usage_daily, byok_usage_weekly, byok_usage_monthlynumberAlways zero.
organization_id, allowed_data_regions, rate_limitnullCompatibility fields; currently null.
free_model_daily_requestsobjectused, limit and remaining are numbers, all zero. No free-model quota is advertised.

spend_limits[]

FieldTypeDescription
periodstringdaily, weekly, monthly or lifetime.
limit_amount, spend_amount, reserved_amountstringExact amounts with eight decimal places in currency.
remaining_amountstringlimit_amount − spend_amount − reserved_amount; can be negative after settlement.
window_started_at, resets_atstring (date-time)Window boundaries. Lifetime does not periodically reset.

Response example

Identifiers and amounts in these examples are illustrative.

Request example

Load the key into a server environment variable. TypeScript uses Node.js fetch; Python uses only the standard library.

const response = await fetch("https://api.provod.ai/v1/key", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
console.log(await response.json());

Errors

HTTPErrorCause
401UnauthorizedMissing, invalid, disabled, revoked or expired key. The X-Org-Id header is also rejected.
403ForbiddenWrong key kind or insufficient workspace access.

Authentication error example:

{
  "message": "Invalid API key",
  "error": "Unauthorized",
  "statusCode": 401
}

Next steps

On this page