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();