NEWRealtime audio WebSocket now available

One API for every AI model

Route conversations to OpenAI, Claude, Gemini, Mistral, Cohere, Llama, and more — all through one consistent REST and WebSocket API. Streaming, realtime audio, vision, cost tracking, and team management included.

Get API KeyRead the Docs
terminal
curl -N https://onechatapi.com/api/chat/events \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Explain Go channels",
    "model": "gpt-4o",
    "conversationID": ""
  }'

12+ providers. More added regularly.

OpenAIAnthropicGoogleMistralCohereMeta (Llama)X.AI (Grok)PerplexityElevenLabsQwenReplicate

Features

Everything you need to ship AI products

Streaming Chat

SSE endpoint returns token-by-token responses as they're generated. WebSocket mode available for bidirectional, persistent connections.

Realtime Audio

Audio WebSocket for live voice conversations via OpenAI, Google, or ElevenLabs. Supports PCM16 audio streams, transcripts, and interruption handling.

Vision & Files

Attach images to any vision-capable model. File embeddings via pgvector for semantic search and RAG workflows.

Multi-tenant teams

Invite members, share conversations, and manage role-based access across your organization.

Cost tracking

Per-message token counts and USD cost tracked per model. Monitor spend in real time.

Profiles & System prompts

Reusable instruction sets with custom temperature, top_p, and model defaults.

Subscription tiers

Built-in Stripe billing with token budgets per tier. Monetize your AI product out of the box.

Model catalog API

Query capabilities, pricing, context windows, and benchmarks for every supported model.

Quick Start

Start building in minutes

curl

bash
curl -N https://onechatapi.com/api/chat/events \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello", "model": "gpt-4o", "conversationID": ""}'

JavaScript

javascript
const response = await fetch('https://onechatapi.com/api/chat/events', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + token,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    message: 'Explain Go channels in one paragraph',
    model: 'gpt-4o',
    conversationID: '',
  }),
});

const reader = response.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  console.log(decoder.decode(value));
}

Language examples

Use any language, zero dependencies

The API follows the OpenAI SSE format, so it works with plain HTTP clients. No SDK required — just set your API_KEY env var and start streaming.

$pip install requests
chat.py
import requests
import json
import os

API_KEY = os.environ["API_KEY"]
BASE_URL = "https://onechatapi.com"

def stream_chat(message: str, model: str = "gpt-4o") -> str:
    response = requests.post(
        f"{BASE_URL}/api/chat/events",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json={
            "message": message,
            "model": model,
            "conversationID": "",
        },
        stream=True,
    )
    response.raise_for_status()

    full_response = ""
    for line in response.iter_lines():
        if not line.startswith(b"data: "):
            continue
        chunk = json.loads(line[6:])
        content = (
            chunk.get("choices", [{}])[0]
            .get("delta", {})
            .get("content", "")
        )
        if content:
            print(content, end="", flush=True)
            full_response += content

    return full_response


if __name__ == "__main__":
    stream_chat("Explain Go channels in one paragraph")

Each chunk follows the OpenAI chat.completion.chunk format. The final chunk includes usage with prompt/completion token counts and USD cost.

Why us

Why not just use the provider APIs directly?

FeatureProvider APIsonechatapi.com
Switch models✕Rewrite integration✓Change model param
Auth per provider✕Multiple API keys✓One JWT
Usage tracking✕DIY✓Built-in, per message
Realtime audio✕Only OpenAI✓OpenAI + Google + ElevenLabs
Team collaboration✕Not included✓Invites, orgs, sharing
Billing✕DIY✓Stripe, included

Pricing

Simple, usage-based plans

Start free. Upgrade as you scale. All plans include API access, usage tracking, and no vendor lock-in.

Free

$0/month

Try the API with no credit card required.

  • 100k tokens / month
  • GPT-4o mini, Gemini Flash
  • SSE streaming chat
  • REST API access
  • 1 user
  • Community support
  • No WebSocket
  • No audio
  • No vision
Get started

Starter

$9/month

For side projects and early-stage products.

  • 2M tokens / month
  • GPT-4o, Claude Haiku, Gemini Pro
  • SSE + WebSocket chat
  • Vision & file attachments
  • Cost tracking per message
  • 1 user
  • Email support
  • No audio
  • No team features
Get started
Most popular

Pro

$49/month

For production apps that need the full stack.

  • 10M tokens / month
  • All models — GPT-4o, Claude Sonnet, Gemini Ultra, Mistral, Cohere, Llama, Grok
  • SSE + WebSocket + Realtime Audio
  • Vision, files & embeddings
  • Profiles & system prompts
  • Cost tracking & usage analytics
  • Up to 5 users
  • Priority support
Start free trial

Max

$99/month

For high-volume apps with advanced requirements.

  • 50M tokens / month
  • All models + early access to new ones
  • All transport modes
  • Unlimited profiles
  • Up to 20 users
  • SLA + dedicated support
Get started

Need more? Contact us for enterprise pricing — custom token budgets, SSO, and dedicated infrastructure.

API Reference

Explore the API

POST

/api/chat/events

Streaming chat (SSE)

WS

/chat/ws/{id}

WebSocket chat — bidirectional, persistent

WS

/chat/audio/ws/{id}

Realtime audio — voice conversations

GET

/api/chat/models

Your available models

GET

/api/models/catalog

Full catalog with pricing, context windows, benchmarks

View full API reference

Authentication

Simple authentication

Sign in with email/password or Google OAuth to get a JWT token. Use it as a Bearer token on every request.

🔑

JWT Bearer Token

All protected endpoints require a JWT bearer token.

G

Google OAuth

Sign in with Google for instant access.

👤

Guest Access

Read-only access to shared conversations.

auth.sh
# Sign in
curl -X POST https://onechatapi.com/signin \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "..."}'

# Use token
curl https://onechatapi.com/api/chat/models \
  -H "Authorization: Bearer <your_jwt_token>"