Antimatter

Docs

Voice, video and music

Realtime voice over one socket, and video, music and 3D as jobs.

Realtime voiceGET/v1/realtime

A WebSocket that speaks OpenAI's Realtime protocol, so OpenAI's own clients connect unchanged with a new URL and an Antimatter key. Connect to wss://useantimatter.com/v1/realtime?model= one of openai/gpt-realtime-2.1, openai/gpt-realtime-2.1-mini, openai/gpt-realtime-2, openai/gpt-realtime-1.5, openai/gpt-realtime, openai/gpt-realtime-mini (the bare OpenAI id works too). The key goes in Authorization: Bearer from a server, or from a browser in the subprotocol list as ["realtime", "openai-insecure-api-key.am_live_..."], the form OpenAI's browser example uses. The key is never echoed back. Anyone using a page can read a key in that browser, so give such a key only the realtime API and a budget you can afford to lose. It takes the chat scope and has its own wire, realtime, in a key's policy. It is for funded accounts only, and the free allowance does not cover it.

Every check runs before the socket opens, and a refusal is a JSON answer with the usual error types (a browser sees only a failed handshake, and a server client reads the body): the key, the wire, the model lists, the holders' window, the monthly cap, at most 3 sessions open at once per account (realtime_session_limit) and 20 opens a minute per key.

Money is held per response. A session has a budget: budget_micros in the URL, or antimatter.budget_micros beside the session in the first session.update, $20.00 when you name none, $100.00 at most, and never more than the balance. The gateway forces max_output_tokens to at most 4096 on the session and on every response.create, and before it sends any input that could start a response (server turn detection starts them by itself) it holds that response's worst case: every token the conversation could hold, up to the model's context, at the highest input rate, plus the output ceiling at the highest output rate, with the margin. Each response.done is charged what its usage reports at OpenAI's published price plus the margin, never more than its hold, and writes one usage row with its own request id, under rt_ and the session's id as its session. Add antimatter_events=1 to the URL to receive an antimatter.response.cost event after each one.

When what is left of the budget or the balance cannot cover the next response, the gateway sends an error event (realtime_budget_exhausted or insufficient_credits), lets a response already held finish, and closes with 1008. It closes a session itself after 30 minutes, or sooner where the platform would, with realtime_session_expired. A response whose usage never arrives, because the client hung up or the provider dropped, is charged its hold. With your own OpenAI key stored, the session runs on it and nothing is held or charged here. Refused inside a session, with an error event and nothing sent: another model, input transcription (OpenAI bills it by a separate model this relay does not meter), tools other than functions, stored prompts and tracing.

import WebSocket from "ws";

const ws = new WebSocket("wss://useantimatter.com/v1/realtime?model=openai/gpt-realtime-mini&budget_micros=2000000", {
  headers: { Authorization: `Bearer ${process.env.ANTIMATTER_API_KEY}` },
});
ws.on("open", () => {
  ws.send(JSON.stringify({ type: "session.update", session: { type: "realtime", output_modalities: ["text"] } }));
  ws.send(JSON.stringify({ type: "response.create" }));
});
ws.on("message", (m) => console.log(JSON.parse(m.toString()).type));

Video, music and 3DPOST/v1/videos

When they are on, video, music and sound, and 3D are made as jobs that run for minutes. They are not served here now, and every endpoint below returns 404. POST /v1/videos, POST /v1/sounds and POST /v1/meshes take model, prompt and the options the model's price depends on (seconds, resolution or OpenAI's size, aspect_ratio, audio, lyrics for a model that sings, image_url for a model that starts from a picture), and return a job at once: queued, then in_progress, then completed, failed or cancelled. The shape is OpenAI's video object (OpenAI retired its own Videos API on 2026-09-24), so client.videos.create and client.videos.retrieve in the official SDKs work against /v1/videos.

Video jobs can start from a picture: a model listed with a -image id (Veo, Kling, Wan, Hailuo, Seedance and LTX among them) takes image_url as its first frame, either an https URL or a data:image/png, jpeg or webp base64 URL of at most 5 MiB, and animates it from the prompt. A model that makes from words alone refuses a picture with a 400. Nova Studio, the editor at /studio, makes its clips through these same jobs on the signed in account.

Read a job with GET /v1/videos/{id} (likewise /v1/sounds/{id} and /v1/meshes/{id}), list them with GET /v1/videos (after, limit, order), fetch the file with GET /v1/videos/{id}/content (and /v1/sounds/{id}/content, /v1/meshes/{id}/content), stop one with POST /v1/videos/{id}/cancel (/v1/sounds/{id}/cancel, /v1/meshes/{id}/cancel), and remove a finished one's record with DELETE. The file is streamed from the provider, and you can fetch it for as long as the provider keeps it (60 minutes at fal and Replicate and for MiniMax's Hailuo models, a day at DashScope, seven days for MiniMax's H3 series), until its expires_at, and after that the content endpoint returns 410 output_expired. If Nova Studio copied it into its own store, where stored media is on, it keeps serving from there with byte ranges.

A model can be offered by more than one provider: fal or Replicate, and its lab bought direct (MiniMax for the H3 series and Hailuo, Alibaba Cloud Model Studio for Wan). Each job goes to the cheapest provider for exactly the options sent and is held at that provider's price. If that provider cannot be reached or answers a server error when the job is sent, the next one is tried, held again at its own price (which may be higher), and the job says so in failover. A refusal is never passed on, and once a provider has taken a job it stays there until it ends. A listing names each model once, at the price its defaults are served at. Jobs at Alibaba and MiniMax's Hailuo models cannot be stopped once sent. A cancel returns 409 not_cancellable, and the job runs to its end and is billed as made.

A job is paid from a balance, never from the free allowance. When it is made, its worst case (the price of exactly the options sent, with the 10% margin) is held for as long as it runs, named in hold_micros and x-antimatter-hold-micros. When it completes it is billed the provider's price for what it made, never more than the hold, in cost_micros. A job that fails, or that you cancel before it is made, costs nothing. One the provider finishes anyway is billed as made. A video that runs past 60 minutes (a sound 20, a mesh 30) is stopped. One the provider never answers for 60 minutes more is billed its hold, because the provider may have billed it. Keys are held to the video, audio and 3d wires of their policy, its model lists and its per request ceiling.

curl https://useantimatter.com/v1/videos \
  -H "Authorization: Bearer $ANTIMATTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "google/veo-3.1", "prompt": "a lighthouse at night", "seconds": "4", "size": "1280x720", "audio": false}'

curl https://useantimatter.com/v1/videos/video_... -H "Authorization: Bearer $ANTIMATTER_API_KEY"
curl -o clip.mp4 https://useantimatter.com/v1/videos/video_.../content -H "Authorization: Bearer $ANTIMATTER_API_KEY"
modelEndpointMost one job costs
google/veo-3.1/v1/videos$5.28
google/veo-3/v1/videos$3.52
google/veo-3-fast/v1/videos$1.32
google/veo-3.1-fast/v1/videos$1.32
kwaivgi/kling-v2.5-turbo-pro/v1/videos$0.77
bytedance/seedance-1-pro/v1/videos$1.98
bytedance/seedance-1-lite/v1/videos$0.95
alibaba/wan-2.5/v1/videos$1.65
minimax/hailuo-02-standard/v1/videos$0.62
lightricks/ltx-2-pro/v1/videos$2.64
stability-ai/stable-audio-2.5/v1/sounds$0.22
minimax/music-2/v1/sounds$0.03
minimax/music-1.5/v1/sounds$0.03
elevenlabs/music/v1/sounds$2.74
elevenlabs/sound-effects-v2/v1/sounds$0.05
tencent/hunyuan3d-v3/v1/meshes$0.41
tencent/hunyuan3d-2/v1/meshes$0.18
microsoft/trellis/v1/meshes$0.02
google/veo-3.1-image/v1/videos$5.28
google/veo-3.1-fast-image/v1/videos$3.08
kwaivgi/kling-v2.5-turbo-pro-image/v1/videos$0.77
alibaba/wan-2.5-image/v1/videos$1.65
minimax/hailuo-02-standard-image/v1/videos$0.49
google/veo-3-image/v1/videos$3.52
google/veo-3-fast-image/v1/videos$1.32
bytedance/seedance-1-pro-image/v1/videos$1.98
bytedance/seedance-1-lite-image/v1/videos$0.95
lightricks/ltx-2-pro-image/v1/videos$2.64
minimax/h3/v1/videos$2.32
minimax/h3-image/v1/videos$2.15
minimax/h3-highspeed/v1/videos$1.12
minimax/h3-highspeed-image/v1/videos$0.99
minimax/h3-lite/v1/videos$0.75
minimax/h3-lite-image/v1/videos$0.66
minimax/hailuo-2.3/v1/videos$0.62
minimax/hailuo-2.3-image/v1/videos$0.62
minimax/hailuo-2.3-fast-image/v1/videos$0.36
alibaba/wan-2.6/v1/videos$2.48
alibaba/wan-2.6-image/v1/videos$2.48
alibaba/wan-2.6-flash-image/v1/videos$1.24
minimax/image-01/v1/stills$0.00
black-forest-labs/flux-schnell/v1/stills$0.00
google/nano-banana-2.1/v1/stills$0.12
google/nano-banana-pro/v1/stills$0.33
google/nano-banana-pro-edit/v1/stills$0.33
kwaivgi/kling-o1-image/v1/stills$0.03
runwayml/gen4-image/v1/stills$0.09
vidu/vidu-q4-reference/v1/videos$4.80
kwaivgi/kling-o3-pro-reference/v1/videos$2.31
kwaivgi/kling-o3-pro-reference-image/v1/videos$2.31
kwaivgi/kling-4.0-image/v1/videos$7.75
minimax/h3-max/v1/videos$1.89
minimax/h3-max-image/v1/videos$1.32