Skip to main content
1

Get your API key

Sign up at app.lucid.foundation and create an API key from the dashboard.
2

Install the SDK

npm install raijin-labs-lucid-ai
3

Initialize the client

import { LucidAI } from "raijin-labs-lucid-ai";

const lucid = new LucidAI({
  bearerAuth: process.env.LUCID_API_KEY,
});
4

List your passports

const passports = await lucid.passports.list();
console.log(`Found ${passports.length} passports`);
5

Run an inference

const response = await lucid.chat.completions({
  model: "gpt-4o",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "What is verifiable AI?" }
  ]
});

console.log(response.choices[0].message.content);
// Receipt ID is in response headers
6

Verify the receipt

const receipt = await lucid.receipts.get(receiptId);
const verification = await lucid.receipts.verify(receiptId);

console.log("Verified:", verification.valid);
console.log("Merkle proof:", verification.proof);
The SDK is generated by Speakeasy and includes full TypeScript types for every endpoint.

What just happened?

  1. Passport lookup — Your API key resolved to a passport identity
  2. Policy matching — Lucid matched your request to the best available model
  3. Inference — The LLM processed your request
  4. Receipt creation — A cryptographic receipt was generated with an MMR proof
  5. Epoch anchoring — The receipt will be batched and anchored on Solana

Next Steps