Oxyy API Documentation
Oxyy gives you one endpoint and one API key for 170+ models — text, vision, images, video, speech and embeddings — behind the OpenAI wire format. If your code already speaks to OpenAI, changing the base URL is the whole migration.
https://api.oxyy.ai/v1 — set it as base_url (Python) or baseURL (JavaScript) and keep the rest of your code. The Anthropic and Google SDKs use the bare host instead; see Vendor SDKs.What you can call
| Endpoint | What it does | Shape |
|---|---|---|
POST /v1/chat/completions | Text, vision, tools, structured output, and images answered over chat | Sync or streaming |
POST /v1/responses | The OpenAI Responses API, for the Agents SDK and Codex | Sync or streaming |
POST /v1/images/generations | Text to image | Sync, or a job with async |
POST /v1/images/editsPOST /v1/images/variations | Edit or vary an existing image | Sync |
POST /v1/videos/generationsPOST /v1/videos/image-to-video | Text or image to video | Job — always asynchronous |
POST /v1/audio/speech | Text to speech, and music | Audio bytes, or a job with async |
POST /v1/audio/transcriptionsPOST /v1/audio/translations | Speech to text, and speech to English text | Sync |
POST /v1/embeddings | Vectors for search, clustering and RAG | Sync |
POST /v1/rerank | Order documents by relevance to a query | Sync |
POST /v1/moderations | Classify text or images against a content policy | Sync |
POST /v1/batches | Many chat completions from one uploaded file, results as a file | Job — runs within 24 hours |
GET /v1/models | The model list, with pricing and whether your key may call each one | Sync |
POST /v1/assets/upload | Host a file for 12 hours and get a URL to reference | Sync |
POST /v1/messages | Anthropic Messages API — Claude models | Sync or streaming |
POST /v1beta/models/{model}:generateContent | Google GenAI API — Gemini models | Sync or streaming |
Authentication
Every request carries your API key. Create one on the API keys page after signing up. The standard form is a bearer token:
# The standard form — every endpoint accepts it. curl https://api.oxyy.ai/v1/models \ -H "Authorization: Bearer $OXYY_API_KEY" # Vendor-SDK forms, accepted on every endpoint so an SDK # configured for Anthropic or Google needs no interception. curl https://api.oxyy.ai/v1/models -H "x-api-key: $OXYY_API_KEY" curl https://api.oxyy.ai/v1/models -H "x-goog-api-key: $OXYY_API_KEY"
# Read the key from the environment. Never commit it, and never # ship it in browser or mobile code — anyone can read it there. import os from openai import OpenAI client = OpenAI( api_key=os.environ["OXYY_API_KEY"], base_url="https://api.oxyy.ai/v1" )
Three header forms are accepted on every endpoint, so an SDK written for another vendor works without interception:
| Form | Sent by | Example |
|---|---|---|
Authorization: Bearer <key> | OpenAI SDK, plain HTTP | Authorization: Bearer sk-oxyy-… |
x-api-key: <key> | Anthropic SDK | x-api-key: sk-oxyy-… |
x-goog-api-key: <key> or ?key= | Google GenAI SDK | x-goog-api-key: sk-oxyy-… |
Quick start
OXYY_API_KEY.https://api.oxyy.ai/v1. Nothing else changes.GET /v1/models.# pip install openai import os from openai import OpenAI client = OpenAI( api_key=os.environ["OXYY_API_KEY"], base_url="https://api.oxyy.ai/v1" ) response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content) print(response.usage.cost, "USD")
// npm install openai import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.OXYY_API_KEY, baseURL: 'https://api.oxyy.ai/v1' }); const response = await client.chat.completions.create({ model: 'gpt-5.5', messages: [{ role: 'user', content: 'Hello!' }] }); console.log(response.choices[0].message.content); console.log(response.usage.cost, 'USD');
curl https://api.oxyy.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OXYY_API_KEY" \ -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello!"}]}'
usage.cost is what the request charged, in USD. You never have to open a dashboard to find out what a call cost — see Usage & cost.Documentation by topic
Every topic has its own page with the full reference, code samples and, where it applies, the models that endpoint serves. Start with the quick start above, then open what you need.
Guides
Models
Read the live model list from GET /v1/models instead of hard-coding one: each entry carries its pricing, context window, modalities and whether your tier may call it. Also covers the detail endpoint and which endpoint serves each model type.
Streaming
Set stream: true and the reply arrives as server-sent events, on chat completions, responses and both vendor SDKs. Shows the wire format, the final usage chunk, and what happens when a stream fails or the client disconnects.
Tool calling
Declare functions once in the OpenAI tools format and any model that supports tools can ask you to run one. Covers tool_choice, parallel calls, the tool-call turn and how to send the results back.
Structured outputs
Make a model answer with JSON instead of prose using response_format: a json_schema to enforce a shape, or json_object for any valid JSON. Works the same on providers without a native schema mode.
Multimodal input
Send images, audio clips and PDFs to chat completions as content parts, by URL or as base64. Lists the accepted part types, the per-file size caps and how the URLs you supply are fetched.
Reasoning
Control how much a reasoning model thinks with reasoning_effort, or Anthropic's thinking object on Claude. Shows where the reasoning text, the structured reasoning blocks and the reasoning token count appear on a response.
Prompt caching
A repeated prompt prefix can be read from the provider's cache at a fraction of the input rate. Explains the cached and cache-write token fields and how to order a prompt so it gets cache hits.
Usage & cost
Every response carries usage.cost, the exact amount charged in USD, with a breakdown by axis. Covers token counts in both vocabularies, usage on a stream, and the X-Request-Id to quote in a support request.
API reference
Chat completions
The main endpoint, POST /v1/chat/completions: every parameter with its accepted values and defaults, code in Python, JavaScript, cURL, PHP and Go, an example response, and a searchable list of the chat models.
Responses API
The OpenAI Responses API for clients built on client.responses.create, such as the OpenAI Agents SDK. Nothing is stored, so each turn sends the whole conversation. Includes examples and a table of supported and refused features.
Images
Generate images with POST /v1/images/generations, then edit or vary them. Covers sizes, quality and output formats, asynchronous jobs, an example response, and the image models you can call.
Video
Video generation is always a job: submit it to POST /v1/videos/generations, poll until it completes, then download the file. Covers the parameters, image to video, managing jobs, and the video models.
Text to speech
Turn text into speech, or generate music, with POST /v1/audio/speech. Covers which voices each model family takes, audio formats, speed, asynchronous jobs, and the text-to-speech and music models.
Speech to text
Transcribe audio, or translate it into English, from an upload, a URL or base64. Covers the output formats including SRT and VTT, word and segment timestamps, speaker diarization, and the speech-to-text models.
Embeddings
Turn text into vectors for semantic search, clustering and RAG with POST /v1/embeddings. Covers batch limits, the two encoding formats, shortened dimensions, and the embedding models.
File inputs
Every endpoint that takes a file accepts an upload, a URL or base64. Covers the 12-hour asset store, the size limits and accepted types per category, image editing, and image to video.
Vendor SDKs
Anthropic SDK
Call Claude models with Anthropic's official SDK by pointing it at https://api.oxyy.ai. Covers authentication, the Messages and count_tokens endpoints, prompt caching and thinking, and the supported features.
Google GenAI SDK
Call Gemini models with Google's google-genai and @google/genai SDKs by setting the base URL in their HTTP options. Covers generateContent, streaming, countTokens and the supported features.
Reference
SDKs & libraries
Oxyy speaks the OpenAI wire format, so the official OpenAI SDK in any language works once the base URL is changed. Lists the package per language, frameworks, the vendor SDKs, and how Oxyy differs from other gateways.
Rate limits
Limits are set by your tier and apply per API key: requests and tokens per minute, daily caps per modality, and requests in flight. Lists the rate-limit headers and how to back off on a 429.
Idempotency
Send an Idempotency-Key and a retried request returns the original answer instead of generating, and charging for, a second one. Lists the rules: the 24-hour replay window, 409 on a changed body, and what is never stored.
Errors
Errors use standard HTTP status codes and the OpenAI error envelope. A table of every status from 400 to 504 with what to do about it, which errors to retry, and a Python handling example.
Models and providers you can call
Every model below is reachable with the same API key. Open one for its exact id, pricing, limits and the endpoint it is called on.
AI providers
Popular models
- Gemini 2.5 Flash-Lite
- Gemini 3.1 Flash-Lite
- Muse Image 1.0
- Gemini 2.5 Flash
- Gemini 3 Flash
- Gemini 3.8 Flash
- Gemini 3.5 Flash-Lite
- Claude Haiku 5.5
- Gemini 3.1 Flash TTS
- GPT-5.6 Luna
- Gemma 4 26B A4B Instruct (MoE)
- Eleven Multilingual v2
- Eleven v4
- Claude Sonnet 5.5
- Claude Opus 5.5
- Gemini 3.8 Flash TTS
- Gemini 4 Argon
- Claude Haiku 4.5
- Gemma 4 31B Instruct
- Gemini 3.7 Flash
- GPT-Image-2.5 Flare
- DeepSeek-V4.1-Flash
- Claude Sonnet 5
- Scribe v2
