ClockNext: record usage
clocknext_record_usageRecord a single usage event with token-based billing. Uses idempotency keys so retries don't duplicate charges, and returns the resulting usage log.
Instructions
Record ONE real usage signal — it is metered and billed. Prices the tokens against the model and the customer's plan and returns the resulting usage log. Pass an idempotencyKey to make retries safe (a repeat with the same key returns the original result instead of double-recording). For a no-op preflight, use clocknext_verify_signal instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Which meter to record against: 'wallet' debits USD at the model's cost; 'credit' draws down a named credit; 'outcome' advances one step of a workflow. | |
| model | Yes | Catalog model id (e.g. 'gpt-4o'), matched case-insensitively. Use clocknext_list_models to see valid ids. | |
| member | No | Optional customer-member email to attribute the usage to. | |
| agentKey | No | Required for type 'credit' (the credit's agent key) or 'outcome' (the outcome step's agent key). Ignored for 'wallet'. | |
| customerId | Yes | The ClockNext customer id (e.g. cus_…) this usage belongs to. | |
| cacheTokens | No | Cached (prompt-cache) tokens; defaults to 0 when omitted. | |
| inputTokens | Yes | Prompt tokens for this call. | |
| outputTokens | Yes | Completion tokens for this call. | |
| idempotencyKey | No | Optional dedup key. Reuse the SAME key across retries of one logical event so a lost response can't double-record it. |