Documentation Index
Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt
Use this file to discover all available pages before exploring further.
Receipts SDK
Cryptographic receipts — create, verify, and generate MMR inclusion proofs
Operations
| Method | Description |
|---|
create | Create a receipt |
get | Get a receipt |
verify | Verify a receipt (hash + signature + inclusion) |
getProof | Get inclusion proof for receipt |
lucidVerifyReceiptByHash | Verify receipt by hash with inclusion proof and epoch info |
getMmrRoot | Get current MMR root |
getSignerPubKey | Get orchestrator signing public key |
Generated Reference
Overview
Cryptographic receipts — create, verify, and generate MMR inclusion proofs
Available Operations
create
Create a new cryptographic receipt for a completed inference run and append it to the Merkle Mountain Range. The receipt is Ed25519-signed by the orchestrator and includes timing metrics.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.create({
modelPassportId: "ppt_model_7xK9mQ2v",
computePassportId: "ppt_compute_Xn5vR2kJ",
policyHash: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
runtime: "vllm",
tokensIn: 42,
tokensOut: 128,
ttftMs: 85,
totalLatencyMs: 1200,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsCreate } from "raijin-labs-lucid-ai/funcs/receiptsCreate.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsCreate(raijinLabsLucidAi, {
modelPassportId: "ppt_model_7xK9mQ2v",
computePassportId: "ppt_compute_Xn5vR2kJ",
policyHash: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
runtime: "vllm",
tokensIn: 42,
tokensOut: 128,
ttftMs: 85,
totalLatencyMs: 1200,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsCreate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | models.CreateReceiptRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidCreateReceiptResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
get
Retrieve a single receipt by its UUID, including the receipt hash, Ed25519 signature, signer public key, and inference metrics (tokens, latency, TTFT).
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.get({
receiptId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsGet } from "raijin-labs-lucid-ai/funcs/receiptsGet.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsGet(raijinLabsLucidAi, {
receiptId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsGet failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidGetReceiptRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetReceiptResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
verify
Verify a receipt’s integrity by checking its SHA-256 hash against the canonical JSON content, validating the Ed25519 signature, and confirming MMR inclusion. Returns per-check pass/fail status.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.verify({
receiptId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsVerify } from "raijin-labs-lucid-ai/funcs/receiptsVerify.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsVerify(raijinLabsLucidAi, {
receiptId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsVerify failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidVerifyReceiptRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.ReceiptVerification>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getProof
Retrieve the MMR inclusion proof for a receipt, containing the sibling hashes needed to verify the receipt’s membership in the Merkle Mountain Range.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.getProof({
receiptId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsGetProof } from "raijin-labs-lucid-ai/funcs/receiptsGetProof.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsGetProof(raijinLabsLucidAi, {
receiptId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsGetProof failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidGetReceiptProofRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetReceiptProofResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidVerifyReceiptByHash
Verify a receipt using its 64-character hex hash. Returns the inclusion proof, on-chain anchoring status, and epoch information. This is the primary verification endpoint for the Fluid Compute protocol.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.lucidVerifyReceiptByHash({
receiptHash: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsLucidVerifyReceiptByHash } from "raijin-labs-lucid-ai/funcs/receiptsLucidVerifyReceiptByHash.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsLucidVerifyReceiptByHash(raijinLabsLucidAi, {
receiptHash: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsLucidVerifyReceiptByHash failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidVerifyReceiptByHashRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.ReceiptHashVerification>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400, 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getMmrRoot
Retrieve the current global MMR root hash and total leaf count. The root is recomputed via right-to-left peak bagging after each receipt append.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.getMmrRoot();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsGetMmrRoot } from "raijin-labs-lucid-ai/funcs/receiptsGetMmrRoot.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsGetMmrRoot(raijinLabsLucidAi);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsGetMmrRoot failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetMmrRootResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getSignerPubKey
Retrieve the Ed25519 public key used by the orchestrator to sign receipts. Clients use this key to independently verify receipt signatures offline.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.receipts.getSignerPubKey();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { receiptsGetSignerPubKey } from "raijin-labs-lucid-ai/funcs/receiptsGetSignerPubKey.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();
async function run() {
const res = await receiptsGetSignerPubKey(raijinLabsLucidAi);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("receiptsGetSignerPubKey failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetSignerPubkeyResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |