Frameworks

Connect LangChain, LlamaIndex, the Vercel AI SDK, or another OpenAI-compatible client to Olive.

Point a framework at Olive with three values: the base URL, your API key, and the model id olive. Clients built on an OpenAI client already send the Authorization: Bearer header, so no custom header is needed.

Pass the key explicitly in every client. The Quickstart explains why.

Each framework names these settings differently. Look for "base URL" and "API key".

LangChain

ChatOpenAI takes the base URL and key directly. In JavaScript, the base URL goes under configuration.

# pip install langchain-openai
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="olive",
    base_url="https://api.avey.ai/llm",
    api_key=os.environ["AVEY_API_KEY"],
)

print(llm.invoke("What are the red flags for headache in primary care?").content)

LlamaIndex

Use OpenAILike for an OpenAI-compatible endpoint. Set is_chat_model=True so LlamaIndex calls /chat/completions, which returns Olive's reasoning in reasoning_content.

# pip install llama-index-llms-openai-like
import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="olive",
    api_base="https://api.avey.ai/llm",
    api_key=os.environ["AVEY_API_KEY"],
    is_chat_model=True,
)

Vercel AI SDK

@ai-sdk/openai-compatible takes a base URL and key.

// npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const avey = createOpenAICompatible({
  name: "avey",
  baseURL: "https://api.avey.ai/llm",
  apiKey: process.env.AVEY_API_KEY,
});

const { text } = await generateText({
  model: avey("olive"),
  prompt: "What are the red flags for headache in primary care?",
});

Other OpenAI clients

The OpenAI Agents SDK and Instructor take a client object that you build. Build the client once and pass it in.

# pip install openai-agents  (or: pip install instructor)
import os
from openai import AsyncOpenAI
from agents import OpenAIChatCompletionsModel, set_default_openai_client

client = AsyncOpenAI(
    base_url="https://api.avey.ai/llm",
    api_key=os.environ["AVEY_API_KEY"],
)
set_default_openai_client(client)
model = OpenAIChatCompletionsModel(model="olive", openai_client=client)

Where a framework lets you choose the endpoint, use /chat/completions to get Olive's reasoning in reasoning_content. Function tools, files, and stored responses are on /responses. A framework that wraps those features needs the Responses API, so check that it accepts a custom base URL there. See OpenAI compatibility.

Tools with only a base URL and an API key

Hosted evaluation platforms, IDE plugins, and chat UIs often have two fields and no way to add a header. Those two fields are all Avey needs.

FieldValue
Base URLhttps://api.avey.ai/llm
API keyyour key, which starts with avey_sk1_
Modelolive

If the tool has a provider list, choose "OpenAI-compatible" or "Custom".

Timeouts

Long answers can run for minutes. Set the client's request timeout as described in Errors.

Next steps

Last updated