Your product.
Our creative engine.
A REST API for your backend, pipeline, or application. Submit a job, follow its lifecycle, and retrieve the finished media—with the same models and credit accounting as the studio.
{
"job": {
"id": "job_example",
"status": "completed",
"assetIds": [
"asset_example"
]
}
}From prompt to production asset
Use a server-side personal key. Check the model catalog for readiness before submitting. Generation requests spend account credits.
# Keep this key in your server environment, never client-side code.
export SOULMODALITY_API_KEY="fc_your_key"
curl --fail-with-body "https://your-soulmodality-host/api/v1/models"
curl --fail-with-body -X POST "https://your-soulmodality-host/api/v1/jobs" \
-H "Authorization: Bearer $SOULMODALITY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: your-stable-request-id" \
-d '{"capability":"image","modelId":"canvas-fast","prompt":"A foggy harbor at dawn","parameters":{"aspectRatio":"16:9","numImages":1},"referenceAssetIds":[]}'
# Save the returned job.id, then poll.
curl --fail-with-body "https://your-soulmodality-host/api/v1/jobs/JOB_ID" \
-H "Authorization: Bearer $SOULMODALITY_API_KEY"const base = 'https://your-soulmodality-host/api/v1';
const key = process.env.SOULMODALITY_API_KEY;
if (!key) throw new Error('Set SOULMODALITY_API_KEY');
const headers = { Authorization: `Bearer ${key}`, 'Content-Type': 'application/json' };
async function request(path: string, init: RequestInit = {}) {
const r = await fetch(base + path, { ...init, headers: { ...headers, ...init.headers }, signal: AbortSignal.timeout(20_000) });
const data = await r.json();
if (!r.ok) throw new Error(data.error?.message ?? `HTTP ${r.status}`);
return data;
}
const idempotencyKey = crypto.randomUUID(); // Persist for request retries.
let { job } = await request('/jobs', { method:'POST', headers:{ 'Idempotency-Key':idempotencyKey }, body:JSON.stringify({ capability:'image', modelId:'canvas-fast', prompt:'A foggy harbor at dawn', parameters:{ aspectRatio:'16:9' }, referenceAssetIds:[] }) });
for (let attempt=0; attempt<120; attempt++) {
if (['completed','failed','cancelled'].includes(job.status)) break;
await new Promise(resolve => setTimeout(resolve, 2000));
({ job } = await request('/jobs/' + job.id));
}
if (job.status !== 'completed') throw new Error(job.error ?? 'Not completed; resume polling later with job.id');
const { items } = await request('/assets');
console.log(items.filter((asset:any) => job.assetIds.includes(asset.id)));import os, time, uuid, requests
base = 'https://your-soulmodality-host/api/v1'
session = requests.Session()
session.headers['Authorization'] = 'Bearer ' + os.environ['SOULMODALITY_API_KEY']
def request(method, path, **kwargs):
r = session.request(method, base + path, timeout=20, **kwargs)
r.raise_for_status()
return r.json()
key = str(uuid.uuid4()) # Save and reuse on request retries.
job = request('POST', '/jobs', headers={'Idempotency-Key': key}, json={
'capability': 'image', 'modelId': 'canvas-fast',
'prompt': 'A foggy harbor at dawn',
'parameters': {'aspectRatio': '16:9'}, 'referenceAssetIds': []
})['job']
for attempt in range(120):
if job['status'] in ('completed', 'failed', 'cancelled'): break
time.sleep(2)
job = request('GET', '/jobs/' + job['id'])['job']
if job['status'] != 'completed':
raise RuntimeError(job.get('error') or 'Not completed; resume polling with job ID')
assets = request('GET', '/assets')['items']
print([a for a in assets if a['id'] in job['assetIds']])Request console
GET ONLY · NO CREDIT SPENDInspect actual responses from this deployment. Private reads use your session unless you supply a personal key. Responses stay in this page.
Endpoint reference
27 OPERATIONSGeneration
PATCH/api/v1/jobs/{id}Move or publish a generation
An owned projectId makes all outputs private and moves them to that project. Null publishes to Community. Ownership is required.
JSON request schema
{
"type": "object",
"properties": {
"projectId": {
"type": [
"string",
"null"
],
"minLength": 1,
"maxLength": 100
}
},
"required": [
"projectId"
],
"additionalProperties": false
}DELETE/api/v1/jobs/{id}Delete a terminal generation
Delete a completed, failed or cancelled generation and its outputs from your library and Community. Credit accounting is retained.
POST/api/v1/jobsCreate a job
Reserve credits and enqueue a generation. Use the same Idempotency-Key and request body on retries. Provider errors and terminal failures are reconciled by the worker.
JSON request schema
{
"type": "object",
"properties": {
"capability": {
"type": "string",
"enum": [
"image",
"edit",
"upscale",
"video",
"audio",
"lipsync"
]
},
"modelId": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"prompt": {
"type": "string",
"maxLength": 4000,
"default": ""
},
"parameters": {
"type": "object",
"additionalProperties": true
},
"projectId": {
"type": [
"string",
"null"
],
"minLength": 1,
"maxLength": 100,
"description": "Owned project for private outputs. Omit or null for public Community generations when using an API key."
},
"referenceAssetIds": {
"type": "array",
"maxItems": 8,
"items": {
"type": "string",
"maxLength": 100
}
}
},
"required": [
"capability",
"modelId"
],
"additionalProperties": false
}Illustrative response
{
"job": {
"id": "job_example",
"capability": "image",
"modelId": "canvas-fast",
"status": "queued",
"assetIds": [],
"cost": 1
}
}GET/api/v1/jobsList jobs
Newest first. Query: capability, limit (1–60), before (ISO timestamp). nextCursor is null at the end.
GET/api/v1/jobs/{id}Read a job
Poll every 2 seconds until completed, failed or cancelled. Completed jobs contain assetIds.
POST/api/v1/jobs/{id}/cancelRequest cancellation
Requests cancellation of a queued or active job. An active provider run may finish before cancellation is confirmed.
GET/api/v1/eventsStream job updates
Authenticated SSE snapshots every 2 seconds; connections close after 5 minutes. Reconnect with backoff. This is REST job streaming, separate from MCP transport.
Catalog
GET/api/v1/modelsList models
Public catalog with provider readiness, capabilities and base credit costs. Use the returned IDs; availability depends on configured providers.
Illustrative response
{
"items": []
}GET/api/v1/presetsList presets
Available image looks and video camera moves.
Account
GET/api/v1/accountRead your account
Private user profile and current credit balance.
Assets
GET/api/v1/assetsList your assets
Private library. Returned signed URLs expire after 15 minutes; fetch again to refresh.
POST/api/v1/assetsUpload a reference
Multipart form field file. Up to 20 MB; PNG, JPEG, WebP, MP4, WebM, MP3, WAV. File signatures are verified.
POST/api/v1/assets-importImport from HTTPS
Import media you own from an allowed public HTTPS URL. Private-network destinations and unsupported formats are rejected.
JSON request schema
{
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"maxLength": 2000
}
},
"required": [
"url"
],
"additionalProperties": false
}GET/api/v1/assets/{id}/contentDownload an asset
Owned media only. Returns the file with its media content type.
DELETE/api/v1/assets/{id}Delete an asset
Permanently delete an owned asset and its stored media.
Collections
GET/api/v1/collectionsList collections
Up to 100 of your collections, including asset IDs.
POST/api/v1/collectionsCreate a collection
Create a named collection.
JSON request schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
}
},
"required": [
"name"
],
"additionalProperties": false
}GET/api/v1/collections/{id}Read a collection
Read one collection you own.
PATCH/api/v1/collections/{id}Rename a collection
Update its display name.
JSON request schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
}
},
"required": [
"name"
],
"additionalProperties": false
}DELETE/api/v1/collections/{id}Delete a collection
Remove the collection. Assets remain in your library.
POST/api/v1/collections/{id}/assetsAdd an asset
Add an asset you own.
JSON request schema
{
"type": "object",
"properties": {
"assetId": {
"type": "string"
}
},
"required": [
"assetId"
],
"additionalProperties": false
}DELETE/api/v1/collections/{id}/assets/{assetId}Remove an asset
Remove membership without deleting the underlying file.
Assistants
POST/api/v1/prompt/enhanceEnhance a prompt
Rewrite a prompt for an image, video, audio or agent task.
JSON request schema
{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 4000
},
"tool": {
"type": "string",
"enum": [
"image",
"video",
"audio",
"agent"
]
}
},
"required": [
"prompt",
"tool"
],
"additionalProperties": false
}POST/api/v1/agent/planPlan an outcome
Returns a plan for review. Planning does not enqueue its generation steps.
JSON request schema
{
"type": "object",
"properties": {
"goal": {
"type": "string",
"minLength": 3,
"maxLength": 4000
},
"skill": {
"type": "string",
"maxLength": 60
},
"attachments": {
"type": "array",
"maxItems": 6,
"items": {
"type": "object",
"properties": {
"assetId": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"image",
"video",
"audio"
]
}
},
"required": [
"assetId",
"kind"
],
"additionalProperties": false
}
}
},
"required": [
"goal"
],
"additionalProperties": false
}API keys
GET/api/v1/api-keysList personal keys
Session only. Returns names and prefixes, never stored secrets.
POST/api/v1/api-keysCreate a personal key
Session only. The raw key is revealed once. Save it securely.
JSON request schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
}
},
"required": [
"name"
],
"additionalProperties": false
}DELETE/api/v1/api-keys/{id}Revoke a personal key
Session only. Revoked credentials stop working immediately.
Build for asynchronous work
Retries & idempotency
Authenticated requests share a 60-request per minute account limit. On 429, respect Retry-After. Retry transient failures with exponential backoff and jitter. For job creation, persist and reuse the same Idempotency-Key and body; use a new key for a new job.
Jobs & delivery
Statuses: queued → submitting → running → completed, failed, or cancelled. Poll every 2 seconds or use /events for 5-minute SSE snapshots. Reconnect after disconnect. Webhook subscriptions are not available; provider callbacks are internal.
Predictable errors
{ "error": { "code": "UNAUTHORIZED", "message": "Sign in or provide an API key." } }| HTTP | Code | Action |
|---|---|---|
| 400 | INVALID_INPUT / INVALID_MODEL / INVALID_PARAMETER / INVALID_REFERENCE | Correct the request using the model catalog. |
| 401 | UNAUTHORIZED | Supply a valid personal bearer key or sign in. |
| 402 | INSUFFICIENT_CREDITS | Add account credits before creating another job. |
| 403 | FORBIDDEN | Check origin and use a signed-in session for key management. |
| 404 | NOT_FOUND | Check resource ID and ownership. |
| 409 | IDEMPOTENCY_CONFLICT | Retry with the original body or use a new key for a new request. |
| 413 | TOO_LARGE | Reduce the request or media size. |
| 429 | RATE_LIMIT | Wait for Retry-After, then retry with exponential backoff. |
| 503 | UNAVAILABLE / PROVIDER_NOT_CONFIGURED | Check deployment services or choose a configured model. |
Personal keys
Keys can use your account credits and access your library. Store them on your server, give each integration its own key, and revoke keys you no longer need.
Loading your keys…