Skip to content

What is One Agent SDK?

One Agent SDK is a provider-agnostic TypeScript SDK for building LLM agents with tools and multi-agent handoffs. It supports both CLI agent SDKs (Claude Code, ChatGPT Codex, Copilot, Kimi-CLI) and API-key providers (OpenAI, Anthropic, OpenRouter) with a unified streaming interface (AsyncGenerator<StreamChunk>).

Why?

Each LLM provider has its own SDK with different APIs, streaming formats, and tool-calling conventions. One Agent SDK abstracts these differences so you can:

  • Write once, run anywhere — swap providers by changing a single string
  • Use a consistent streaming format — the same StreamChunk union type across all backends
  • Build multi-agent systems — agents can hand off to each other regardless of provider
  • Validate responses — parse agent output into typed objects with Zod schemas
  • Manage conversations — session history with pluggable storage backends
  • Transform streams — composable middleware for logging, filtering, and more

Supported Providers

CLI Agent Providers

ProviderSDKAgent Backend
claude-code@anthropic-ai/claude-agent-sdkClaude Code
codex@openai/codex-sdkChatGPT Codex
copilot@github/copilot-sdkGitHub Copilot
kimi-cli@moonshot-ai/kimi-agent-sdkKimi-CLI

API-Key Providers

ProviderSDKAPI Backend
openaiopenaiOpenAI API (GPT-4o, etc.)
anthropic@anthropic-ai/sdkAnthropic API (Claude Sonnet, etc.)
openrouteropenaiOpenRouter (any model)

All providers are optional peer dependencies — install only the ones you need. You can also register custom providers.

How It Works

run(prompt, config)
  → resolves provider (registry or built-in)
  → applies middleware pipeline
  → returns { stream, chat, close }

The stream is an AsyncGenerator<StreamChunk> that yields events as the agent processes your prompt. The chat function lets you send follow-up messages, and close cleans up resources.