Core concepts

Compute Receipts

A compute receipt is a signed record of a request.

You get one when receipt: true is included in the request body.

Common fields

FieldDescription
idReceipt ID
timestampCompletion time
modelModel used
providerProvider used
tokensTotal tokens
latencySecondsRequest latency
costUsdEstimated cost
promptHashHash of prompt payload
responseHashHash of response payload
signatureSignature over receipt data
anchorOptional anchor data
verifiedVerification status

Example

const response = await client.chat.completions.create({
  model: "openai/gpt-4o-mini",
  messages: [
    { role: "user", content: "Hello" }
  ],
  extra_body: {
    receipt: true
  }
});

console.log(response.compute_receipt);

Retrieve a receipt

const receipt = await client.receipts.get("rcpt_123");

Verify a receipt

const result = await client.receipts.verify("rcpt_123");

console.log(result.signatureValid);
console.log(result.status);