You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fold the model catalogue into Complete Model List, restyle service endpoints
The catalogue and Complete Model List documented the same endpoint twice, so the
catalogue content moves into Complete Model List and its own page becomes a
hidden pointer. Keeping a full second copy would have reproduced the duplicate
search collision that GITBOOK-1168 just fixed.
- Complete Model List now covers GET /v1/models end to end: include sections,
filters, the singular GET /model/{id} lookup, pricing and ETag caching
- models.json rewritten for /v1/models with the real response shape. The page
had been documenting fields that no longer exist: the response is
{object, data}, not a bare array, there is no features or endpoints array,
docs_url is docsUrl, maxTokens is outputMax, and aliases/tags/docsJson were
missing. Examples are now taken from live responses.
- All catalogue URLs point at the canonical /v1/models, with a note that
/models and /api/v1/models serve the same data
- Complete Model List, Usage Logs, Model Performance Metrics and Account Balance
adopt the API Key Management layout: a routing table of endpoints, then one
section per endpoint. Parameter tables that the rendered schema already draws
are gone; the traps that would break an integration stay as hints.
- Account Balance leads with the v2 endpoints; the legacy /v1/billing/balance
moves to the bottom, anchor unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`GET /v2/billing/transactions` answers "where did the balance go". Each entry is one movement of money — either a **successful top-up** or a **charge**, and a charge carries the model that produced it.
29
+
The account money feed: one entry per balance movement, either a successful top-up or a charge carrying the model that produced it. Authenticate with a **regular** AIML API key — there is no `key_prefix`, because a wallet belongs to the account, not to a key.
36
30
37
-
Authenticate with a **regular** AIML API key. There is no `key_prefix` here: a wallet belongs to the account, not to a key, so the endpoint always answers for the account behind the key you used.
31
+
For a `MODEL_USAGE` charge, `reference_id` is the inference id — the same value returned in the `x-inference-id` response header and reported as `inference_id` in [Usage Logs](usage-logs.md).
38
32
39
33
{% hint style="info" %}
40
34
This is the account ledger — the same figures that move your balance — so it is what you reconcile against. [API Key Usage](api-key-usage.md) and [Usage Logs](usage-logs.md) come from the analytics pipeline instead, and are meant for attribution and budgeting.
41
-
{% endhint %}
42
-
43
-
### Reading an entry
44
-
45
-
`amount` is **always positive**; `direction` is what carries the sign — `TOPUP` for money in, `CHARGE` for money out. `type` says what produced the entry: `PAYMENT`, `BONUS`, `REFUND`, `ADJUSTMENT`, `MODEL_USAGE`, `CREDITS_EXPIRED` or `INIT`.
46
-
47
-
`reference_id` is what makes an entry joinable to something you already have. For a `MODEL_USAGE` charge it is the **inference id** — the same value returned in the `x-inference-id` response header, reported as `inference_id` in [Usage Logs](usage-logs.md), and, for an async generation, the `generation_id` that submit returned. For a payment it is the payment transaction id. It is `null` when there is nothing on your side to point at, such as a bonus, an expiry or a manual adjustment.
48
-
49
-
`model` is `null` on top-ups, on charges that are not model usage, and in the rare case where the model could not be resolved.
Paging is **cursor-based**. Take `pagination.next_cursor` from a response and pass it back as `cursor` to get the next page; it is `null` once you reach the end.
60
-
61
-
{% hint style="warning" %}
62
-
Do not page this endpoint by offset, and do not rebuild the cursor. The ledger grows at the head, so a numeric offset silently skips or repeats entries between pages. The cursor is opaque and is accepted **only in the exact form we issued** — re-encoding it is rejected with `400`.
36
+
A charge lands **after** you saw your response, and for async video after the generation reports `completed`, so reconciling the instant a generation finishes will under-count. Failed requests are never charged and have no entry here at all.
63
37
{% endhint %}
64
38
65
-
{% hint style="info" %}
66
-
A charge lands **after** you saw your response — it is applied when the request completes on the billing side, and for async video after the generation reports `completed`. Reconciling the instant a generation finishes will under-count. Failed requests are not charged at all, so they have no entry here.
67
-
68
-
Timestamps are UTC, and a balance may legitimately go negative — overdraft is allowed.
39
+
{% hint style="warning" %}
40
+
Page with the cursor, never with an offset. The ledger grows at the head, so a numeric offset silently skips or repeats entries between pages. Pass `pagination.next_cursor` back as `cursor` — it is opaque and accepted only in the exact form we issued, so re-encoding it is rejected with `400`.
69
41
{% endhint %}
70
42
71
43
Returns the account's balance movements, newest first.
|`400`|`to` not later than `from`; an unknown query parameter; `limit` outside 1–100; an unknown `direction` or `type`; a malformed or re-encoded cursor |
82
54
|`401`| Missing or invalid key |
83
55
|`403`| A management key — this route is for regular keys |
56
+
57
+
***
58
+
59
+
### Get account balance info
60
+
61
+
{% hint style="warning" %}
62
+
This endpoint is considered legacy and is scheduled for future deprecation.\
63
+
Please plan to migrate to the `/v2/billing` and `/v2/billing/detail` endpoints documented above.
0 commit comments