Skip to main content
Passports are the universal identity layer in Lucid. This guide covers CRUD operations.

Create a Passport

const passport = await lucid.passports.create({
  name: "my-gpt4o-model",
  type: "model",
  metadata: {
    provider: "openai",
    model: "gpt-4o",
    maxTokens: 128000,
    capabilities: ["chat", "function-calling", "vision"]
  },
  tags: ["production", "gpt-4o"]
});

console.log("Created:", passport.id);

List Passports

// List all passports
const all = await lucid.passports.list();

// Filter by type
const models = await lucid.passports.list({ type: "model" });
const agents = await lucid.passports.list({ type: "agent" });

// Filter by tags
const prod = await lucid.passports.list({ tags: ["production"] });

Update a Passport

await lucid.passports.update(passportId, {
  metadata: { ...existingMetadata, maxTokens: 256000 },
  tags: ["production", "upgraded"]
});

Delete a Passport

await lucid.passports.delete(passportId);

Sync to Solana

// Sync a passport to the on-chain registry
await lucid.passports.sync(passportId);

// Check pending syncs
const pending = await lucid.passports.pendingSync();

Passport Stats

const stats = await lucid.passports.stats();
console.log("Total:", stats.total);
console.log("By type:", stats.byType);