Getting Started
Prerequisites
Section titled “Prerequisites”- An OmnAPI account (sign up at omnapi.com).
- An API key — see Authentication.
curl, or any HTTP client of your choice.
Your first call
Section titled “Your first call”-
Set your key as an env var so it doesn’t end up in shell history.
Terminal window export OMNAPI_KEY="sk_live_..." -
Probe the gateway with a no-credit endpoint.
Terminal window curl https://api.omnapi.com/healthYou should see
{"status":"ok"}. -
Submit a real generation request. Below is a music compose call — see Quickstart for image and lyrics variants.
Terminal window curl -X POST https://api.omnapi.com/api/v1/producer/generate/music/compose \-H "x-api-key: $OMNAPI_KEY" \-H "Content-Type: application/json" \-d '{"prompt": "lofi jazz, rainy night, soft piano","duration": 30}'const res = await fetch("https://api.omnapi.com/api/v1/producer/generate/music/compose",{method: "POST",headers: {"x-api-key": process.env.OMNAPI_KEY!,"Content-Type": "application/json",},body: JSON.stringify({prompt: "lofi jazz, rainy night, soft piano",duration: 30,}),},);const job = await res.json();import os, requestsr = requests.post("https://api.omnapi.com/api/v1/producer/generate/music/compose",headers={"x-api-key": os.environ["OMNAPI_KEY"]},json={"prompt": "lofi jazz, rainy night, soft piano", "duration": 30},)job = r.json() -
Poll the job until terminal state. See Async Jobs for the full lifecycle.
- Try the Interactive API Reference — paste your key and click Send.
- Read Rate Limits so you don’t surprise yourself in production.