Documentation
Signals
Every usage report your servers send, with its status, its cost and why it was not counted, plus Retry and Reject.
A Signal is one usage report that your server sends to Clocknext: one LLM call on a Credit or the Wallet, one Outcome step, one Outcome completion, one Unit report, or one Composite completion. Clocknext prices each Signal against the Customer's Plan and counts it in the background, a moment after it accepts it.
The Signals page lists every Signal of your Organisation with its status. It shows what was counted, what waits, and why.
What you can do here
- Read every Signal of your Organisation, newest first, in 4 tabs.
- Filter a tab by Model, Type and Status, and choose the Period.
- Turn on Auto to reload the tab every 5 seconds, or click Refresh for one reload.
- Open Raw data to see the request body that your server sent.
- Open the error of a Pending Signal to see why it was not counted.
- Retry a Pending Signal after you fix the cause, or Mark as rejected to close it. Only an Owner or an Admin can do this.
The tabs
| Tab | What it shows |
|---|---|
| Credits & Outcomes | Credit, Outcome step and Wallet Signals, with the tokens and the cost. |
| Units | Unit Signals, with their quantity and cost (provider / customer). |
| Composites | The Signals of your Composites, with their composite value. |
| Logs | Outcome completions and Composite completions. |
The same tables show on the Signals tab of each Credit, Outcome, Unit and Composite, and on the Customer page.
Statuses
Each Signal has one of 3 statuses:
- Success: Clocknext counted the Signal. It is in the cost, the balances and the invoice.
- Pending: Clocknext could not count the Signal yet. The error tells you why, for example "the credit is not on the customer's plan" or "no customer with external id …". Nothing is counted until you retry it.
- Rejected: final. The Signal is never counted. Clocknext rejects a Signal after 11 attempts, or an Owner or an Admin rejects it.
A Pending Signal is never billed to another entitlement. For example, a Credit that the Plan does not sell stays Pending. The Wallet does not pay for it.
A Signal is never refused for lack of balance. A balance can go below 0. The negative balance carries into the next cycle.
Retry and Reject
Fix the cause first: add the Customer, buy the Plan, or add the Credit to the Plan. Then retry the Signal.
- Retry sends the stored request body again, as a new attempt. A Signal has at most 11 attempts: the first send and 10 retries. A counted Signal cannot be retried.
- Mark as rejected closes the Signal for good. A rejected Signal cannot be retried.
- Select mode lets you retry or reject many Signals at once.
Your server can do the same with List raw signals
(status=PENDING) and Retry signals.
Clocknext does not retry a Pending Signal by itself.
Recording a Signal
Your server sends each Signal to one of the 6 signal endpoints, as each tracked call finishes:
| Endpoint | Signal |
|---|---|
POST /api/v1/signal/credit | One LLM call on a Credit, named by agentKey. |
POST /api/v1/signal/outcome | One step of an Outcome run. |
POST /api/v1/signal/outcome/complete | The end of an Outcome run. This bills it. |
POST /api/v1/signal/wallet | One LLM call paid from the Wallet. |
POST /api/v1/signal/unit | A Unit report, with quantity and providerCostUsd. |
POST /api/v1/signal/composite/complete | The end of one Composite occurrence. |
Send them to the signal host, https://events.clocknext.com.
@clocknext/sdk 0.20 and later do this. https://payments.clocknext.com
forwards the same endpoints, but they are deprecated there.
A valid request gets 202 with { queued: true, signalId, replayed }.
Clocknext checks the Customer, the Plan and the agentKey after this answer.
A Signal that it cannot count stays Pending.
Other answers:
400: the body is not valid, for example a missing field or amemberthat is not an email. Nothing is recorded. Fix the body.401: the API key is missing or unknown.429: your Organisation sent more Signals in one second than its limit. Wait the seconds inRetry-After, then send it again with the sameidempotencyKey.503: the Signal could not be accepted now. Nothing is recorded. Send it again with the sameidempotencyKey.
A signal endpoint never answers 409 or 422.
The fields
- Customer:
customerId, or your ownexternalId(see Your own customer ids). If you send both,customerIdwins. agentKey: the key of the Credit, the Outcome step (on/outcome), the Outcome (on/outcome/complete) or the Unit. Any text up to 128 characters that is not blank. It is matched exactly, case included:Chatandchatare 2 keys.usage: the model and the token counts, on Credit, Outcome step and Wallet Signals. The model name is matched without case.providerCostUsd(optional, on Unit Signals only): what your provider charged for the whole Signal, in US dollars, for example an enrichment API or a data lookup. It is the total, not a price per unit: a Signal withquantity: 3that cost $1.20 in all is1.2, and Clocknext never multiplies it byquantity. It is for cost tracking only: it counts as provider cost against the Customer, and does not change the Customer's price, the Wallet or any balance. Leave it out and the cost is 0. A negative value, or a value that is not a number, is a400. Credit, Outcome and Wallet Signals do not take it: their cost comes from the tokens.member(optional): the email of the person at the Customer. A new email adds the member.composite(optional):{ "<composite key>": "<composite value>" }. It puts the Signal in one occurrence of a Composite. An empty composite value on a Signal that the Composite bills, or on a completion, leaves it Pending.idempotencyKey(optional, recommended): see below.custom(optional): any JSON object up to 16 KB. Credit rules can match on it.
Idempotency
One idempotencyKey is one Signal, for 3 days, on all 6 signal endpoints.
A repeat with the same key gets 202 with the first signalId and
replayed: true, and nothing new is counted. Without a key, a repeat counts
again. See Retries & idempotency.
Naming the Customer
Every Signal says which Customer it belongs to. Send either our customerId or
your own externalId for the Customer. If a Signal carries both, customerId
wins and externalId is ignored.
A Signal whose externalId matches no Customer is still accepted. It then
shows here as Pending with the reason No customer with external id "…".
Add the Customer (or set its External ID) and retry it.
curl -X POST https://events.clocknext.com/api/v1/signal/credit \
-H "Authorization: Bearer $CLOCKNEXT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "acme-42",
"agentKey": "deep-research",
"usage": { "model": "gpt-4o", "inputTokens": 1200, "outputTokens": 350 }
}'Reading Signals over the API
- List raw signals: every Signal with its status. Use it to find the Pending ones.
- Retry signals: send 1 to 50 Pending Signals again.
- List Customer Usage Log: the counted Signals of one Customer.
- Look Up Usage Logs by ID: counted Signals by their id.
Related
- Record Signals: record credit, outcome, wallet, unit and composite signals from your backend.
- Errors and Retries & idempotency.
- Credits, Outcomes, Units and Composites: the entitlements that a Signal draws down.