Both official APIs
POST /v1/chat/completions and POST /v1/responses run in the official format as sent. Responses supports SSE and WebSocket, plus the /compact and /input_tokens endpoints.
OpenAI API
The official OpenAI SDKs, Codex, Cursor and other compatible tools only need base_url pointed at UnioAPI. Both Chat Completions and Responses are available, with fields, streaming events and error shapes matching the official API.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.unioapi.com/v1",
api_key=os.environ["UNIO_API_KEY"],
)
response = client.responses.create(
model="gpt-6.1-sol",
input="Explain prompt caching in one sentence.",
reasoning={"effort": "low"},
)
print(response.output_text)The OpenAI SDK's base_url includes /v1; for Chat Completions call client.chat.completions.create with the same key.
POST /v1/chat/completions and POST /v1/responses run in the official format as sent. Responses supports SSE and WebSocket, plus the /compact and /input_tokens endpoints.
GPT-6, GPT-6.1, GPT-5.6, GPT-5.5 and GPT-5.4 all have 1.05M context and 128K output. Requests with more than 272K input tokens are billed at long-context prices for the whole request.
Use reasoning_effort in Chat Completions and reasoning.effort in Responses. Each model supports its own range, shown on its model page, and values are applied as sent.
Pick Standard, Fast, Flex or Ultrafast with service_tier. Flex suits offline work, and Ultrafast is available on select models. See Models and pricing for supported tiers.
Repeated prefixes hit the cache automatically, and GPT-5.6 and later can request a 12-hour cache lifetime through Responses.
Console request logs list the model, reasoning effort, tokens, latency and charge of each call, filterable by API key and endpoint.
Redeem credit in the console and create an API key; each key can have its own spend cap and expiry.
Read the docsSet the OpenAI SDK's base_url to https://api.unioapi.com/v1 and use model IDs from the model pages, without a vendor prefix.
Read the docsResponses is recommended for new projects; Responses-only models such as the Pro line return 404 on Chat Completions.
Read the docsTry Fast for interactive work and Flex for offline jobs. If Fast or Ultrafast is unavailable at dispatch, the gateway tries the same model at Standard.
Read the docsEach call is settled from its response usage: input, cache reads, cache writes and output are priced separately, and each service tier and long context has its own prices. The model pages list current prices.
Set base_url to https://api.unioapi.com/v1, use your UnioAPI key, and use model IDs from the model pages. Nothing else changes.
Create an API key, set base_url to https://api.unioapi.com/v1, and both Chat Completions and Responses are ready.