Public API v1

Usage of this key (or the whole account) over a window

Changed on

Totals by outcome, tokens, characters, seconds of audio and generation time, broken down per day, per route, per voice and per error code — from the per-call ledger every /v1 call is recorded in. POST /v1/tts rows start queued and close as ok/error when the job finishes; cache_hit is a request served from the content cache. tokenCost is what was deducted before the call ran. Calls refused by the rate limiter never reach the ledger. Window capped at 92 days; default the last 30.

get/api/v1/usage

Request

  • Base URL
    https://api.vieneu.io
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Query parameters

fromstring

ISO date; default 30 days before to.

tostring

ISO date; default now. Window capped at 92 days.

scope'key' | 'account'

key (default): the calling key only. account: every key on the account.

Response

The summary for the window.

scope'key' | 'account' required
apiKeyIdstring nullable

The key summarised (scope=key).

userIdstring nullable

The account summarised (scope=account).

fromstring required
tostring required

Example response

{
  "scope": "key",
  "apiKeyId": "6a9c6359b5ea49e3ae862c1c",
  "userId": "6a9c3db7b5ea49e3ae862a86",
  "from": "2026-08-14T00:00:00.000Z",
  "to": "2026-09-13T00:00:00.000Z",
  "totals": {
    "requests": 812,
    "ok": 780,
    "queued": 3,
    "cacheHit": 12,
    "denied": 15,
    "error": 2,
    "tokenCost": 61250,
    "characters": 40810,
    "audioSeconds": 3312.4,
    "avgGenMs": 2140,
    "p95GenMs": 5300
  },
  "byDay": [
    {
      "day": "2026-09-10",
      "requests": 120,
      "ok": 118,
      "denied": 1,
      "error": 1,
      "tokenCost": 9000,
      "characters": 6000,
      "audioSeconds": 480.2,
      "avgGenMs": 2100
    }
  ],
  "byRoute": [
    {
      "route": "clone",
      "requests": 782,
      "ok": 780,
      "denied": 1,
      "error": 1,
      "tokenCost": 58650,
      "avgGenMs": 2140
    }
  ],
  "byVoice": [
    {
      "voice": "Binh",
      "voiceName": "Thanh Bình",
      "engine": "v4",
      "requests": 300,
      "tokenCost": 22500,
      "audioSeconds": 1260.5,
      "avgGenMs": 1980
    }
  ],
  "byErrorCode": [
    {
      "errorCode": "synthesis_timeout",
      "statusCode": 500,
      "count": 2,
      "lastAt": "2026-09-10T01:02:03.000Z"
    }
  ]
}

Changes