List Customer Usage Log
Deprecated. Use List Customer Usage Log on events.clocknext.com; @clocknext/sdk 0.20 and later already do. One customer's usage (credit, outcome, unit, wallet and composite rows) in one feed, sorted by time. Paged with limit and cursor; narrow it with from and to.
Deprecated
Base URL https://payments.clocknext.com/api/v1
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
customerId?stringOur customer id. Send this or externalId; with neither, the answer is a 400 "Provide customerId or externalId."
externalId?stringYour own id for the customer, in place of customerId.
^[A-Za-z0-9-]{1,64}$1 <= length <= 64limit?integerMaximum rows to return. Must be a positive number; clamped to 1–200.
1 <= value <= 20050cursor?stringOpaque token from a previous response's nextCursor. Omit for the first page.
from?stringFirst day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no lower bound. Keep sending the same value while paging with cursor.
dateto?stringLast day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no upper bound. Must not be before from.
dateA page of usage logs, most recent first.
application/json- response
statusCode*integerThe HTTP status code of the response, repeated in the body.
statusDetail*The status of the request. status is SUCCESS, and message says what happened.
result*The data of the answer.
curl -X GET 'https://payments.clocknext.com/api/v1/signal/usage-log?customerId=cus_abc123&limit=25&cursor=eyJ0cyI6IjIwMjYtMDktMjJUMTM6MDA6NTIuNzU0WiIsImlkIjoibG9nXzhtM241cCJ9&from=2026-10-01&to=2026-10-07'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "usageLogs": [ { "id": "01a15a16-01d4-761e-baec-dbe7f088c96c", "customerId": "cmvgva5po000c07iir1vtn8vl", "createdAt": "2026-10-20T16:12:34.132Z", "member": null, "entitlement": { "type": "UNIT", "id": "cmvgv92mk000n08l5jjjxnnul", "name": "PDF Export", "agentKey": "pdf_export", "billingMode": "ADVANCE", "useWalletForArrear": false }, "status": "SUCCESS", "llm": null, "credit": null, "outcome": null, "outcomeCompletion": null, "composite": null, "unit": { "unitsUsed": 1, "customerCost": 0.25 }, "wallet": null, "coveredByComposite": null, "custom": null }, { "id": "01a15a15-ff39-734c-957c-d0387537a318", "customerId": "cmvgva5po000c07iir1vtn8vl", "createdAt": "2026-10-20T16:12:33.465Z", "member": "Priya Raman", "entitlement": { "type": "CREDIT", "id": "cmvgvfd63000508l2oexbgpzs", "name": "Chat Message", "agentKey": "chat_message", "billingMode": "ADVANCE", "useWalletForArrear": false }, "status": "SUCCESS", "llm": { "model": { "name": "GPT-4o mini", "provider": "OpenAI" }, "usage": { "inputTokens": 2000, "outputTokens": 500, "cacheTokens": 0, "cacheWriteTokens": 0 }, "cost": { "providerCost": 0.0006, "customerCost": 0.00084 } }, "credit": { "creditsUsed": 0.701754386, "customerCost": 0.00084, "appliedRules": [] }, "outcome": null, "outcomeCompletion": null, "composite": null, "unit": null, "wallet": null, "coveredByComposite": null, "custom": null }, { "id": "01a15a15-d708-7784-a954-24cad1d90e00", "customerId": "cmvgva5po000c07iir1vtn8vl", "createdAt": "2026-10-20T16:12:23.176Z", "member": null, "entitlement": { "type": "OUTCOME_COMPLETION", "id": "cmvgvffng000808l237059in9", "name": "Resolved Support Ticket", "agentKey": "support_ticket", "billingMode": "ADVANCE", "useWalletForArrear": false }, "status": "SUCCESS", "llm": null, "credit": null, "outcome": null, "outcomeCompletion": { "runId": "TCK-48299", "outcomeUsed": 1, "customerCost": 0.126023 }, "composite": null, "unit": null, "wallet": null, "coveredByComposite": null, "custom": null } ], "nextCursor": "eyJ0cyI6I…redacted" }}Types
Every object type on this page, with its fields.
UsageLogEntry
One counted signal, as the usage log and the lookup return it. Only the group of entitlement.type is set; the others are null. Money is USD, 6 decimals. A row a composite covers shows 0.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The signal id, in lower case. |
customerId | string | yes | The ClockNext id of the customer. A signal sent with externalId shows the customer's ClockNext id here. |
createdAt | string | yes | When the API received the signal. |
member | string | null | yes | The member's name; on an OUTCOME_COMPLETION row, the member's email. null when the signal named no member. |
entitlement | object | yes | What this row is for. |
status | "SUCCESS" | yes | Always SUCCESS: only counted signals are rows. |
llm | UsageLogLlm | yes | The model call of a CREDIT, OUTCOME or WALLET row; null on the others. |
credit | object | null | yes | Set only on a CREDIT row. |
outcome | EventsUsageLogOutcomeAttribution | null | yes | Set only on an OUTCOME row (one step of a run). |
outcomeCompletion | object | null | yes | Only on OUTCOME_COMPLETION. outcomeUsed is 1, or 0 when a composite covers the run. |
composite | object | null | yes | Only on COMPOSITE. refId is the composite key, value the composite value you sent. |
unit | object | null | yes | Set only on a UNIT row. customerCost is the price of these units on your plan's tiers. |
wallet | object | null | yes | What each wallet paid, in USD; amount is fromMainWallet + fromReservedWallet. |
coveredByComposite | object | null | yes | The composite charged for this row instead (its key and value). null when the row is charged by itself. |
custom | object | null | yes | The custom object sent with this signal, as sent. null when none was sent. |
UsageLogEntry.entitlement
What this row is for.
| Field | Type | Required | Description |
|---|---|---|---|
type | "CREDIT" | "OUTCOME" | "OUTCOME_COMPLETION" | "UNIT" | "COMPOSITE" | "WALLET" | yes | OUTCOME: a step of a run. OUTCOME_COMPLETION: a run completed. COMPOSITE: a composite completed. |
id | string | null | yes | The credit, outcome, unit or composite id. null on a WALLET row. |
name | string | null | yes | The name of the credit, outcome, unit or composite. null on a WALLET row. |
agentKey | string | null | yes | The agentKey sent (the step's key on an OUTCOME row). null on COMPOSITE and WALLET rows. |
billingMode | "ADVANCE" | "ARREAR" | null | yes | ADVANCE: taken from the prepaid balance. ARREAR: billed at the cycle end. null on a WALLET row. |
useWalletForArrear | boolean | yes | True when the row took money from a wallet (a WALLET row, or ARREAR on a wallet-funded plan). |
UsageLogEntry.llm
| Field | Type | Required | Description |
|---|---|---|---|
model | object | yes | The model's name in your workspace (or the model id) and its provider. |
usage | UsageLogUsage | yes | The token counts of the model call. |
cost | object | yes | The cost of the model call, in USD. |
UsageLogEntry.llm.model
The model's name in your workspace (or the model id) and its provider.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | null | yes | The model's name in your workspace, or the model id. null when the model is not known. |
provider | string | null | yes | The model's provider, for example OpenAI. null when the provider is not known. |
UsageLogUsage
| Field | Type | Required | Description |
|---|---|---|---|
inputTokens | integer | yes | Input (prompt) tokens of the model call. |
outputTokens | integer | yes | Output (completion) tokens of the model call. |
cacheTokens | integer | yes | Cache-read tokens. |
cacheWriteTokens | integer | yes | Cache-write tokens. |
UsageLogEntry.llm.cost
The cost of the model call, in USD.
| Field | Type | Required | Description |
|---|---|---|---|
providerCost | number | yes | USD. |
customerCost | number | yes | USD. |
UsageLogEntry.credit
| Field | Type | Required | Description |
|---|---|---|---|
creditsUsed | number | yes | Credits taken from the plan. |
customerCost | number | yes | USD: the credits at your price. |
appliedRules | EventsUsageLogAppliedRule[] | yes | The credit rules that set the charge of this row. Empty when no rule matched. |
EventsUsageLogAppliedRule
| Field | Type | Required | Description |
|---|---|---|---|
ruleId | string | null | no | The credit rule that matched. null when that rule was deleted later. |
ruleName | string | yes | The rule's name when it matched. It stays the same when the rule is renamed or deleted. |
mode | "MARGIN" | "CREDIT" | null | yes | MARGIN: another margin on the model cost. CREDIT: a fixed number of credits. null on older rows. |
marginPercentApplied | number | null | yes | The margin a MARGIN rule applied; null for a CREDIT rule. |
creditsApplied | number | yes | The credits this rule set. |
EventsUsageLogOutcomeAttribution
| Field | Type | Required | Description |
|---|---|---|---|
stepNumber | integer | null | yes | The step's position in the outcome. A step may repeat within a run. |
stepName | string | null | yes | The name of the outcome step this signal performed. null when the step has no name. |
runId | string | null | yes | Your run id. Every step of one run has it. |
closedRun | boolean | yes | True when the run has a completion. |
customerCost | number | yes | Always 0: the run is charged at its completion. |
UsageLogEntry.outcomeCompletion
| Field | Type | Required | Description |
|---|---|---|---|
runId | string | null | yes | Your run id, sent with the run's signals. null when the completion has no run id. |
outcomeUsed | number | yes | Outcomes taken from the plan: 1, or 0 when a composite covers the run. |
customerCost | number | yes | The outcome's price on your plan, in USD. 0 when a composite covers the run. |
UsageLogEntry.composite
| Field | Type | Required | Description |
|---|---|---|---|
refId | string | yes | The composite key. |
value | string | yes | The composite value you sent for this composite occurrence. |
compositeUsed | number | yes | Composite occurrences taken from the plan. Always 1. |
customerCost | number | yes | The composite's price on your plan, in USD. |
UsageLogEntry.unit
| Field | Type | Required | Description |
|---|---|---|---|
unitsUsed | number | yes | Units taken from the plan. 0 when a composite covers the row. |
customerCost | number | yes | The price of these units on your plan's tiers, in USD. 0 when a composite covers the row. |
UsageLogEntry.wallet
| Field | Type | Required | Description |
|---|---|---|---|
fromMainWallet | number | yes | What the main wallet paid, in USD. |
fromReservedWallet | number | yes | What the Reserved Wallet paid, in USD. |
amount | number | yes | What the wallets paid in total, in USD. It is fromMainWallet + fromReservedWallet. |
UsageLogEntry.coveredByComposite
| Field | Type | Required | Description |
|---|---|---|---|
refId | string | yes | The composite key of the composite that is charged for this row. |
value | string | yes | The composite value you sent for that composite occurrence. |
Adjust a customer's invoice balance POST
Previous Page
Look Up Usage Logs by ID GET
Deprecated. Use [Look Up Usage Logs by ID](/docs/api-reference/signals/eventsLookupUsageLogs) on `events.clocknext.com`; `@clocknext/sdk` 0.20 and later already do. Up to 10 usage-log rows by id, from any customer of your organization, in the order of `ids`. Duplicates are removed; ids that match nothing are in `notFound`.