YepAPI
AI Models

Chat Completions

Unified endpoint for 130+ LLM models. OpenAI-compatible drop-in replacement — just change the base URL.

POST/v1/ai/chat/completions
$0.01/call

Overview

A single endpoint that gives you access to 130+ LLM models from OpenAI, Anthropic, Google, Meta, DeepSeek, xAI, Qwen, Mistral, Perplexity, and more. Fully OpenAI-compatible — swap the base URL and it works with any OpenAI SDK.

There are two ways to call the AI API:

EndpointFormatModel Source
POST /v1/ai/chat/completionsOpenAI-compatible (snake_case)model field in body
POST /v1/ai/chatYepAPI simplified (camelCase)model field in body

Both hit the same infrastructure. Pick whichever fits your stack.

OpenAI SDK Drop-In

Point any OpenAI SDK at YepAPI by changing the base URL:

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_API_KEY",
  baseURL: "https://api.yepapi.com/v1/ai",
});

const response = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-4.6",
  messages: [{ role: "user", content: "Explain quantum computing in one paragraph." }],
});

console.log(response.choices[0].message.content);

Works with Python, Node, Go, or any language with an OpenAI-compatible client.

To label requests with your app, pass the optional X-App-Name, X-App-Website and X-App-Description headers (see Authentication). Code that already sends OpenRouter's X-Title and HTTP-Referer keeps working as is.

const client = new OpenAI({
  apiKey: "YOUR_API_KEY",
  baseURL: "https://api.yepapi.com/v1/ai",
  defaultHeaders: {
    "X-App-Name": "Support Bot",
    "X-App-Website": "https://support.example.com",
  },
});

Usage

OpenAI-Compatible Endpoint

const res = await fetch("https://api.yepapi.com/v1/ai/chat/completions", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "anthropic/claude-sonnet-4.6",
    messages: [{ role: "user", content: "What is the capital of France?" }],
    temperature: 0.7,
    max_tokens: 1024,
  }),
});
const data = await res.json();
console.log(data.choices[0].message.content);
curl -X POST https://api.yepapi.com/v1/ai/chat/completions \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4.6",
    "messages": [{"role": "user", "content": "What is the capital of France?"}],
    "temperature": 0.7,
    "max_tokens": 1024
  }'

YepAPI Simplified Endpoint

const res = await fetch("https://api.yepapi.com/v1/ai/chat", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "claude-sonnet-4.6",
    messages: [{ role: "user", content: "What is the capital of France?" }],
    temperature: 0.7,
    maxTokens: 1024,
  }),
});
const { data } = await res.json();
console.log(data.message.content);
Info

The /v1/ai/chat endpoint accepts short aliases like gpt-4o, claude-sonnet, or gemini-flash — no need for the full provider/model format.

Request Body

/v1/ai/chat/completions (OpenAI-compatible, snake_case)

ParameterTypeRequiredDescriptionDefault
modelstringYesModel ID (e.g. openai/gpt-4o, anthropic/claude-sonnet-4.6)—
messagesobject[]YesArray of { role, content } objects—
max_tokensnumberNoMaximum tokens in the responseModel default
temperaturenumberNoSampling temperature (0.0–2.0)1.0
top_pnumberNoNucleus sampling threshold1.0
frequency_penaltynumberNoPenalize repeated tokens0
presence_penaltynumberNoPenalize tokens already present0
stopstring | string[]NoStop sequences—
streambooleanNoEnable SSE streamingfalse
response_formatobjectNo{ "type": "json_object" } or { "type": "json_schema", "json_schema": {...} } for structured output. Forwarded to the model; support varies by provider.—
toolsobject[]NoFunction-calling tool definitions in the OpenAI shape ({ type: "function", function: { name, description, parameters } })—
tool_choicestring | objectNo"auto", "none", "required", or a specific function"auto" when tools are set
parallel_tool_callsbooleanNoAllow the model to emit several tool calls in one turnModel default
web_searchboolean | objectNoGround the answer in a live web search. true, or { "max_results": 5, "search_prompt": "…" }. See Web search and sources.false
web_search_optionsobjectNoProvider-native search controls (e.g. { "search_context_size": "high" }), forwarded as-is.—

Messages accept the full OpenAI shape, so a tool-calling loop round-trips: an assistant turn may carry tool_calls, and a tool role message carries tool_call_id with the result as content.

/v1/ai/chat (YepAPI simplified, camelCase)

ParameterTypeRequiredDescriptionDefault
modelstringNoModel ID or alias (e.g. gpt-4o, claude-sonnet)openai/gpt-4o-mini
messagesobject[]YesArray of { role, content } objects—
maxTokensnumberNoMaximum tokens in the responseModel default
temperaturenumberNoSampling temperature (0.0–2.0)1.0
topPnumberNoNucleus sampling threshold1.0
frequencyPenaltynumberNoPenalize repeated tokens0
presencePenaltynumberNoPenalize tokens already present0
stopstring | string[]NoStop sequences—
streambooleanNoEnable SSE streamingfalse
responseFormatobjectNoStructured output, same shape as response_format above—
toolsobject[]NoFunction-calling tool definitions, same shape as above—
toolChoicestring | objectNoSame as tool_choice above—
parallelToolCallsbooleanNoSame as parallel_tool_calls above—
webSearchboolean | objectNoSame as web_search above. See Web search and sources.false
webSearchOptionsobjectNoSame as web_search_options above—

Web search and sources

Any chat model can answer from a live web search. Set web_search (or webSearch on /v1/ai/chat) and the model receives current search results along with your prompt:

curl -X POST https://api.yepapi.com/v1/ai/chat \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [{ "role": "user", "content": "What is the current stable version of Rust?" }],
    "webSearch": { "max_results": 5 }
  }'
OptionDescriptionDefault
max_resultsHow many search results the model is given (1–20).5
search_promptReplaces the instruction that introduces the results to the model.—

It works the same across providers — OpenAI, Anthropic, Google, xAI and the rest — so you can run one prompt through several models and compare. The Perplexity Sonar models search on every request without the option.

Where the sources are

/v1/ai/chat returns data.sources: one list of the pages the answer drew on, whichever model produced it.

{
  "ok": true,
  "data": {
    "model": "openai/gpt-4o-mini",
    "message": {
      "role": "assistant",
      "content": "The current stable version of Rust is 1.99.0 …",
      "annotations": [
        { "type": "url_citation", "url_citation": { "url": "https://github.com/rust-lang/rust/releases", "title": "Releases · rust-lang/rust · GitHub" } }
      ]
    },
    "sources": [
      { "url": "https://github.com/rust-lang/rust/releases", "title": "Releases · rust-lang/rust · GitHub" },
      { "url": "https://doc.rust-lang.org/stable/releases.html", "title": "Rust Release Notes" }
    ],
    "usage": { "promptTokens": 1820, "completionTokens": 42, "totalTokens": 1862 },
    "costUsd": 0.02
  }
}
  • data.sources[] — { url, title }, de-duplicated, in the order cited. Absent when the answer used no web sources.
  • data.message.annotations[] — the provider's own citation entries, for callers who want the raw form.

/v1/ai/chat/completions stays a 1:1 OpenAI-compatible response, so there the sources are in choices[0].message.annotations only.

When streaming, citation annotations arrive in the message deltas; the merged sources list is part of the non-streaming response.

Cost

A search adds the price of the search itself and of the extra input tokens the results take up — typically about a cent on a small model, more on models with expensive input tokens. The total is in costUsd as usual.

Model Aliases

The /v1/ai/chat endpoint accepts short aliases so you don't need the full provider/model format:

AliasResolves To
gpt-4oopenai/gpt-4o
gpt-4o-miniopenai/gpt-4o-mini
gpt-5.4openai/gpt-5.4
claude-opusanthropic/claude-opus-5.5
claude-sonnetanthropic/claude-sonnet-5.5
claude-haikuanthropic/claude-haiku-5.5
gemini-progoogle/gemini-2.5-pro
gemini-flashgoogle/gemini-3.8-flash
grokx-ai/grok-4.7
deepseek-v3deepseek/deepseek-v3.2
deepseek-r1deepseek/deepseek-r1-0528
sonar-properplexity/sonar-pro
llama-scoutmeta-llama/llama-4-scout
qwenqwen/qwen3.8-max-0902
mistral-smallmistralai/mistral-small-2603
gpt-6.1openai/gpt-6.1-sol
gemini-4google/gemini-4-argon
kimi-k3moonshotai/kimi-k3
mistral-largemistralai/mistral-large-4-0
mercuryinception/mercury-3

You can also pass the full provider/model format to either endpoint.

Response Formats

/v1/ai/chat/completions (OpenAI-compatible)

{
  "id": "chatcmpl-abc123",
  "object": "text_completion",
  "created": 1713100000,
  "model": "anthropic/claude-sonnet-4.6",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 8,
    "total_tokens": 22
  }
}

/v1/ai/chat (YepAPI simplified)

{
  "ok": true,
  "data": {
    "id": "chatcmpl-abc123",
    "model": "anthropic/claude-sonnet-4.6",
    "message": {
      "role": "assistant",
      "content": "The capital of France is Paris."
    },
    "usage": {
      "promptTokens": 14,
      "completionTokens": 8,
      "totalTokens": 22
    },
    "costUsd": 0.000162
  }
}

Streaming

Set "stream": true to receive Server-Sent Events.

/v1/ai/chat/completions (OpenAI-compatible SSE)

data: {"id":"chatcmpl-abc123","model":"anthropic/claude-sonnet-4.6","choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","model":"anthropic/claude-sonnet-4.6","choices":[{"index":0,"delta":{"content":" capital"},"finish_reason":null}]}
data: [DONE]

/v1/ai/chat (YepAPI simplified SSE)

data: {"id":"chatcmpl-abc123","delta":{"role":"assistant","content":"The"},"model":"anthropic/claude-sonnet-4.6","index":0}
data: {"id":"chatcmpl-abc123","delta":{"content":" capital"},"model":"anthropic/claude-sonnet-4.6","index":0}
data: [DONE]

List Available Models

curl https://api.yepapi.com/v1/ai/models

Returns every available model with pricing, context window, and capabilities. This endpoint is free and does not require authentication.

Under the Hood

We handle auth, billing, and response normalization — you just send messages.

On this page