Lucid Agents

Lucid Agents

Daydreams · Marketing

Lucid Agents is a TypeScript runtime from Daydreams that turns typed functions into paid services other agents can call, pay for, stream, or run as tasks.

Interface preview of Lucid Agents

About Lucid Agents

What Is Lucid Agents

Lucid Agents is a machine commerce SDK and TypeScript agent runtime for what its maker calls agentic commerce. It takes a typed function you already wrote and wraps it in everything another agent needs to buy it: a stable capability key, input and output schemas, a price, payment admission, retries, and a discovery card. The result is a normal HTTP service that happens to charge money and describe itself to machines.

The project comes from Daydreams, the team behind the Daydreams agent framework, and lives in the daydreamsai/lucid-agents repository under an MIT license. It sits in the middle of the stack. Below it are wallets, facilitators, networks, and the payment protocols themselves; above it is your business logic. Lucid does not replace those lower layers, and it does not invent a new payment protocol. It connects an existing payment proof from x402 or MPP to a piece of validated application work and one typed result.

That narrow scope is also its main limit. Lucid helps when a service needs several typed capabilities or shared behavior across frameworks. For a single paid route, the raw payment middleware is a smaller dependency, and the docs say so. Support for some protocol surfaces, such as a full A2A v1 transport or x402 Bazaar listings, is partial or missing today.

Getting Started

  1. Install Bun 1.3 or newer, then scaffold a project with the CLI, for example bunx @lucid-agents/cli my-agent --adapter=hono --template=blank.
  2. Run bun install and bun run dev inside the folder to start the generated service on port 3000.
  3. Swap the sample echo entrypoint for your own typed function, defining its input, output, and handler with a schema library such as Zod.
  4. Add the payments extension and set a price on the entrypoint to turn it into a paid route.
  5. Point a buyer wallet and facilitator at the service, then call the invoke route and read the settlement response header.

Product Information

A quick look at Lucid Agents's pricing, supported platforms, and performance.

Free PlanYes
Paid PlansFree (MIT) - custom hosted pricing
PlatformWeb, Node.js, Bun
DeveloperDaydreams
CategoryMarketing
Release DateAug 2025
Latest UpdatedOct 2025
Website VisitsN/A
Website Global RankN/A
API AvailabilityYes

Best for

The users, tasks, and scenarios where this tool fits best.

Users

  • Backend and TypeScript developers
  • Startup teams selling an AI capability
  • Agent framework builders
  • Teams experimenting with agent payments

Tasks

  • Turning a function into a paid API for agents
  • Charging other agents per call
  • Running paid work as background jobs
  • Registering a discoverable agent
  • Adding safe retries to a paid call

Scenarios

  • Shipping a paid text or data service on a deadline
  • Exposing several capabilities behind one runtime
  • Handling streaming or long-lived agent work
  • Moving toward production

Key features

Typed entrypoints as the source of truth

Everything in Lucid starts from one definition. You describe an entrypoint with a key, description, input and output schema, a handler, and an optional price. That single contract feeds validation, invocation, streaming, tasks, discovery, and every framework adapter, so the behavior of a route and the way it advertises itself never drift apart. For developers, it means one place to change instead of five.

Protocol agnostic payment rails

The payments package speaks more than one protocol. It handles x402 challenges with EVM and Solana seller verification plus EVM buying, Sign-In-With-X, and policy controls, and it supports the Machine Payments Protocol through Payment-Auth challenges with Tempo, Stripe, or custom credentials. Wallets and facilitators stay external, so you keep custody and settlement choices in your own hands rather than locked to the SDK.

Framework adapters

Lucid binds one HTTP contract to the frameworks teams already use. Dedicated adapters cover Hono, Express, and TanStack Start, and the CLI also generates Next.js App Router modules instead of a standalone package. Because adapters bind the same route plan, a service behaves the same whether it runs behind Hono in a small script or inside a larger Express or Next.js application.

Discovery, identity, and tasks

A paid service is only useful if a buyer can find it and trust it. The identity package handles ERC-8004 registration and lookup plus trust metadata, and the a2a package produces Agent Card-shaped discovery, client calls, and token-protected asynchronous tasks. AP2 role metadata can be attached for agent payments. This is the layer that lets another machine decide whether to call the service at all.

Policy, idempotency, and analytics

Once money is involved, application controls matter as much as the protocol. Lucid adds recipient limits, budgets, rate limits, and safe paid retries on top of the payment core, and idempotency keeps a payment and its fulfillment in one transaction. The analytics package then summarizes bound payments with JSON and CSV exports, which is enough to see what a service earned and where it failed.

CLI, examples, and release channels

The CLI scaffolds Hono, Express, TanStack, and Next.js projects from templates, and a guarded deploy package handles provider deployment. Public npm packages form a Stable channel, while the repository keeps a Next channel that can run ahead. The docs are explicit that a team should keep every package on one channel, since mixing Stable and Next is a common source of breakage.

Pros and cons

Pros

  • One typed contract drives routes, payments, discovery, and adapters, which cuts the duplicate code usually needed around a paywall.
  • Protocol agnostic by design, with x402 and MPP support and adapters for four popular frameworks.
  • Payment admission, policy, idempotency, and analytics ship together, so the controls a paid service needs are not left to the developer.
  • MIT licensed and open source, so the runtime can be read, forked, and self-hosted.
  • Guards against double charging by tying each payment to one fulfillment through idempotency keys.

Cons

  • Aimed at developers, not end users, so anyone without TypeScript and a Bun or Node setup cannot try it directly.
  • Protocol coverage is partial, as the docs note for full A2A v1 transport and x402 Bazaar, which limits interoperability promises.
  • Requires an external wallet, facilitator, and network, so the first paid call means extra setup and testnet funds before it works.
  • Mixing the Stable and Next channels can break a build, which adds a version discipline many teams are not used to.
  • A hosted platform exists but its API base URL and terms come from the hosted product owner, not the open source docs.

Frequently asked questions

Lucid Agents is a TypeScript runtime for machine commerce from Daydreams. It turns typed functions into services that other agents and applications can discover, call, pay for, stream, or run as tasks, using the daydreamsai/lucid-agents repository.