Compatible Gateways

Helicone AI Gateway

Use Helicone AI Gateway's OpenAI-compatible API with Anvia.

Helicone AI Gateway exposes a unified OpenAI-compatible API at https://ai-gateway.helicone.ai.

Create the Client

import { AgentBuilder } from "@anvia/core";
import { OpenAIClient } from "@anvia/openai";

const client = new OpenAIClient({
  baseUrl: "https://ai-gateway.helicone.ai",
  apiKey: process.env.HELICONE_API_KEY,
});

const model = client.completionModel("gpt-4o-mini");

const agent = new AgentBuilder("support", model)
  .instructions("Answer support questions clearly.")
  .build();

const response = await agent.prompt("Hello!").send();

console.log(response.output);

Use the model ids and routing formats configured in Helicone.

Get the Model List

If your Helicone AI Gateway route exposes a model registry through the OpenAI-compatible models endpoint, call listModels().

const models = await client.listModels();

console.table(models.data.map((model) => ({ id: model.id, owner: model.ownedBy })));

Notes

  • Helicone AI Gateway focuses on unified routing, fallbacks, and observability. Its gateway documentation currently describes the gateway as beta.
  • Model ids, routing, and fallback behavior are controlled by Helicone and the upstream provider.
  • Test specific model behavior before enabling tools, structured output, attachments, or multimodal features.

For current Helicone details, see the Helicone AI Gateway overview.