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 theModelProvider interface to plug in any backend:
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 expectedinput_schema shape: