Quickstart

Build a working agent in under 5 minutes.

Option 1: High-Level API (Simplest)

import { createRegentAgent } from 'regent-sdk';
import { z } from 'zod';
import { createAgentApp } from '@regent/hono';

const agent = await createRegentAgent({
  name: 'my-agent',
  description: 'A helpful assistant',
  version: '1.0.0',
  http: { port: 3000 },
});

// Add an entrypoint
agent.runtime.entrypoints.add({
  key: 'greet',
  input: z.object({ name: z.string() }),
  output: z.object({ message: z.string() }),
  handler: async ({ input }) => ({ output: { message: `Hello, ${input.name}!` } }),
});

// Serve it with an adapter (Hono example)
const { app } = await createAgentApp(agent.runtime);

export default {
  port: 3000,
  fetch: app.fetch,
};

Option 2: Using the CLI

Select:

  1. Adapter: hono

  2. Template: blank (or axllm for LLM-powered)

Then:

Option 3: Low-Level API (Full Control)

Test Your Agent

View the Agent Manifest

Returns the Agent Card describing capabilities:

List Entrypoints

Invoke an Entrypoint

Response:

Add Streaming

For LLM responses or long operations, use streaming:

Test streaming:

Response (SSE):

Add Payments

Monetize your agent with x402:

Set environment variables:

Register On-Chain Identity

Project Structure

A typical Regent agent project:

Next Steps

Last updated