ClocknextHelp
DocumentationAPI ReferenceMCP Tools
Dashboard

Get started

OverviewQuickstart

Core concepts

The response envelopeErrorsPaginationAsync, flushing & reliability

API reference

Record Signals POSTRecord usage logs POST
List customers GETCreate a customer POSTGet a customer GETUpdate a customer PATCHDelete a customer DELETEGet a customer's balances GETGet a customer's current plan GETList a customer's wallet transactions GETAdd a wallet transaction POSTAdjust a customer's credit balance POSTAdjust a customer's outcome balance POSTAdjust a customer's unit balance POST
List a customer's members GETAdd a member POSTUpdate a member PATCHRemove a member DELETE
List purchases GETCreate a purchase POSTGet a purchase GETUpdate a purchase's auto-payment setting PATCHCancel a purchase POST
List invoices GETGet an invoice GETMint a hosted pay link GET
List payments GETGet a payment GET
Mint a customer-portal access token POST

API Reference

Overview

The Clocknext Payments REST API — meter usage, manage customers and plans, and read billing from your own servers.

The Clocknext Payments API is a RESTful API your backend calls to meter LLM usage, manage customers and their plans, and read invoices and payments. Every endpoint lives under a single base URL, is authenticated with an organisation-scoped API key, and returns the same predictable response envelope.

Try it as you read

Every endpoint page in the API reference below is generated straight from the OpenAPI spec and ships with a live Try it playground plus cURL and Node.js code samples — so you can send a real request without leaving the page.

Base URL

https://payments.clocknext.com/api/v1

All paths in this reference are relative to that base URL. So POST /usage means POST https://payments.clocknext.com/api/v1/usage.

Authentication

Every request carries a per-organisation API key as a bearer token:

Authorization: Bearer cnk_your_key_here

Keys are created in Settings → API Keys and are scoped to the organisation that created them — a key can only ever read or write its own organisation's data. See Settings → API Keys for how to create, send, and rotate keys.

The shape of every response

Success or error, every response has the same envelope:

{
  "statusCode": 200,
  "statusDetail": { "status": "SUCCESS", "message": "OK" },
  "result": { }
}

statusCode mirrors the HTTP status, statusDetail.status is SUCCESS on a 2xx (ERROR otherwise), and your payload rides in result. Read the full contract in The response envelope.

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.

The response envelope

The one response shape every endpoint returns.

Errors

Every status code the API returns and how to handle it.

Pagination

Page through list endpoints with limit and cursor.

What you can do with the API

AreaEndpointsWhat it's for
Usage/usageRecord one metered LLM request and read a customer's usage.
Customers/customersCreate, read, update, and delete customers; read balances and plan.
Members/customers/{id}/membersManage the people who belong to a customer.
BillingPurchases · Invoices · PaymentsSubscribe customers, read invoices, and mint hosted pay links.
Customer Portal/portal/tokenMint 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.

Quickstart

Create a customer and record your first usage signal end to end — in under ten minutes.

On this page

Base URLAuthenticationThe shape of every responseWhere to go nextWhat you can do with the API