Cormak API documentation
The Cormak API starts AI video, image and 3D generations and returns the results. It uses JSON over HTTPS, API keys and asynchronous jobs. Keys are available on the Pro, Business and Elite plans; every generation spends Cormak credits at the published price.
API version 2026-11-22 · updated · OpenAPI 3.1
Create an API keyAuthentication
Send your key in the Authorization header: Authorization: Bearer ck_live_… (X-API-Key is also accepted). Keys are created in the API section of the Cormak app, shown once and stored by Cormak only as a SHA-256 hash. Keep keys on your server; never put them in a browser or mobile app. Revoke a key at any time in the dashboard.
Base URL and versioning
All endpoints live under https://api.cormak.app/v1. Responses include Cormak-Api-Version and X-Request-Id headers; quote X-Request-Id when contacting support.
Plans and access
The plan is checked on every request. If the subscription ends or the plan drops below Pro, keys return 403 plan_required until you upgrade again; jobs already started still finish and refunds still apply. GET /v1, /v1/models and POST /v1/quote are public and need no key.
Endpoints
| GET | /v1/models | Models, settings and prices (no key) |
|---|---|---|
| POST | /v1/quote | Price of a request in credits (no key) |
| POST | /v1/videos | Start a video generation |
| POST | /v1/images | Start an image generation |
| POST | /v1/3d | Create a Meshy 7.1 3D model |
| GET | /v1/jobs/{id} | Job status and result |
| GET | /v1/jobs | Recent jobs |
| GET | /v1/account | Plan, balances, key limits |
| GET | /v1/usage | Usage for 1–90 days |
| GET | /v1/webhooks | List webhooks |
Create a generation
Send a JSON body to the generation endpoint. The response is 202 with a job object; poll GET /v1/jobs/{id} or wait for a webhook. If you do not have enough credits, the request fails with 402 before anything is charged.
POST /v1/videos
| Field | Type | Description |
|---|---|---|
| model | string | One of the video model ids. Default veo-3.1-lite. |
| prompt | string, required | Up to 2,000 characters. Checked by the content policy. |
| duration_seconds | integer | Allowed values depend on the model (GET /v1/models). Default 8. |
| resolution | string | 480p, 720p, 1080p, 2k or 4k where the model supports it. Default 720p. |
| aspect_ratio | string | 16:9 (default), 9:16, 1:1, 4:3, 3:4 or 21:9 where supported. |
| audio | boolean | Generate audio where the model allows a choice. Default true. |
| image | object | Optional first frame: { mime_type: image/png|jpeg|webp, data: base64 } up to about 3 MB. |
| request_id | uuid | Optional idempotency key. You can send Idempotency-Key instead. |
POST /v1/images
| Field | Type | Description |
|---|---|---|
| model | string | nano-banana-2 (default), nano-banana-pro or seedream-5-pro. |
| prompt | string, required | Up to 2,000 characters. |
| quality | string | standard (default) or high (2K). |
| aspect_ratio | string | 1:1 (default), 16:9, 9:16, 4:3 or 3:4. |
| style | string | realistic (default), vector, gold, neon or logo. |
| reference_image | object | Optional reference: { mime_type, data } for edits and product shots. |
| request_id | uuid | Optional idempotency key. |
{
"id": "6f1c…", "request_id": "…", "object": "job", "kind": "video", "model": "veo-3.1-lite",
"status": "running", "credits": 0, "credits_quoted": 1, "currency": "video_credits",
"poll": "https://api.cormak.app/v1/jobs/6f1c…", "poll_after_seconds": 10
}3D models
POST /v1/3d
| Field | Type | Description |
|---|---|---|
| input_mode | string, required | prompt for text-to-3D or photo for one to four reference photos. |
| prompt | string | Required description of 10–600 characters in prompt mode. Optional texture note of 3–600 characters in photo mode. |
| images | array | Required in photo mode. Each entry is { mime_type, data }, with raw base64 PNG, JPEG or WebP. Up to 3,000,000 base64 characters per photo and 10,000,000 total. |
| quality | string | basic (default), medium or high. Maximum 25, 35 or 50 AI credits before account discounts. |
| expected_max_credits | integer | Optional maximum from the quote. A lower cap returns 409 quote_changed. |
| request_id | uuid | Optional idempotency key. You can send Idempotency-Key instead. |
When status is complete, output.url is a private GLB download (model/gltf-binary). The job may include progress and output.thumbnail_url. GET /v1/jobs/{id} renews the one-hour download link. The model also appears in your Cormak 3D Studio.
curl -X POST https://api.cormak.app/v1/3d \
-H "Authorization: Bearer $CORMAK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"input_mode":"prompt","prompt":"A single white ceramic mug with a round handle","quality":"basic","expected_max_credits":25}'Get a job
GET /v1/jobs/{id} returns status running, complete, failed or unknown. When complete, output.url is a private link valid for one hour; call again for a fresh link. credits shows what was charged; failed jobs show credits 0 and error.code. GET /v1/jobs lists recent jobs; GET /v1/account returns your plan and balances; GET /v1/usage returns daily request counts and credits spent.
{
"id": "6f1c…", "status": "complete", "credits": 1, "currency": "video_credits",
"output": { "url": "https://…/videos/…mp4?token=…", "mime_type": "video/mp4", "expires_in": 3600 },
"error": null, "created_at": "…", "finished_at": "…"
}Quote a price
POST /v1/quote returns { credits, currency } without starting a job. For video and images send kind and the generation fields. For 3D send { kind: "3d", quality: "basic" } to get the maximum price before account discounts. GET /v1/models returns every model with allowed settings and sample prices.
Models and prices
Video: veo-3.1-fast, veo-3.1, veo-3.1-lite, seedance-2.5, seedance-2.0, seedance-2.0-fast, kling-3.0-pro, kling-3.0-standard, kling-o1, wan-3.0, hailuo-3, flux-3-video, runway-gen-4.5, grok-imagine-1.5. Images: nano-banana-2, nano-banana-pro, seedream-5-pro. Video uses video credits. Images and 3D use AI credits. Seedance models reject photos of real people (error real_faces_unsupported, refunded).
Idempotency and retries
Send the same request_id (or Idempotency-Key) when you retry. The same id with the same body returns the existing job and never charges twice; the same id with a different body returns 409 idempotency_conflict. A status of unknown means the provider result could not be confirmed: check the job later instead of starting a new paid request.
Rate limits and quotas
Per key: 120 requests and 20 paid starts per minute, plus a daily limit of paid starts that you set in the dashboard (default 100, up to 5,000). Up to 10 active keys and 5 webhooks per account. 429 responses include Retry-After.
Errors
Errors are returned as { "error": { "code": "…", "message": "…" } }.
| HTTP | error.code | Meaning |
|---|---|---|
| 401 | missing_api_key / invalid_api_key | No key, malformed key or revoked key |
| 403 | plan_required | Plan is below Pro; error.upgrade_url points to billing |
| 403 | ai_consent_required | Accept the AI terms once in Cormak settings |
| 402 | insufficient_credits | error.required and error.available show the gap |
| 409 | idempotency_conflict / quote_changed | Reused request_id with other parameters, or prices changed |
| 422 | content_blocked | The prompt violates the content policy |
| 429 | rate_limit_reached / daily_job_limit_reached | Slow down or raise the key's daily limit |
| 400 | invalid_model / unsupported_video_options / … | Check the settings against GET /v1/models |
| 503 | service_unavailable / status_unavailable | Retry later with the same request_id |
Webhooks
Add an HTTPS endpoint in the API dashboard and choose job.completed and/or job.failed. Cormak sends a POST with a JSON body { id, type, created_at, data: { job } } and the headers Cormak-Event-Id, Cormak-Event-Type and Cormak-Signature: t=<unix>,v1=<hex>. v1 is HMAC-SHA256 of "<t>.<raw body>" with your webhook secret. Reject events older than five minutes. Redirects are not followed; non-2xx responses are retried after 1 min, 5 min, 30 min, 2 h and 6 h. The payload contains no media link — fetch GET /v1/jobs/{id} for a fresh URL.
import crypto from "node:crypto";
export function verifyCormak(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map(p => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ""));
}import hashlib, hmac, time
def verify_cormak(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
if abs(time.time() - int(parts["t"])) > 300:
return False
expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))Examples
curl -X POST https://api.cormak.app/v1/videos \
-H "Authorization: Bearer $CORMAK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model":"veo-3.1-lite","prompt":"A ceramic mug on a sunny kitchen table, slow push-in","duration_seconds":8,"resolution":"720p","aspect_ratio":"9:16"}'
# → 202 {"id":"…","object":"job","status":"running","credits_quoted":1,"currency":"video_credits",…}
curl https://api.cormak.app/v1/jobs/JOB_ID -H "Authorization: Bearer $CORMAK_API_KEY"import os, time, uuid, requests
API = "https://api.cormak.app/v1"
headers = {"Authorization": f"Bearer {os.environ['CORMAK_API_KEY']}"}
job = requests.post(f"{API}/images", headers=headers, json={
"request_id": str(uuid.uuid4()),
"model": "nano-banana-2",
"prompt": "Ceramic mug on a wooden table, soft morning light, product photo",
"aspect_ratio": "1:1",
}).json()
while job["status"] == "running":
time.sleep(3)
job = requests.get(f"{API}/jobs/{job['id']}", headers=headers).json()
print(job["status"], job.get("output", {}).get("url"))const API = "https://api.cormak.app/v1";
const headers = { Authorization: `Bearer ${process.env.CORMAK_API_KEY}`, "Content-Type": "application/json" };
const quote = await fetch(`${API}/quote`, { method: "POST", headers,
body: JSON.stringify({ kind: "video", model: "seedance-2.0-fast", prompt: "Product turntable", duration_seconds: 9, resolution: "480p" }) })
.then(r => r.json()); // { credits: 1, currency: "video_credits" }
let job = await fetch(`${API}/videos`, { method: "POST", headers, body: JSON.stringify({
request_id: crypto.randomUUID(), model: "seedance-2.0-fast", prompt: "Product turntable", duration_seconds: 9, resolution: "480p",
}) }).then(r => r.json());
while (job.status === "running") {
await new Promise(r => setTimeout(r, 10_000));
job = await fetch(`${API}/jobs/${job.id}`, { headers }).then(r => r.json());
}<?php
$api = "https://api.cormak.app/v1";
$headers = ["Authorization: Bearer " . getenv("CORMAK_API_KEY"), "Content-Type: application/json"];
$ch = curl_init("$api/videos");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => json_encode(["model" => "veo-3.1-lite", "prompt" => "A ceramic mug on a sunny kitchen table",
"duration_seconds" => 8, "resolution" => "720p"])]);
$job = json_decode(curl_exec($ch), true);
echo $job["id"], " ", $job["status"];