Providers
OpenAI
Use OpenAI completion and embedding models with Anvia.
Use @anvia/openai when you want OpenAI models or an OpenAI-compatible endpoint.
import { AgentBuilder } from "@anvia/core";
import { OpenAIClient } from "@anvia/openai";
const openai = new OpenAIClient({ apiKey });
const model = openai.completionModel("gpt-5");
const agent = new AgentBuilder("support", model)
.instructions("You are a helpful assistant.")
.build();
const response = await agent.prompt("Hello!").send();Models
| Capability | Example |
|---|---|
| Completion | openai.completionModel("gpt-5") |
| Embeddings | openai.embeddingModel("text-embedding-3-small") |
| Compatible endpoint | new OpenAIClient({ baseUrl, apiKey }) |
Credentials are passed explicitly to the constructor. Anvia does not read environment variables.
