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.
| Field | Type | Description |
|---|---|---|
label | string | Masked key prefix; never the secret. |
currency | string | Billing currency: RUB. |
checked_at | string (date-time) | Time at which this snapshot was read. |
time_zone | string | Reset timezone, UTC or Europe/Moscow. Read this field for existing cabinet limits. |
limit | number | null | Compatibility ceiling; null when no single limit is represented. |
limit_reset | string | null | daily, weekly, monthly; null for lifetime or no limit. |
limit_remaining | number | null | Allowance after spending and reservations, clamped to zero; null without a represented limit. |
usage | number | All-time actual charges attributed to the key. |
usage_daily | number | Charges since 00:00 UTC today. |
usage_weekly | number | Charges since 00:00 UTC six days ago, including today. |
usage_monthly | number | Charges since 00:00 UTC 29 days ago, including today. |
spend_limits | object[] | Exact limit states; empty when there is no key spending ceiling. See fields below. |
creator_user_id | string | User who created the key. |
workspace_id | string | null | Workspace selected by the credential. |
expires_at | string | null | ISO timestamp or null for no expiration. |
is_management_key | boolean | True for management credentials. |
is_provisioning_key, is_free_tier | boolean | Both false. |
include_byok_in_limit | boolean | Always false; BYOK is unsupported. |
byok_usage, byok_usage_daily, byok_usage_weekly, byok_usage_monthly | number | Always zero. |
organization_id, allowed_data_regions, rate_limit | null | Compatibility fields; currently null. |
free_model_daily_requests | object | used, limit and remaining are numbers, all zero. No free-model quota is advertised. |
spend_limits[]
| Field | Type | Description |
|---|---|---|
period | string | daily, weekly, monthly or lifetime. |
limit_amount, spend_amount, reserved_amount | string | Exact amounts with eight decimal places in currency. |
remaining_amount | string | limit_amount − spend_amount − reserved_amount; can be negative after settlement. |
window_started_at, resets_at | string (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
| HTTP | Error | Cause |
|---|---|---|
401 | Unauthorized | Missing, invalid, disabled, revoked or expired key. The X-Org-Id header is also rejected. |
403 | Forbidden | Wrong key kind or insufficient workspace access. |
Authentication error example:
{
"message": "Invalid API key",
"error": "Unauthorized",
"statusCode": 401
}