Installation
Add chai-ai and a provider package to your project.
Install the core package plus whichever provider adapter(s) you need:
npm install chai-ai @chai-ai/openai @chai-ai/google @chai-ai/anthropic zodzod is used to define tool input schemas and structured output schemas, so
it's a required peer alongside chai-ai.
You only need the provider package(s) for the models you actually use — for
example, install just @chai-ai/openai if you're only calling OpenAI models.
Requirements
- Node.js with ESM support (
chai-aiships as an ES module) - TypeScript 5+ recommended, for full type inference on tool
executearguments and structuredoutputSchemaresults - Provider API credentials, set as environment variables the provider
package expects (e.g.
OPENAI_API_KEY,GOOGLE_GENERATIVE_AI_API_KEY,ANTHROPIC_API_KEY)
Next: Quickstart.