API reference

API reference

OpenAI-compatible API

Vani's Chat Completions (POST /chat/completions) and stateless Responses (POST /responses) endpoints take OpenAI's request and answer formats, so the official OpenAI SDKs and most OpenAI-compatible tools work by changing the base URL to https://api.vani.ai/v1 and using a Vani key. One key reaches every model GET /models lists, not only OpenAI's.

Base URL
https://api.vani.ai/v1
Endpoints
POST /chat/completions · POST /responses
Authentication
Authorization: Bearer vani_…
Model list
GET https://api.vani.ai/v1/models
On this pageQuickstart

Quickstart

Create a key on the Vani API Platform (prepaid) or, on a paid Vani Chat plan, in Developer settings. Then point the OpenAI SDK at Vani and send a model id from GET /models, such as openai/gpt-6-sol, anthropic/claude-sonnet-5.5 or zhipu/glm-5.3.

Python

Python (OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.vani.ai/v1", api_key=os.environ["VANI_API_KEY"])

reply = client.chat.completions.create(
    model="openai/gpt-6-sol",  # any id from GET /models
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)
JavaScript

JavaScript / TypeScript (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.vani.ai/v1", apiKey: process.env.VANI_API_KEY });

const reply = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-5.5", // any id from GET /models
  messages: [{ role: "user", content: "Hello" }],
});
console.log(reply.choices[0].message.content);
Shell

Or set it in the environment (no code change)

export OPENAI_BASE_URL="https://api.vani.ai/v1"
export OPENAI_API_KEY="vani_YOUR_API_KEY"

Chat Completions

  • Messages with text strings or text-only content parts, in the user, assistant, system and tool roles (developer is treated as system).
  • Function tools (up to 64 schemas), tool_choice and parallel_tool_calls. Your client runs the functions and sends the results back.
  • Structured output: response_format of type json_object or json_schema (up to 32 KiB). Validate the result in your client; not every provider enforces a schema strictly.
  • Streaming, with stream_options.include_usage for usage in the last chunk; max_completion_tokens or max_tokens (not both), stop, frequency_penalty, presence_penalty and reasoning_effort.
  • n may be omitted or 1, and store must be false or null.

Responses

POST /responses is stateless: send the whole conversation in input on every call, with store: false. It supports text input and instructions, function and custom tools, MCP tools, text.format structured output and streaming.

Shell

A Responses request

curl "https://api.vani.ai/v1/responses" \
  -H "Authorization: Bearer $VANI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-6-sol","input":"Hello","store":false}'

Responses API: scope and limits

Tools that work with it

Clients that speak Chat Completions or Responses connect the same way: Codex (Responses) and OpenCode (Chat Completions), and, with the settings in their guides, Cursor, Cline, Continue, Aider, Zed, Open WebUI, LibreChat and others. Each guide lists the exact fields and what the client supports.

Client directoryIDE and SDK guidesOpenAI and Anthropic SDK guide

What differs from OpenAI's API

  • Model ids name their maker, for example openai/gpt-6-sol or google/gemini-3.8-flash. A vendor's own id is accepted when it names exactly one model your key can use.
  • The chat endpoints take text: no image, audio or file input. There are no embeddings and no hosted web search, file search or computer tools.
  • Responses keeps no state: no previous_response_id, stored responses or background mode.
  • Images and video have their own endpoints with the same key: /images/generations, /images/edits and /videos (prepaid keys).
  • Every answer carries OpenAI's rate-limit headers (x-ratelimit-*), and usage reports cached and reasoning tokens.

Note

OpenAI-compatible describes the request and answer formats Vani accepts. The Vani API is a Vani AI service, not an OpenAI product.

Model ids, limits, headers and usageMedia API: images and videosAPI prices per model

More reference: Anthropic-compatible API · Model ids, limits, headers and usage · MCP tools on the API · Media API: images and videos · Artifacts API · Responses API: scope and limits · API overview · Docs and quickstart

We use cookies for analytics and to measure how well our campaigns are working. None of it is needed to run the site, and your conversations are never included. See our Privacy Policy.