View as Markdown

Receipts

Add two headers to a request and its cost is recorded against a workflow and a job. The console and your statements then show cost per finished job, not just tokens per day.

HeaderWhat it meansExample
X-Continuum-WorkflowThe kind of work. Keep it short and stable.invoice-check
X-Continuum-OutcomeThe one job this request served. Several requests can share it.INV-2291
X-Continuum-Tag-<name>Anything else you want to group by. Up to 10 per request.X-Continuum-Tag-Env: production

Values are trimmed and kept to 100 characters. Tag names may use letters, numbers, - and _, up to 40 characters.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.continuumlabs.ai/v1", api_key="cl-your-key")

reply = client.chat.completions.create(
    model="glm-5.2",
    messages=[{"role": "user", "content": invoice_text}],
    extra_headers={
        "X-Continuum-Workflow": "invoice-check",
        "X-Continuum-Outcome": "INV-2291",
    },
)
bash
curl https://api.continuumlabs.ai/v1/chat/completions \
  -H "Authorization: Bearer cl-your-key" \
  -H "X-Continuum-Workflow: invoice-check" \
  -H "X-Continuum-Outcome: INV-2291" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.2", "messages": [{"role": "user", "content": "..."}]}'

The headers work on chat completions and embeddings, streamed or not.

Agents

An agent may make dozens of calls for one job. Give every call the same X-Continuum-Outcome. The statement counts it as one job, and its cost is the sum of its calls.

Declaring the value first

Before a workflow goes live, declare three things in the console under Cost control:

  1. What one job is, in a sentence.
  2. How many minutes it takes a person by hand.
  3. What would count as failure.

Set the cost of an hour of staff time once for the account. Statements then value each workflow's jobs against what you declared. A return figure set before spending is one a CFO can trust.

What is stored

The header values and token counts are stored. Prompts and answers are not. Don't put personal information in a header value.