Account & Credits

Read your credit balance and account profile with a single API key request — check funds before createTask.

GET /api/v1/account returns the account that owns the API key you send: its credit balance and profile. Studio and the REST API share one account and one balance, so this is the same number you see in the console.

Use it to:

  • check you have enough credits before calling createTask;
  • show a balance in your own dashboard or alert when it runs low.

Request

GET https://kinovi.ai/api/v1/account

No query parameters and no body. Authenticate like every other endpoint — see Authentication.

curl -s https://kinovi.ai/api/v1/account \
  -H "Authorization: Bearer $KINOVI_API_KEY"

Response

200 OK

{
  "userId": "usr_abc",
  "email": "[email protected]",
  "name": "Dev",
  "credits": 1280.5,
  "createdAt": 1767323045000
}
FieldTypeDescription
userIdstringAccount id. Stable; safe to use as your own reference.
emailstringAccount email.
namestring | nullDisplay name, or null if never set.
creditsnumberCurrent credit balance. Credits already reserved by in-flight tasks are deducted; credits from a failed task come back once it reaches fail. May be fractional (for example 1280.5).
createdAtnumberUnix epoch milliseconds when the account was created.

The response is never cached (Cache-Control: no-store), so every call reads the live balance.

What is not returned

The endpoint never returns the API key itself, payment details, order history, API tier, concurrency usage, or internal flags. Per-task cost is on recordInfo as creditsUsed; price lists are on each model page. Concurrency limits are documented on the API Reference.

Check the balance before submitting

Credits are reserved when createTask returns. If the balance is lower than the cost, createTask answers 402 with required and available. Calling /account first lets you stop earlier, or top up, instead of handling the error mid-batch.

import os
import requests

API = "https://kinovi.ai/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['KINOVI_API_KEY']}"}


def get_account() -> dict:
    res = requests.get(f"{API}/account", headers=HEADERS, timeout=15)
    res.raise_for_status()
    return res.json()


account = get_account()
print(f"{account['email']}: {account['credits']} credits")
if account["credits"] < 50:
    raise SystemExit("Low balance - top up at https://kinovi.ai/dashboard/billing")

Not a reservation

A balance check does not hold credits. Another task, or Studio, can spend them between your check and createTask. Keep handling 402 on createTask as the source of truth.

Errors

HTTPBodyWhen
401{ "message": "Missing Authorization header" }No header at all.
401{ "message": "Invalid Authorization format. Use: Bearer YOUR_API_KEY" }Header present but not Bearer <key>.
401{ "message": "Invalid API Key" }Key does not exist.
401{ "message": "API Key is inactive" } / "API Key has expired"Key was disabled or has passed its expiry.
401{ "message": "User not found" }The account behind the key no longer exists.
500{ "message": "Internal server error" }Unexpected error. Retry with backoff.