New Model AvailableCheck the models page for the latest additions.View all models
AI Infrastructure • GA

Reliable Routing, Your Keys, Full Control.

OpenAI API adds health-aware routing, automatic failover, billing visibility, and governance on top of your provider accounts.

Keep your existing provider relationships and pricing. OpenAI API becomes the AI infrastructure layer for routing, policy control, and team visibility.

See How It Works
OpenAIYour Keys
Models275+
Providers28
Max Context10M+
275+
Models
28
Providers
10M+
Max Context
<200ms
Routing Latency
3 lines
To Integrate
Powering AI across leading model providers

Why OpenAI API

Not just an API proxy — a control plane that makes your AI stack more reliable, transparent, and flexible.

1 line
to switch providers

Zero Lock-in

Keep your provider accounts and pricing. Switch models or providers by changing one string — no migration, no rewrite.

  • OpenAI SDK compatible — works with Cursor, Claude Code, any client
  • Bring your own API keys, keep your existing contracts
  • Add or drop a provider in seconds, not sprints
3 controls
fallback, objective, basket

Smart Routing

Automatic failover, provider health tracking, and approved cost-aware routing keep requests moving without hiding what the router did.

  • Automatic failover when a provider goes down
  • Approved model-basket optimization (Beta)
  • Measured routing evidence in request logs and analytics
100%
spend transparency

Full Visibility

See exactly where every token goes. Track usage by team, key, or model — and set limits before you get a surprise bill.

  • Real-time token & cost tracking per API key
  • Spending limits and budget alerts
  • Full audit trail for every request

Power OpenClaw Agents Across Every Channel

Build reliable multi-channel AI bots with automatic failover, multimodal support (vision, audio, PDF), and 125+ models. OpenAI API adds health-aware routing, cost visibility, and enterprise security to your OpenClaw deployments.

Explore OpenClaw Integration →
WhatsAppTelegramDiscordSlack

Cut AI Spend With Guardrails

OpenAI API helps you compare baseline cost vs selected route, shadow-test cheaper approved models, and prove savings in logs and analytics.

Beta

Approved Model Basket

Pick a baseline model, then approve cheaper alternatives for the same workload. Start in shadow mode, then opt into live cost routing only for that basket.

  • Baseline: Claude Sonnet 4.6 → Approved alt: GPT-4.1 mini
GA

Prompt Caching

On models whose vendor publishes a cached input rate, cache hits are billed at that rate, not at the full input rate. This matters most for agents and workflows with a long, repeated system prompt.

  • Where a cached rate is published it is typically 4-10x below uncached input

Measured Savings Evidence

Request logs and Activity show baseline charge, selected route, realized savings, and shadow-mode recommendations so teams can verify what changed.

  • Logs: baseline vs selected vs saved, per request
  • Illustrative example: support triage team
  • Before: every request stays on one premium baseline model
  • After: baseline stays protected, a cheaper approved model runs in shadow first, then goes live for eligible flows
  • Illustrative: 20-35% lower model spend

Illustrative example only. Actual savings depend on your approved model basket, traffic mix, and prompt shape.

Up and Running in Minutes

Change one line. Get access to every major AI model with built-in reliability.

01

Point Your SDK

Swap your base URL to OpenAI API. Works with any OpenAI-compatible client — Cursor, Claude Code, LangChain, your own app.

02

We Apply Your Policy

OpenAI API applies provider health, fallback rules, and your routing objective. If the first route fails, it moves to the next approved path automatically.

03

You Get Results

Same response format you already use. Plus usage tracking, cost visibility, and team controls — with zero extra code.

Your AppPolicy + Failover

Featured Models

Access top-tier models from leading providers through a single unified API.

View all models
GPT-5.2400K ctx
openai/gpt-5.2
Input$1.89 / 1M tokens
Output$15.12 / 1M tokens
textimage
Use Model
GPT-4o128,000 ctx
openai/gpt-4o
Input$2.70 / 1M tokens
Output$10.80 / 1M tokens
textimage
Use Model
GPT-5400K ctx
openai/gpt-5
Input$1.35 / 1M tokens
Output$10.80 / 1M tokens
textimage
Use Model
o3200K ctx
openai/o3
Input$2.16 / 1M tokens
Output$8.64 / 1M tokens
textimage
Use Model
GPT Image 1-- ctx
openai/gpt-image-1
Image$0.0454 / image
Input$5.40 / 1M tokens
textimage
Use Model
GPT-4.11.0M ctx
openai/gpt-4.1
Input$2.16 / 1M tokens
Output$8.64 / 1M tokens
textimage
Use Model

Common Questions

Learn how OpenAI API handles routing, billing visibility, BYOK, and tool compatibility.

Is OpenAI API just a model gateway?

OpenAI API is the AI infrastructure layer between your apps and model providers. It keeps an OpenAI-compatible integration surface while adding routing, billing visibility, spend controls, and team governance.

Can we keep our existing provider accounts and contracts?

Yes. OpenAI API supports bring-your-own-key workflows so teams can keep existing provider relationships and pricing while using OpenAI API for reliability, policy control, and shared visibility.

Does it work with Cursor, Claude Code, and OpenAI-compatible SDKs?

Yes. Teams can start with the OpenAI-compatible quickstart and use the dedicated vibe coding setup flow for Cursor, Claude Code, Windsurf, Cline, and similar tools.

How does OpenAI API improve reliability?

OpenAI API applies provider health checks, routing policy, and automatic failover before a request is sent. Teams can verify outcomes with direct provider headers and request traces on the transparent routing page.

What do teams get beyond a single API key?

OpenAI API adds request-level usage tracking, spend visibility, auditability, and team controls so finance, ops, and engineering can manage shared AI traffic without building that layer themselves.

typescripthttps://api.openaiapi.lol/v1
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.openaiapi.lol/v1",
  apiKey: "sk-your-key",
});

const response = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});
OpenAI API — One API for the OpenAI Model Family