Documentation
Architecture
Metrecept sits on the path between your agent and the model. You keep the key to the lab. We sign a record of what crossed. Anyone can check that signature against a public key. We do not stop the call.
- The pipe
- https://api.metrecept.co.uk/v1
- This site
- https://metrecept.co.uk
Point the client you already use at the pipe. The rest of this page is what happens after that.
The pipe runs in London, eu-west-2, on EKS. Customer traffic for api.metrecept.co.uk arrives there. The receipt signature is made on a machine the company holds, not on AWS. Past infrastructure changes are in the changelog. This website is served by Base44, not by that cluster.
01
What a crossing is
A request is either served again, or sent to the lab.
Served again
This exact request is already stored, for your seat. The lab is not called. The stored answer comes back.
Sent to the lab
It is not stored yet. Your lab key is used, the model answers, and the answer is kept unless you asked us not to store it.
Exact means the same bytes. The same model, the same messages, the same extra fields. A changed character is a new request. A shared opening is not enough. There is no matching on meaning.
Both are priced. Both can carry a signed receipt on the response. The signature says who signed it. The record says what happened.
02
You do not pick a layer
You send the request. If the stored answer is there, it comes back. If it is not, the request goes on to the lab.
Your agent
OpenAI-compatible client. Brings X-Metrecept-Upstream-Key.
Inventory · gateway-rs edge
The hot copy
Content-addressed in Redis under a named cache tree. Answers HITs. Can expire. Holds no signing key.
HIT → stored completion returned
THE PIPELINE.
Owns the key, the org, the meters, the compliance gate, the route to the lab, and the signature. What may be believed later.
MISS → lab → stored → signed
The lab
Stays outside. Called only on a miss, with your key.
If the front of the pipe is down, the request still reaches the service behind it. If a stored answer expires, that replay is gone. The ledger, and any receipt you kept, are not.
The labs stay outside the pipe. A public page stays outside until the gate has run: the site’s own rules are read, the address is checked so it cannot point at a private network, and personal details are screened before anything leaves. What is stored so a request can be served again is not a training set.
03
Who owns what
The organisation
The company account. The people on it, how they sign in, and the monthly close.
The seat
The key belongs to a seat. That seat is who is billed.
The shelf of answers
Stored answers for that seat. One shelf for the work, and a separate shelf if you are previewing a change.
A label on the work
You can name a path, or a cost centre, on the request. It is a label on the bill. It does not make a separate shelf of answers.
You send the lab key on the request, as X-Metrecept-Upstream-Key. It is used when the lab has to be called. It is not kept as the name of the stored answer.
04
What gets signed
- 01
Find the public key named on the receipt
- 02
Check the signature
- 03
Read what the crossing was
The public keys are published here.
https://api.metrecept.co.uk/.well-known/http-message-signatures-directory
The session
Included
The receipt for one run. You ask for it when the run is finished. It totals what crossed, what the pipe charged, and when the run started and ended. The name of the run is not written in the clear. Asking for it is free.
A repeated request
The lab was not called
This exact request was already stored. The receipt names the model, how many tokens were not bought again, what the pipe charged, and a fingerprint of the request. The prompt is not in it.
A first request
The lab was called
The same kind of record, for the first time this request was seen. A later repeat shares the fingerprint.
A call out
Another service
One finished call to another service, whether it answered or failed. An order number in the address is not copied into the receipt.
Custody
A note in a sequence
Written when Metrecept keeps a record, looks at one, changes one, or deletes one. It does not name the person. Each note points at the one before it, so the sequence cannot be quietly rewritten. A deletion is recorded as a deletion.
The month
Once, for the organisation
The close of one calendar month, in UTC. Counts, what the pipe charged, and a savings figure that is marked as an estimate. The first time that month is closed, it costs ten cents. Opening it again does not.
A page fetched
Charged, not signed
Charged for each address. It is written on the ledger. It does not get a signature of its own. The session and the month still count it.
Ed25519 is the signature on the receipt. The charge is the charge of the crossing. There is no second price.
A signature proves this key signed these bytes. It does not prove the time. The hour is published, and its Merkle root is anchored to Bitcoin through OpenTimestamps. The anchor is not a field inside the receipt.
A public savings link, if you opt in, is an estimate. It is not one of these receipts.
05
What it costs
The session receipt is included. Everything else is charged when it happens, on the same seat. Asking for the session does not charge you.
| What | When | Price |
|---|---|---|
| The session | You ask for the run | Included |
| A repeated request | The same request, served again | 0.45p / 1,000 tokens |
| A first request | The lab is called | 0.1125p / 1,000 tokens |
| A page fetched | One public address | 2p |
| A call out | One finished call | 0.45p |
| Custody | One note in the sequence | 0.75p |
| The month | The first close of that month | 7.5p |
These are the list prices. A savings figure on the dashboard is an estimate. The invoice is for the pipe. The same numbers are on Pricing.
06
Check it
python scripts/verify_receipt.py "<the receipt>" --base https://api.metrecept.co.ukOr open Verify and paste it. No account. The same public key, and the same check, for every receipt.