Providers
Compatible Providers
Use OpenAI-compatible model endpoints with OpenAIClient.
OpenAI-compatible providers use OpenAIClient with an explicit baseUrl.
import { OpenAIClient } from "@anvia/openai";
const provider = new OpenAIClient({
baseUrl: "https://openrouter.ai/api/v1",
apiKey,
});
const model = provider.completionModel("openai/gpt-5");Why This Shape
Anvia does not need a package for every OpenAI-compatible provider. If the provider exposes OpenAI-compatible completion or embedding endpoints, use @anvia/openai and pass the endpoint directly.
| Capability | Example |
|---|---|
| Completion | client.completionModel(modelName) |
| Embeddings | client.embeddingModel(modelName) |
| Custom endpoint | new OpenAIClient({ baseUrl, apiKey }) |
