Basic Agent
POST /v1/agents/hello/invoke.
agent() Options
Agent description. Used in the manifest for discovery and documentation.
One of:
prompt, chat, task, thread, workflow. When set, uses predefined input/output schemas. Defaults to prompt.Custom input schema (Zod recommended). Overrides the default schema for the selected type. Zod schemas provide typed handlers and automatic runtime validation.
Custom output schema (Zod recommended). Overrides the default schema for the selected type.
Set to
true if the handler is an async generator. Enables streaming responses.Tags for filtering and organizing agents.
Additional metadata attached to the agent.
The agent’s handler function. Receives
(input, context?) and returns the agent’s output.Agent Types
Each agent type comes with predefined input/output schemas tailored for its use case.Prompt Agent
The default type. Accepts aprompt string and returns a string response.
Chat Agent
Accepts an array of messages and returns a string response.Task Agent
Accepts structured input and returns a structured object.Thread Agent
Accepts messages and returns the full message history including the assistant’s response.Workflow Agent
Supports multi-step workflows with pause/resume capabilities.Context Parameter
The handler receives an optional second argument with execution context, including identity and metadata from the caller.Streaming
Setstream: true and use an async generator to stream responses incrementally.
text_delta events, or yield StreamEvent objects for finer control over the stream:
Custom Schemas
Use Zod schemas for full control over input and output validation with typed handlers.Multiple Agents
Register multiple agents with a singleserve() call. Each agent gets its own endpoint.
POST /agents/{name}/invoke.
serve() Options
List of agents to serve. At least one agent or tool must be provided.
List of tools to serve via MCP. At least one agent or tool must be provided.
Port number. Defaults to the
PORT environment variable or 8080.Hostname to bind. Defaults to the
HOST environment variable or "0.0.0.0".At least one agent or tool must be provided to
serve().Next steps
Creating Tools
Define MCP tools alongside your agents.
Deploying
Ship your
serve() to production.Configuration & Secrets
Pass API keys and config to your handlers.
Frameworks
Wrap OpenAI, Anthropic, LangChain, or Vercel AI agents.