API Reference
Overview
The Clocknext Payments API and Node.js SDK — meter LLM usage, manage customers and plans.
Clocknext works through the Node.js SDK and API. Both meter LLM usage — against a credit, outcome, wallet, unit, or composite — and manage customers and their plans. Every request is authenticated with an organisation-scoped API key, and every response, from either the SDK or the API, follows the same response envelope.
Base URL
https://payments.clocknext.com/api/v1All paths in this reference are relative to this base URL —
POST /signal/credit calls POST https://payments.clocknext.com/api/v1/signal/credit.
Authentication
Every request carries a per-organisation API key as a bearer token:
Authorization: Bearer cnk_your_key_hereCreate, send, and rotate keys in Settings → API Keys.
The shape of every response
Success or error, every response has the same envelope:
{
"statusCode": 200,
"statusDetail": { "status": "SUCCESS", "message": "OK" },
"result": { }
}See Response format for the full contract.
Where to go next
Quickstart
Create a customer and record your first usage signal in under ten minutes.
API keys
Create an API key, send it, and rotate it safely.
Response format
The one response shape every endpoint returns.
Handling errors
Every status code the API returns and how to handle it.
Paginating results
Page through list endpoints with limit and cursor.
What you can do
| Area | Endpoints | What it's for |
|---|---|---|
| Signals | /signal/* | Record one metered request against a credit, outcome, wallet, or unit, and close a composite. |
| Customers | /customers | Create, read, update, and delete customers; read balances and plan. |
| Members | /customers/{id}/members | Manage the people who belong to a customer. |
| Billing | Purchases · Invoices · Payments | Subscribe customers, read invoices, and mint hosted pay links. |
| Customer Portal | /portal/token | Mint short-lived tokens to embed the customer portal. |
Server-side only
Your cnk_… key has organisation-wide read/write access. Call this API from a
server, script, or job you control — never ship the key to a browser or mobile
app. To give a customer access to their own data, mint a
portal token instead.