Anvia
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

CapabilityExample
Completionopenai.completionModel("gpt-5")
Embeddingsopenai.embeddingModel("text-embedding-3-small")
Compatible endpointnew OpenAIClient({ baseUrl, apiKey })

Credentials are passed explicitly to the constructor. Anvia does not read environment variables.