Documentation

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.

Base URL 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

EndpointWhat it doesShape
POST /v1/chat/completionsText, vision, tools, structured output, and images answered over chatSync or streaming
POST /v1/responsesThe OpenAI Responses API, for the Agents SDK and CodexSync or streaming
POST /v1/images/generationsText to imageSync, or a job with async
POST /v1/images/edits
POST /v1/images/variations
Edit or vary an existing imageSync
POST /v1/videos/generations
POST /v1/videos/image-to-video
Text or image to videoJob — always asynchronous
POST /v1/audio/speechText to speech, and musicAudio bytes, or a job with async
POST /v1/audio/transcriptions
POST /v1/audio/translations
Speech to text, and speech to English textSync
POST /v1/embeddingsVectors for search, clustering and RAGSync
POST /v1/rerankOrder documents by relevance to a querySync
POST /v1/moderationsClassify text or images against a content policySync
POST /v1/batchesMany chat completions from one uploaded file, results as a fileJob — runs within 24 hours
GET /v1/modelsThe model list, with pricing and whether your key may call each oneSync
POST /v1/assets/uploadHost a file for 12 hours and get a URL to referenceSync
POST /v1/messagesAnthropic Messages API — Claude modelsSync or streaming
POST /v1beta/models/{model}:generateContentGoogle GenAI API — Gemini modelsSync or streaming
Authentication

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:

FormSent byExample
Authorization: Bearer <key>OpenAI SDK, plain HTTPAuthorization: Bearer sk-oxyy-…
x-api-key: <key>Anthropic SDKx-api-key: sk-oxyy-…
x-goog-api-key: <key> or ?key=Google GenAI SDKx-goog-api-key: sk-oxyy-…
Keep the key server-side. Anyone who can read your browser or mobile bundle can read the key in it and spend your balance. Call Oxyy from your own backend and keep the key in an environment variable.
Quick start

Quick start

1
Get a key
Sign up and create one on the API keys page. Export it as OXYY_API_KEY.
2
Point your SDK at Oxyy
Install the official OpenAI SDK and set the base URL to https://api.oxyy.ai/v1. Nothing else changes.
3
Pick a model
Use any id from the chat model list or from 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!"}]}'
Every response prices itself. 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.
All topics

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.