{"openapi":"3.1.0","info":{"title":"automatebusinessnow API","version":"v1","description":"One bearer token, every AI employee, 905+ media models. Same credit balance powers the web app, your scripts, and your AI agents.","contact":{"name":"automatebusinessnow","email":"hello@automatebusiness.com","url":"https://automatebusiness.com/docs"}},"servers":[{"url":"https://automatebusiness.com/api/v1","description":"Production"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"abn_*","description":"API key from /app/api-keys. Send as `Authorization: Bearer abn_...`."}},"schemas":{"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}},"ChatRequest":{"type":"object","required":["prompt"],"properties":{"employeeSlug":{"type":"string","default":"copywriter","description":"Which employee to run. Use `auto` to let the orchestrator pick."},"prompt":{"type":"string","minLength":1},"imageUrl":{"type":"string","format":"uri","nullable":true},"fileContext":{"type":"string","nullable":true}}},"ChatResponse":{"type":"object","required":["ok","employeeSlug","kind","creditsUsed","balance"],"properties":{"ok":{"const":true},"employeeSlug":{"type":"string"},"kind":{"type":"string","enum":["text","image","mixed"]},"message":{"type":"string","nullable":true},"imageUrl":{"type":"string","format":"uri","nullable":true},"provider":{"type":"string","nullable":true},"creditsUsed":{"type":"integer"},"balance":{"type":"integer"}}},"MediaResponse":{"type":"object","required":["ok","outputUrl","creditsUsed","balance"],"properties":{"ok":{"const":true},"outputUrl":{"type":"string","format":"uri"},"creditsUsed":{"type":"integer"},"balance":{"type":"integer"}}},"BalanceResponse":{"type":"object","required":["ok","balance"],"properties":{"ok":{"const":true},"balance":{"type":"integer"}}}}},"security":[{"BearerAuth":[]}],"paths":{"/status":{"get":{"summary":"Public health check","security":[],"responses":{"200":{"description":"Service is up","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"service":{"type":"string"},"version":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/chat":{"post":{"summary":"Run any text-employee job","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Job completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"401":{"description":"Missing / bad / revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/images":{"post":{"summary":"Generate an image","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string"},"aspect_ratio":{"type":"string","default":"1:1"},"quality":{"type":"string","enum":["low","medium","high"],"default":"medium"}}}}}},"responses":{"200":{"description":"Image generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/videos":{"post":{"summary":"Generate a video clip","responses":{"200":{"description":"Video generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/voice":{"post":{"summary":"Text-to-speech","responses":{"200":{"description":"Audio generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/voice/synthesize":{"post":{"summary":"Text-to-speech (streaming, voice-agent ready)","description":"Streams audio bytes back as the provider generates them — sub-second time-to-first-byte. Billed by character: 1 credit per 50 chars on `model: fast` (turbo, ~300ms TTFB), 1 credit per 25 chars on `model: quality` (multilingual, better prosody). Failed jobs auto-refund.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","maxLength":5000,"description":"Text to synthesize. Chunk into multiple calls if longer than 5000 chars."},"voice":{"type":"string","default":"warm-female","description":"Catalog key (warm-female, deep-male, energetic-female, british-male, young-female, podcast-host) or a 20-char raw provider voice id for power users with their own cloned voices."},"format":{"type":"string","enum":["mp3","pcm_16000"],"default":"mp3","description":"mp3 for general use; pcm_16000 (16kHz mono PCM) for voice-agent orchestrators piping directly to telephony."},"model":{"type":"string","enum":["fast","quality"],"default":"fast","description":"fast = sub-300ms time-to-first-byte (voice agents). quality = better prosody (produced narration)."}}}}}},"responses":{"200":{"description":"Streamed audio bytes. Headers: X-Credits-Used, X-Voice-Format, Content-Type matches `format`.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}},"audio/L16":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request (missing text, unknown voice, text too long)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / bad / revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Voice provider returned an error upstream (transient)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Voice synthesis not enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice/transcribe":{"post":{"summary":"Speech-to-text (audio → transcript + word timestamps)","description":"Accepts mp3, wav, m4a, ogg, or webm audio (up to 25 MB / 1 hour). Returns the transcript with word-level timestamps for voice-agent alignment + interruption detection. 1 credit per 2 seconds of audio. Failed jobs auto-refund.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["audio"],"properties":{"audio":{"type":"string","format":"binary","description":"Audio file (mp3, wav, m4a, ogg, webm; up to 25 MB)."},"language":{"type":"string","description":"BCP-47 language tag (en, es, fr, …). Auto-detected when omitted."},"diarize":{"type":"string","enum":["true","false"],"description":"Pass `true` to attach a `speaker` id to each word."}}}}}},"responses":{"200":{"description":"Transcript ready","content":{"application/json":{"schema":{"type":"object","required":["ok","text","words","durationSeconds","creditsUsed"],"properties":{"ok":{"const":true},"text":{"type":"string"},"words":{"type":"array","items":{"type":"object","properties":{"word":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"string","nullable":true}}}},"languageCode":{"type":"string","nullable":true},"durationSeconds":{"type":"number"},"creditsUsed":{"type":"integer"}}}}}},"400":{"description":"Bad request (missing audio, file too large, audio too long)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / bad / revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Voice provider returned an error upstream (transient)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Voice transcription not enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio":{"post":{"summary":"Text-to-music","responses":{"200":{"description":"Audio generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/upscale":{"post":{"summary":"Upscale an image to 2k or 4k","responses":{"200":{"description":"Image upscaled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/models/list":{"get":{"summary":"List every model with credit cost","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"credits":{"type":"integer"}}}}}}}}}}}},"/models/run":{"post":{"summary":"Run any catalog model by id","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"string"},"params":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Model ran","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}}}}},"/jobs/submit":{"post":{"summary":"Submit a model job asynchronously (Wavespeed-compatible — returns instantly with a job id, poll for result).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"string"}},"additionalProperties":true,"description":"Pass `modelId` plus the model's own params at the top level (flat). The legacy `{ modelId, params: {...} }` shape is also accepted."}}}},"responses":{"202":{"description":"Accepted. Poll the returned `pollUrl` until status is completed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"jobId":{"type":"string","example":"abn_job_..."},"modelId":{"type":"string"},"status":{"type":"string","enum":["submitted"]},"estimateCredits":{"type":"integer"},"pollUrl":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown modelId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{jobId}":{"get":{"summary":"Poll an async job for status + result.","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current job state. While running: { ok, status: 'running' }. On completion: { ok, status: 'completed', outputUrl, creditsUsed, balance }. On failure: { ok: false, status: 'failed', error, creditsUsed: 0 } (credits auto-refunded).","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"jobId":{"type":"string"},"modelId":{"type":"string"},"status":{"type":"string","enum":["submitted","running","completed","failed"]},"outputUrl":{"type":"string","format":"uri","nullable":true},"creditsUsed":{"type":"integer","nullable":true},"balance":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Job not found (or not owned by this key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits":{"get":{"summary":"Current credit balance","responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}}}}}}}