OpenAI-compatible · Anthropic native · Gemini native
API Reference
One key, three protocols, cross-translation included. This page is the English quickstart; the full Chinese reference lives on api.html. A machine-readable spec is available at openapi.json.
Quickstart
Create an API key in the console (shown once — save it). Every request uses Authorization: Bearer <key>.
from openai import OpenAI
client = OpenAI(
base_url="https://omniaxis.cc/v1",
api_key="OM_API_KEY",
)
resp = client.chat.completions.create(
model="<model id from the models page>",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
Anthropic and Google SDKs point at https://omniaxis.cc (no /v1 — the SDK appends the protocol path).
Endpoints
| Method | Path | Notes |
|---|---|---|
| POST | /v1/chat/completions | OpenAI Chat; stream: true for SSE. |
| POST | /v1/responses | OpenAI Responses (Codex-style, incl. server state on capable channels). |
| POST | /v1/messages | Anthropic Messages; /v1/messages/count_tokens for native counting (free). |
| POST | /v1beta/models/{model}:generateContent | Gemini; streaming via :streamGenerateContent?alt=sse. Also /v1beta/openai/* (Google's OpenAI-compat prefix). |
| POST | /v1/completions | Legacy completions compat layer: single prompt, no suffix/echo/logprobs. |
| POST | /v1/embeddings | OpenAI-compatible embeddings. |
| POST | /v1/images/generations | Image generation, billed per image, n 1-4. |
| GET | /v1/models, /v1/models/{model} | Scoped model catalog with context window and capabilities. |
Streaming semantics
- Cross-protocol combinations are translated incrementally (text, tool arguments, reasoning deltas) — not buffered-until-done.
- During long silences (e.g. extended thinking) the gateway emits SSE comment frames
: ping. Standard SDKs ignore them; skip colon-prefixed lines in hand-rolled parsers. - If the upstream dies mid-stream the gateway never fakes a terminal event — you get an in-stream error frame instead. Content already delivered is billed.
- If your client disconnects, the gateway keeps reading upstream to collect final usage and bills what was actually delivered.
Errors
Non-2xx responses carry { "error": { "message", "type" } }. Frequent types:
| Status | type | Meaning |
|---|---|---|
| 400 | invalid_request | Bad model id, JSON shape, or entry not available for this model. |
| 400 | protocol_not_supported | No channel in this group serves that protocol for the model — switch protocol entry. |
| 401 | invalid_authentication | Key invalid, disabled, or expired. |
| 402 | insufficient_quota | Balance exhausted — top up in the console. |
| 429 | rate_limited | User or upstream rate limit; Retry-After included. |
| 502/503 | upstream_error / no_available_channel | Upstream unavailable; failed requests are not billed. |
Bring your own key
In the console you can attach your own official OpenAI / Anthropic / Gemini API key. Requests then prefer your own upstream and are billed at a reduced service fee (default 5% of the platform price); if your key fails, the request falls back to platform channels at the normal price. Keys are validated against the official model list on attach and stored encrypted.