Skip to main content
kenpachi talks to LLMs over raw fetch. Both built-in providers support streaming (streamTurn) automatically — no extra config for agent.stream() or onText.

Anthropic Provider

Options

string
required
Anthropic API key string.
string
required
Model name — must be explicitly specified (e.g. "claude-sonnet-4-6", "claude-3-5-haiku-20241022").

OpenAI Provider

Options

string
required
OpenAI API key string.
string
required
Model name — must be explicitly specified (e.g. "gpt-4o", "gpt-4o-mini", "gpt-4-turbo").

Custom providers

Implement the ModelProvider interface to plug in any backend:
If you only implement createTurn, streaming still works — text is emitted as a single chunk.

Tool Serialization Across Providers

kenpachi automatically converts Zod tool schemas into standard JSON Schemas (serializeZodSchema) and maps them to provider-specific function declaration shapes:

Anthropic Provider

Maps tools to Anthropic’s expected input_schema shape:

OpenAI Provider

Maps tools to OpenAI’s function declaration shape: