Outcomes
Multi-step deliverables billed per completed outcome. Nothing is deleted — archive instead.
Base URL https://payments.clocknext.com/api/v1
Lists your outcomes. Pass active=true for active ones only.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
active?booleantrue returns only active outcomes.
Outcomes.
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 workspace's outcomes.
curl -X GET 'https://payments.clocknext.com/api/v1/outcomes?active=true'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "outcomes": [ { "id": "cmvgvffng000808l237059in9", "name": "Resolved Support Ticket", "agentKey": "support_ticket", "description": "A customer ticket triaged, answered and closed", "isActive": true, "basePrice": 0.084015, "marginPercent": 50, "pricePerOutcome": 0.1260225, "createdAt": "2026-10-20T16:01:49.564Z", "updatedAt": "2026-10-20T16:01:49.564Z" }, { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "description": "Updated 2026-10-20 — outcome description", "isActive": true, "basePrice": 0.4658, "marginPercent": 100, "pricePerOutcome": 0.9316, "createdAt": "2026-10-20T16:01:49.935Z", "updatedAt": "2026-10-20T16:05:12.118Z" } ] }}Base URL https://payments.clocknext.com/api/v1
Creates an outcome. Each step is priced from its modelBundle.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
application/json- body
A new outcome with its steps. Keys use letters, digits, ., _ and - (at most 80) and match exactly. Signals name a step's agentKey, which is unique among all outcome steps of the workspace.
name*stringThe outcome's name. Must be unique in the workspace, ignoring case (409 if taken).
1 <= length <= 120agentKey*stringThe outcome's own key. Unique among your outcomes (409 if taken). Signals name a step's key.
^[A-Za-z0-9._-]+$1 <= length <= 80description?|Optional note about the outcome.
length <= 500marginPercent*numberMarkup on the base price (the sum of the steps), in percent. -100 makes the outcome free.
-100 <= valuesteps*array<>The steps of the outcome, in order. Each step needs a modelBundle; the server prices each step from it.
1 <= items <= 50Outcome created.
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 new outcome.
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes' \ -H 'Content-Type: application/json' \ -d '{ "name": "Resolved Support Ticket", "agentKey": "support_ticket", "description": "A customer ticket triaged, answered and closed", "marginPercent": 50, "steps": [ { "name": "Triage", "agentKey": "support_ticket.triage", "modelBundle": [ { "modelId": "claude-haiku-4-5", "averageTokensPerLLMCall": 4000, "input": 80, "output": 20, "cache": 0, "cacheWrite": 0 } ] }, { "name": "Draft reply", "agentKey": "support_ticket.draft", "modelBundle": [ { "modelId": "claude-sonnet-4-5", "averageTokensPerLLMCall": 12000, "input": 60, "output": 30, "cache": 10, "cacheWrite": 0 } ] }, { "name": "QA check", "agentKey": "support_ticket.qa", "modelBundle": [ { "modelId": "gpt-4o-mini", "averageTokensPerLLMCall": 3000, "input": 70, "output": 30, "cache": 0, "cacheWrite": 0 } ] } ]}'{ "statusCode": 201, "statusDetail": { "status": "SUCCESS", "message": "Outcome created." }, "result": { "created": true, "outcome": { "id": "cmvgvffng000808l237059in9", "name": "Resolved Support Ticket", "agentKey": "support_ticket", "description": "A customer ticket triaged, answered and closed", "isActive": true, "basePrice": 0.084015, "marginPercent": 50, "pricePerOutcome": 0.1260225, "createdAt": "2026-10-20T16:01:49.564Z", "updatedAt": "2026-10-20T16:01:49.564Z" } }}Base URL https://payments.clocknext.com/api/v1
Updates only the fields you send. Send each step's id to keep it.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringOutcome id.
application/json- body
Only the fields you send change. Keys use letters, digits, ., _ and - (at most 80) and match exactly. A step keeps its id: matched by id, else by agentKey. A step sent without modelBundle keeps its price.
name?stringA new name. Must be unique in the workspace, ignoring case (409 if taken).
1 <= length <= 120agentKey?stringA new key for the outcome. Unique among your outcomes (409 if taken).
^[A-Za-z0-9._-]+$1 <= length <= 80description?|A new note. Send null to clear it.
length <= 500marginPercent?numberA new markup on the base price, in percent, down to -100.
-100 <= valuesteps?array<>The complete new step list. Saved steps that you leave out are removed.
1 <= items <= 50Outcome updated.
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 updated outcome.
curl -X PATCH 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2' \ -H 'Content-Type: application/json' \ -d '{ "steps": [ { "agentKey": "contract_review.extract", "name": "Extract clauses", "modelBundle": [ { "modelId": "claude-sonnet-4-5", "input": 70, "output": 30, "cache": 0, "cacheWrite": 0, "averageTokensPerLLMCall": 50000 } ] }, { "id": "cmvgvffxu000e08l2m2xr8edr", "name": "Summarise for legal", "agentKey": "contract_review.summarise", "modelBundle": [ { "modelId": "gpt-4o", "input": 50, "output": 50, "cache": 0, "cacheWrite": 0, "averageTokensPerLLMCall": 20000 } ] }, { "name": "Risk score", "agentKey": "contract_review.risk", "modelBundle": [ { "modelId": "claude-haiku-4-5", "averageTokensPerLLMCall": 6000, "input": 80, "output": 20, "cache": 0, "cacheWrite": 0 } ] } ]}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Outcome updated." }, "result": { "updated": true, "outcome": { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "description": "Updated 2026-10-20 — outcome description", "isActive": true, "basePrice": 0.4658, "marginPercent": 100, "pricePerOutcome": 0.9316, "createdAt": "2026-10-20T16:01:49.935Z", "updatedAt": "2026-10-20T16:05:12.118Z" } }}Base URL https://payments.clocknext.com/api/v1
Gets one outcome with its steps.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringOutcome id.
The outcome.
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 outcome with this id, in outcome.
curl -X GET 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "outcome": { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "description": "Updated 2026-10-20 — outcome description", "isActive": true, "basePrice": 0.455, "marginPercent": 100, "pricePerOutcome": 0.91, "createdAt": "2026-10-20T16:01:49.935Z", "updatedAt": "2026-10-20T16:04:51.479Z", "steps": [ { "id": "cmvgvffxu000d08l2e3a19jua", "name": "Extract clauses", "agentKey": "contract_review.extract", "order": 0, "basePrice": 0.33, "modelBundle": [ { "modelId": "claude-sonnet-4-5", "modelName": "Claude Sonnet 4.5 (latest)", "input": 70, "output": 30, "cache": 0, "cacheWrite": 0, "averageTokensPerLLMCall": 50000 } ] }, { "id": "cmvgvffxu000e08l2m2xr8edr", "name": "Summarise", "agentKey": "contract_review.summarise", "order": 1, "basePrice": 0.125, "modelBundle": [ { "modelId": "gpt-4o", "modelName": "GPT-4o", "input": 50, "output": 50, "cache": 0, "cacheWrite": 0, "averageTokensPerLLMCall": 20000 } ] } ] } }}Base URL https://payments.clocknext.com/api/v1
Archives an outcome. Nothing is deleted.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringOutcome id.
Outcome archived.
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 archived outcome.
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2/archive'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Outcome archived." }, "result": { "archived": true, "outcome": { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "description": "Updated 2026-10-20 — outcome description", "isActive": false, "basePrice": 0.455, "marginPercent": 100, "pricePerOutcome": 0.91, "createdAt": "2026-10-20T16:01:49.935Z", "updatedAt": "2026-10-20T16:04:50.293Z" } }}Base URL https://payments.clocknext.com/api/v1
Restores an archived outcome.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringOutcome id.
Outcome unarchived.
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 restored outcome.
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2/unarchive'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Outcome restored." }, "result": { "unarchived": true, "outcome": { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "description": "Updated 2026-10-20 — outcome description", "isActive": true, "basePrice": 0.455, "marginPercent": 100, "pricePerOutcome": 0.91, "createdAt": "2026-10-20T16:01:49.935Z", "updatedAt": "2026-10-20T16:04:51.022Z" } }}Types
Every object type on this page, with its fields.
Outcome
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The outcome's id. |
name | string | yes | The outcome's name. Unique in the workspace, ignoring case. |
agentKey | string | yes | Unique outcome key. |
description | string | null | yes | Optional note about the outcome. null when not set. |
isActive | boolean | yes | false once archived; it can't go on a new plan. Read-only: use archive and unarchive. |
basePrice | number | yes | Sum of the steps' prices. |
marginPercent | number | yes | Markup on basePrice, in percent. Can be negative, down to -100. |
pricePerOutcome | number | yes | Price of one completed outcome, in USD: basePrice × (1 + marginPercent / 100). |
createdAt | string | yes | When the outcome was created. |
updatedAt | string | yes | When the outcome was last changed. |
CreateOutcomeInput
A new outcome with its steps. Keys use letters, digits, ., _ and - (at most 80) and match exactly. Signals name a step's agentKey, which is unique among all outcome steps of the workspace.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The outcome's name. Must be unique in the workspace, ignoring case (409 if taken). |
agentKey | string | yes | The outcome's own key. Unique among your outcomes (409 if taken). Signals name a step's key. |
description | string | null | no | Optional note about the outcome. |
marginPercent | number | yes | Markup on the base price (the sum of the steps), in percent. -100 makes the outcome free. |
steps | OutcomeStepInput[] | yes | The steps of the outcome, in order. Each step needs a modelBundle; the server prices each step from it. |
OutcomeStepInput
One step of an outcome, as sent on create or update.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | Existing step id (update only). |
name | string | yes | The step's name. Must be unique in this outcome, ignoring case. |
agentKey | string | yes | The key an outcome signal names for this step. Unique among all outcome steps (409 if taken). |
modelBundle | ModelBundleLineInput[] | no | Required for a new step. |
ModelBundleLineInput
One model in the mix of a credit or outcome step. input, output, cache and cacheWrite are whole percentages of averageTokensPerLLMCall that add up to 100. cacheWrite is 0 when the model has no cache-write price.
| Field | Type | Required | Description |
|---|---|---|---|
modelId | string | yes | A model id enabled in your workspace — the id you send as usage.model. An archived model is refused (400). |
averageTokensPerLLMCall | number | yes | Average tokens one LLM call to this model uses. Must be above 0. The four shares split these tokens. |
input | integer | yes | Input-token share of averageTokensPerLLMCall: a whole percent, 0 to 100. |
output | integer | yes | Output-token share of averageTokensPerLLMCall: a whole percent, 0 to 100. |
cache | integer | yes | Cache-read share of averageTokensPerLLMCall: a whole percent, 0 to 100. |
cacheWrite | integer | no | Cache-write share: a whole percent, 0 to 100. 0 when the model has no cache-write price. |
UpdateOutcomeInput
Only the fields you send change. Keys use letters, digits, ., _ and - (at most 80) and match exactly. A step keeps its id: matched by id, else by agentKey. A step sent without modelBundle keeps its price.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | A new name. Must be unique in the workspace, ignoring case (409 if taken). |
agentKey | string | no | A new key for the outcome. Unique among your outcomes (409 if taken). |
description | string | null | no | A new note. Send null to clear it. |
marginPercent | number | no | A new markup on the base price, in percent, down to -100. |
steps | OutcomeStepInput[] | no | The complete new step list. Saved steps that you leave out are removed. |
OutcomeWithSteps
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The outcome's id. |
name | string | yes | The outcome's name. Unique in the workspace, ignoring case. |
agentKey | string | yes | Unique outcome key. |
description | string | null | yes | Optional note about the outcome. null when not set. |
isActive | boolean | yes | false once archived; it can't go on a new plan. Read-only: use archive and unarchive. |
basePrice | number | yes | Sum of the steps' prices. |
marginPercent | number | yes | Markup on basePrice, in percent. Can be negative, down to -100. |
pricePerOutcome | number | yes | Price of one completed outcome, in USD: basePrice × (1 + marginPercent / 100). |
createdAt | string | yes | When the outcome was created. |
updatedAt | string | yes | When the outcome was last changed. |
steps | OutcomeStep[] | yes | The outcome's steps, in order. Each step has its own agentKey, which outcome signals name. |
OutcomeStep
One step of an outcome: one agent call, named by its agentKey, with its own model mix and price.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Step id. |
name | string | yes | The step's name. Unique in its outcome, ignoring case. |
agentKey | string | yes | Unique key an outcome signal names. |
order | integer | yes | The step's position in the outcome, from 0. It follows the order of the steps list that was sent. |
basePrice | number | yes | One run of this step in USD, without margin, worked out from modelBundle when saved. |
modelBundle | ModelBundleLine[] | yes | The models and token mix that basePrice is worked out from, one line per model. |
ModelBundleLine
One model in the mix of a credit or outcome step. input, output, cache and cacheWrite are whole percentages of averageTokensPerLLMCall that add up to 100.
| Field | Type | Required | Description |
|---|---|---|---|
modelId | string | null | yes | The model's id, as sent in usage.model. null when the model was removed after the bundle was saved. |
modelName | string | yes | Model name. |
averageTokensPerLLMCall | number | yes | Average tokens per LLM call. |
input | integer | yes | Input share (%). |
output | integer | yes | Output share (%). |
cache | integer | yes | Cache-read share (%). |
cacheWrite | integer | yes | Cache-write share (%). |