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.
Payments SDK
x402 payment configuration — pricing, facilitators, grants, and subscription
Operations
| Method | Description |
|---|
lucidGetAssetPricing | Get asset pricing |
lucidSetAssetPricing | Set asset pricing |
lucidDeleteAssetPricing | Remove asset pricing |
lucidGetAssetRevenue | Get asset revenue summary |
lucidWithdrawAssetRevenue | Withdraw asset revenue |
lucidGetPaymentConfig | Get x402 payment configuration |
lucidSetDefaultFacilitator | Set default payment facilitator |
lucidGetSupportedChains | List supported payment chains |
lucidSubscribeAsset | Subscribe to asset access |
lucidCreatePaymentGrant | Issue a signed payment grant |
Generated Reference
Overview
x402 payment configuration — pricing, facilitators, grants, and subscription
Available Operations
lucidGetAssetPricing
Retrieve the x402 pricing configuration for an AI asset. Returns null if no pricing has been configured (asset is free access). No authentication required.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.payments.lucidGetAssetPricing({
passportId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidGetAssetPricing } from "raijin-labs-lucid-ai/funcs/paymentsLucidGetAssetPricing.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 paymentsLucidGetAssetPricing(raijinLabsLucidAi, {
passportId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidGetAssetPricing failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidGetAssetPricingRequest | :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.LucidGetAssetPricingResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidSetAssetPricing
Admin-only. Sets or updates the pricing configuration for an AI asset.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await raijinLabsLucidAi.payments.lucidSetAssetPricing({
passportId: "<id>",
body: {
payoutAddress: "<value>",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidSetAssetPricing } from "raijin-labs-lucid-ai/funcs/paymentsLucidSetAssetPricing.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await paymentsLucidSetAssetPricing(raijinLabsLucidAi, {
passportId: "<id>",
body: {
payoutAddress: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidSetAssetPricing failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidSetAssetPricingRequest | :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.SuccessResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400, 401 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidDeleteAssetPricing
Admin-only. Removes pricing (asset becomes free access).
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await raijinLabsLucidAi.payments.lucidDeleteAssetPricing({
passportId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidDeleteAssetPricing } from "raijin-labs-lucid-ai/funcs/paymentsLucidDeleteAssetPricing.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await paymentsLucidDeleteAssetPricing(raijinLabsLucidAi, {
passportId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidDeleteAssetPricing failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidDeleteAssetPricingRequest | :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.LucidDeleteAssetPricingResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 401 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidGetAssetRevenue
Retrieve the revenue summary for an AI asset including total earned, pending settlement, and withdrawn amounts. Defaults to USDC token if not specified.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.payments.lucidGetAssetRevenue({
passportId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidGetAssetRevenue } from "raijin-labs-lucid-ai/funcs/paymentsLucidGetAssetRevenue.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 paymentsLucidGetAssetRevenue(raijinLabsLucidAi, {
passportId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidGetAssetRevenue failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidGetAssetRevenueRequest | :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.LucidGetAssetRevenueResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidWithdrawAssetRevenue
Admin-only. Marks confirmed revenue as pending_payout. The actual
on-chain transfer happens via the batch payout epoch.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await raijinLabsLucidAi.payments.lucidWithdrawAssetRevenue({
passportId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidWithdrawAssetRevenue } from "raijin-labs-lucid-ai/funcs/paymentsLucidWithdrawAssetRevenue.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await paymentsLucidWithdrawAssetRevenue(raijinLabsLucidAi, {
passportId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidWithdrawAssetRevenue failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidWithdrawAssetRevenueRequest | :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.LucidWithdrawAssetRevenueResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 401 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidGetPaymentConfig
Retrieve the current x402 payment configuration including supported chains, default facilitator, enabled status, and facilitator-specific settings.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.payments.lucidGetPaymentConfig();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidGetPaymentConfig } from "raijin-labs-lucid-ai/funcs/paymentsLucidGetPaymentConfig.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 paymentsLucidGetPaymentConfig(raijinLabsLucidAi);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidGetPaymentConfig 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.LucidGetPaymentConfigResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidSetDefaultFacilitator
Admin-only. Sets the default x402 facilitator (direct, coinbase, payai).
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await raijinLabsLucidAi.payments.lucidSetDefaultFacilitator({
facilitator: "payai",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidSetDefaultFacilitator } from "raijin-labs-lucid-ai/funcs/paymentsLucidSetDefaultFacilitator.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await paymentsLucidSetDefaultFacilitator(raijinLabsLucidAi, {
facilitator: "payai",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidSetDefaultFacilitator failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidSetDefaultFacilitatorRequest | :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.SuccessResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400, 401 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidGetSupportedChains
List all blockchain chains supported for x402 payments, including the accepted payment tokens (e.g., USDC) on each chain.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.payments.lucidGetSupportedChains();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidGetSupportedChains } from "raijin-labs-lucid-ai/funcs/paymentsLucidGetSupportedChains.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 paymentsLucidGetSupportedChains(raijinLabsLucidAi);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidGetSupportedChains 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.LucidGetSupportedChainsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidSubscribeAsset
x402-gated. Pay via USDC and receive a time-limited access subscription.
On success, creates an on-chain AccessReceipt.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.payments.lucidSubscribeAsset({
xPaymentProof: "<value>",
body: {
passportId: "<id>",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidSubscribeAsset } from "raijin-labs-lucid-ai/funcs/paymentsLucidSubscribeAsset.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 paymentsLucidSubscribeAsset(raijinLabsLucidAi, {
xPaymentProof: "<value>",
body: {
passportId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidSubscribeAsset failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidSubscribeAssetRequest | :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.LucidSubscribeAssetResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.X402PaymentRequiredError | 402 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidCreatePaymentGrant
Admin-only. Issues a signed payment grant for an agent run.
The grant is Ed25519-signed by the orchestrator and scoped to specific models/tools.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const result = await raijinLabsLucidAi.payments.lucidCreatePaymentGrant({
tenantId: "<id>",
agentPassportId: "<id>",
runId: "<id>",
scope: {
models: [
"<value 1>",
],
tools: [],
maxPerCallUsd: 8892.57,
},
limits: {
totalUsd: 2605.79,
expiresAt: 877872,
maxCalls: 60861,
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { paymentsLucidCreatePaymentGrant } from "raijin-labs-lucid-ai/funcs/paymentsLucidCreatePaymentGrant.js";
// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore({
bearerAuth: process.env["RAIJINLABSLUCIDAI_BEARER_AUTH"] ?? "",
});
async function run() {
const res = await paymentsLucidCreatePaymentGrant(raijinLabsLucidAi, {
tenantId: "<id>",
agentPassportId: "<id>",
runId: "<id>",
scope: {
models: [
"<value 1>",
],
tools: [],
maxPerCallUsd: 8892.57,
},
limits: {
totalUsd: 2605.79,
expiresAt: 877872,
maxCalls: 60861,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("paymentsLucidCreatePaymentGrant failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | models.CreatePaymentGrantRequest | :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.LucidCreatePaymentGrantResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400, 401 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |