Basics
Install packages
Install the smallest stack and choose the provider package your app needs.
Install @anvia/core plus one provider package. The core package is provider-neutral; a provider package turns a vendor API into a model that the core runtime can call.
Read Providers overview if you need to choose between OpenAI, Anthropic, Gemini, and Mistral before continuing.
Prerequisites
Start from a TypeScript project that can import ESM packages. The examples use pnpm, but the package list is the important part.
Minimal install
For the OpenAI examples in Basics:
pnpm add @anvia/core @anvia/openai
Set your provider credentials in the environment:
OPENAI_API_KEY=...
Then create a model:
import { OpenAIClient } from "@anvia/openai";
const client = new OpenAIClient({
apiKey: process.env.OPENAI_API_KEY,
});
const model = client.completionModel("gpt-5");
Optional packages
Add these only when your app needs them:
pnpm add @anvia/server @anvia/react @anvia/logger
@anvia/server exposes runtime streams from server routes. @anvia/react consumes runtime streams in React clients. @anvia/logger sends runtime observer events into application logs.
Add local development tooling when you need isolated command execution or a browser runtime console:
pnpm add @anvia/sandbox @anvia/studio
@anvia/sandbox creates sandbox-backed tools for agents. @anvia/studio serves a local UI for running agents, inspecting sessions, and viewing traces.
Schema validation
Pages that use structured output or tools import Zod directly:
pnpm add zod
Use Zod when your app needs validated inputs or schema-validated model output.
Check yourself
You are ready for the next page when your project has @anvia/core, one provider package, and a provider API key available in the environment.
Next
Call the model once before adding agents.
