Call Midjourney, Veo, Kling, Seedance, Suno, ElevenLabs and 30+ other models through a single REST endpoint. Same account, same credits, same prices as the app — no separate contract.
Submit a job, poll until it completes, use the file. Three calls, any language.
# 1. Submit a job
curl -X POST https://ai-genbackend-production.up.railway.app/api/generations \
-H "X-API-Key: nx_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a red fox in fresh snow, golden hour, 85mm", "model": "nano-banana-2", "aspectRatio": "16:9"}'
# → { "generationId": "3f1c…" }
# 2. Poll until status is "completed"
curl https://ai-genbackend-production.up.railway.app/api/generations/3f1c… -H "X-API-Key: nx_live_YOUR_KEY"
# → { "status": "completed", "mediaUrl": "https://cdn…/….png", "cost": 60, … }Base URL
https://ai-genbackend-production.up.railway.app/apiSend the key as the X-API-Key header (or as a Bearer token). Keys are created in Settings → API and shown once.
The same pipeline the app uses — your code just skips the UI.
01
Settings → API → New key. Available on every paid plan and for team members; name it per service so you can revoke keys independently.
02
Send the prompt, pick a model by its slug, add model-specific options. The response is a job id — credits are charged once, when the job is accepted.
03
Poll the job until its status is completed — mediaUrl points to the file on our CDN. Failed jobs are refunded automatically.
Everything the app can do, with the same guarantees behind it.
Switching from FLUX to Midjourney or from Kling to Veo is a change to one field. New models land in the API the day they land in the app.
API calls draw on the same credits as the app and the Telegram bot. No separate wallet, no minimum commitment.
Credits, not seats. A generation costs the same whether it comes from a browser or a cron job, and failed jobs are refunded.
Four content types behind one endpoint — the model slug decides the output, the response shape is the same.
Most models are backed by more than one upstream. When a provider stalls, the job is retried elsewhere — you see a result, not an outage.
Members of a Business team create their own keys that spend from the team pool. Revoke a person, keep the pipeline.
Save a card and set a line: when the balance drops below it, we add credits automatically — no job dies mid-batch.
Spend per day, per model and per API key, plus the full request log — in the dashboard or via /usage.
Pick a number of credits; we email you the moment your balance crosses it.
The public surface. Billing, key management and account settings are session-only by design — a leaked key cannot touch them.
| Method | Endpoint | Description |
|---|---|---|
| POST | /generations | Create a generation. Returns . |
| GET | /generations/:id | Job status, cost and mediaUrl once completed. |
| GET | /generations | video |
| DELETE | /generations/:id | Cancel a queued or processing job (credits refunded) or delete a finished one. |
| GET | /auth/me | Your profile, plan and current credit balance. |
| GET | /generations/:id/stream | Server-Sent Events progress stream. Pass the key as ?token= — EventSource cannot set headers. |
| GET | /usage/summary?days=30 | Credits spent per day, model, source and API key over the last N days. |
| GET | /usage/requests | Paged request log; filter with ?source=api, ?keyId=, ?status=. |
| Field | Type | Description |
|---|---|---|
| prompt | string | Text prompt, 1–10 000 characters. Required. |
| model | string | Model slug, e.g. nano-banana-2, flux-pro, midjourney-v7, seedance, suno-v5, elevenlabs-tts. Required. |
| aspectRatio | string | Image / video aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:2, 21:9 … |
| referenceImages | string[] | Image URLs for image-to-image and reference modes. |
| videoDuration | string | Video length in seconds as a string ("5", "10"); allowed values depend on the model. |
| videoResolution | string | 480p, 720p or 1080p — model-dependent. |
| voice | string | Voice preset for text-to-speech models. |
| musicDuration | string | Clip length preset for music models. |
Job lifecycle
queued → processing → completed
There is no separate API price list. A generation costs the same credits whether it comes from the app or from your code, and both draw from one balance.
Basic
$15/mo
8000 credits / month
2 parallel jobs
Pro
$39/mo
20.000 credits / month
6 parallel jobs
Max
$99/mo
60.000 credits / month
8 parallel jobs
Business
$50/mo
per seat
30.000 credits / month
16 parallel jobs
The Free trial does not include API access — it is image-only and time-boxed, which makes it the one tier a script could farm. Top-up packs stack on any plan and never expire.