Local API

Vynex Studio Local API

Run Vynex Studio as a local HTTP server and trigger AI image & video generation programmatically — from scripts, automations, or your own apps. The server binds to 127.0.0.1 only and is protected by a token that refreshes every app launch.

Getting started

Open Vynex Studio → Settings → Local API Server and turn on “Run local API server”. The card shows your API URL and API Token. Keep the app running while you make requests.

  1. Enable the server in Settings.
  2. Copy the API URL (e.g. http://127.0.0.1:4747) and API Token.
  3. Send requests with the token in the Authorization header.
The default port is 4747. If it’s already in use, Vynex Studio automatically binds to the next free port — always copy the live URL from Settings.
The token is regenerated on every launch and never leaves your machine. Re-copy it after restarting the app. The server is reachable only from the same computer (127.0.0.1).

Authentication

Every endpoint except /api/health requires the token. Provide it in any one of:

# 1. Bearer header (recommended)
Authorization: Bearer <your-token>

# 2. Custom header
X-API-Token: <your-token>

# 3. Query string
http://127.0.0.1:4747/api/status?token=<your-token>

Requests without a valid token return 401 Unauthorized.

Endpoints

GET /api/health Liveness check — no token required.
{ "ok": true, "name": "Vynex Studio", "running": false }
GET /api/status Current run state, stats & per-profile workers.
{
  "running": true,
  "stats": { "generated": 12, "failed": 1, "skipped": 3, "total": 20 },
  "workers": [ { "name": "acct@gmail.com", "status": "Generating", "progress": "63%" } ]
}
GET /api/profiles All profiles (name, active, device).
{ "profiles": [ { "name": "acct@gmail.com", "active": true, "hasDevice": true } ] }
GET /api/credits Last-known Flow credits per profile.
{ "credits": { "acct@gmail.com": { "credits": 1000, "updatedAt": "2026-06-21T11:00:00Z" } } }
POST /api/stop Stops the active run.
{ "ok": true }
POST /api/generate Starts a generation run.

Request body (JSON):

FieldTypeDescription
prompts req*string[]One clip/image per prompt. (*or text)
textstringAlternative to prompts — multi-line / numbered text is parsed into prompts.
enginestringgemini, flow, or flow-video. Defaults to the engine selected in the app.
outputDirstringAbsolute folder to save into. Defaults to the app’s output folder.
fileNamingstringnumber (1.jpg, 2.jpg…) or words. Defaults to the app setting.
overwritebooleanRegenerate files that already exist. Default false (skip existing).

Response:

{ "ok": true, "engine": "flow", "total": 3, "toGenerate": 3, "outputDir": "D:\\images" }

If a run is already in progress it returns 400 with { "ok": false, "error": "busy" }. Other engine/model options (resolution, aspect, Veo model, duration) use the values selected in the app’s Advanced settings.

Examples

cURL
JavaScript
Python
# Start a Flow image run
curl -X POST http://127.0.0.1:4747/api/generate \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"engine":"flow","prompts":["a red fox in snow","a city at night"]}'

# Check status
curl http://127.0.0.1:4747/api/status -H "Authorization: Bearer <token>"

# Stop
curl -X POST http://127.0.0.1:4747/api/stop -H "Authorization: Bearer <token>"
const BASE = 'http://127.0.0.1:4747', TOKEN = '<token>';

const res = await fetch(`${BASE}/api/generate`, {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    engine: 'flow-video',
    prompts: ['a white fox spirit transforms into a woman'],
    overwrite: false
  })
});
console.log(await res.json());
import requests

BASE = 'http://127.0.0.1:4747'
TOKEN = '<token>'
h = {'Authorization': f'Bearer {TOKEN}'}

r = requests.post(f'{BASE}/api/generate', headers=h, json={
    'engine': 'gemini',
    'prompts': ['a serene mountain lake at dawn'],
    'outputDir': r'D:\images\batch1',
})
print(r.json())
Let's Talk

Ready to Build
Your YouTube System?

Book a free 30-minute strategy call. We'll review your goals and match you with the right services.

Book a Free Strategy Call Email Us Directly

We reply within 4 hours  ·  No spam, ever