CMM Tools API
From your first request to a complete integration. Everything you need to generate videos and images from your application.
Build with the CMM Tools API
Create videos and images from your own application using the same account, enabled models and credit balance as the creation studio. Generation runs asynchronously: submit a request, save its job ID, check its status, and download the finished file.
Base URLhttps://cmmtools.site/v1202. Image submission does not return an immediate image array. This is not a drop-in OpenAI SDK endpoint.Your first generation
- Create an API key and save it as
CMM_API_KEYin your server environment. - Call
GET /modelsand select an enabledvideomodel. - Use its supported duration, resolution and aspect ratio in your request.
- Generate and save a unique request ID. Reuse it with the identical payload if submission times out.
- Save the returned job ID, poll every 5–10 seconds, then download the completed file.
export CMM_API_KEY='YOUR_CUSTOMER_API_KEY'
curl --fail-with-body 'https://cmmtools.site/v1/models' \
-H "Authorization: Bearer $CMM_API_KEY"# Generate ONCE per intended generation. Save this value before submission.
REQUEST_ID=$(uuidgen)
# Replace the model and settings with values from GET /models.
curl --fail-with-body 'https://cmmtools.site/v1/videos' \
-H "Authorization: Bearer $CMM_API_KEY" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $REQUEST_ID" \
-d '{"model":"MODEL_ID","prompt":"A mountain sunrise","duration":5,"aspectRatio":"16:9","resolution":"720p"}'# Replace JOB_ID with the id returned by submission.
JOB_ID='RETURNED_JOB_ID'
curl --fail-with-body "https://cmmtools.site/v1/videos/$JOB_ID" \
-H "Authorization: Bearer $CMM_API_KEY"
# Run after status is completed and content_url is available.
curl --fail-with-body -L "https://cmmtools.site/v1/videos/$JOB_ID/content" \
-H "Authorization: Bearer $CMM_API_KEY" -o video.mp4Authentication & API keys
Sign in to the API key dashboard with your existing studio account. Give the key a name, select its expiry, and copy it immediately. The secret is shown once; the server stores a SHA-256 hash and a display prefix.
Authorization: Bearer cmm_live_YOUR_KEY_SECRET| Rule | Behavior |
|---|---|
| Key expiry | The dashboard offers 30, 90 or 365 days. |
| Active keys | Up to 10 unexpired, unrevoked keys per account. |
| Access | Each key can use the issuing account’s enabled models, balance and API-visible jobs, including jobs created in the studio. |
| Revocation | Revoke from the dashboard to block subsequent API requests. Accepted jobs continue processing. |
| Key management | Creating and revoking keys requires a signed-in website session. A customer API key cannot manage keys or access Admin. |
| Key permissions | This version has no key-specific model scopes or spending caps. |
Endpoint reference
All paths below are relative to https://cmmtools.site/v1 and require a bearer key. Send JSON with Content-Type: application/json, or use multipart form data for reference files.
| Method | Path | Purpose | Success |
|---|---|---|---|
| GET | /models | Enabled video and image models | 200 |
| GET | /balance | Shared account balance | 200 |
| GET | /usage | API usage grouped by key | 200 |
| POST | /quotes | Price a request without reserving credits | 200 |
| POST | /videos | Queue a video job | 202; replay may return 200 |
| GET | /videos?limit=25 | List recent account video jobs | 200 |
| GET | /videos/{id} | Read an owned video job | 200 |
| GET | /videos/{id}/content | Download video output | 200 / 206 / redirect |
| POST | /images/generations | Queue an image job | 202; replay may return 200 |
| GET | /images/generations?limit=25 | List recent account image jobs | 200 |
| GET | /images/generations/{id} | Read an owned image job | 200 |
| GET | /images/generations/{id}/content | Download image output | 200 / redirect |
Discover models & capabilities
GET /models returns the video and image models available to your account. Use the exact returned id; display labels are not request IDs. A model’s settings and reference capabilities vary, so do not assume every model supports the same duration, resolution, ratio, audio or file inputs.
curl --fail-with-body 'https://cmmtools.site/v1/models' \
-H "Authorization: Bearer $CMM_API_KEY"{
"object": "list",
"data": [
{
"id": "MODEL_ID",
"object": "model",
"media_type": "video",
"label": "Model display name"
}
]
}The example above only shows the envelope and common identity fields. Actual entries also include the settings, capabilities and available pricing exposed by the studio catalog. Read those entries before constructing requests. Model access, availability and pricing are controlled by the account and Admin configuration; a model can become unavailable.
Get a credit quote
POST /quotes estimates the customer credit cost. Include mediaType: "video" or "image" and the applicable generation settings. If omitted, mediaType defaults to video. This endpoint takes JSON, not file uploads.
curl --fail-with-body 'https://cmmtools.site/v1/quotes' \
-H "Authorization: Bearer $CMM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"mediaType":"video","model":"MODEL_ID","duration":5,"resolution":"720p","aspectRatio":"16:9"}'{
"object": "quote",
"model": "MODEL_ID",
"credits": 105,
"is_estimate": false,
"unit": "credits"
}credits_cost is the amount reserved. Reference-dependent costs may differ: JSON quote requests cannot include uploaded files, so check the job cost when using references.Create a video
POST /videos accepts JSON for text-to-video, or multipart form data for supported reference inputs. Idempotency-Key is required. Choose model settings from GET /models.
{
"model": "MODEL_ID",
"prompt": "A slow camera move over a mountain lake at sunrise",
"duration": 5,
"resolution": "720p",
"aspectRatio": "16:9"
}{
"id": "11111111-1111-4111-8111-111111111111",
"object": "video",
"model": "MODEL_ID",
"status": "queued",
"prompt": "A slow camera move over a mountain lake at sunrise",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"credits_cost": 105,
"refunded_at": null,
"error": null,
"created_at": "2026-11-03T12:00:00.000Z",
"completed_at": null,
"status_url": "/v1/videos/11111111-1111-4111-8111-111111111111",
"content_url": null
}Store the id and status_url before polling. A 202 response means accepted into the queue; it does not mean the generation is complete. Prices, timings and model identifiers in examples are illustrative.
Create an image
POST /images/generations is asynchronous too. Send model, prompt and a supported aspectRatio. Include quality or imageSize only when the selected model supports them.
# Save this ID and reuse it for retries of this same image request.
IMAGE_REQUEST_ID=$(uuidgen)
curl --fail-with-body 'https://cmmtools.site/v1/images/generations' \
-H "Authorization: Bearer $CMM_API_KEY" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $IMAGE_REQUEST_ID" \
-d '{"model":"IMAGE_MODEL_ID","prompt":"A quiet seaside cottage","aspectRatio":"1:1"}'The response has object: "image.generation", an id, status, credit cost, status URL and content URL. Unlike video jobs, it does not include video duration or resolution fields. Poll /images/generations/{id} and download /images/generations/{id}/content after completion.
images files. Video and audio references are rejected for image generation. Model-specific image editing that is disabled in the studio stays disabled in the API.Generation parameters
Unknown fields are rejected with HTTP 400. The following are accepted public input names; acceptance of a field name does not imply support by every model. Select values and combinations from that model’s catalog entry.
| Field | Type | Use |
|---|---|---|
model | String · required | Exact ID from GET /models. |
prompt | String · required to create a job | Description of the output. The generation pipeline enforces its prompt limits. |
duration | Positive number | Video seconds; use a supported duration. |
resolution | String | Supported video resolution. |
aspectRatio | String | Supported output ratio, such as 16:9 or 1:1. |
generateAudio | Boolean | Request generated audio where supported. Multipart values: true, false, 1, 0. |
generationMode | String | Model-specific generation mode, where supported. |
quality | String | Model-supported image quality. |
imageSize | String | Model-supported image size. |
images / videos / audios | Multipart files | Supported reference inputs. JSON file objects and URLs are rejected. |
referenceOrder | Array / JSON array string | Ordered reference metadata where the model requires it. Follow its capabilities and studio conventions. |
videoRoles / audioRoles | Array / JSON array string | Model-specific reference roles; use the supported roles. |
reuseGenerationId | String | Reuse an accessible prior generation as a reference, only where supported by the studio pipeline. |
reuseImageIds | Array / JSON array string | Reuse accessible prior images, where supported. IDs must belong to your account. |
Supported aliases
| Alias | Canonical field |
|---|---|
seconds | duration |
aspect_ratio or ratio | aspectRatio |
reference_order | referenceOrder |
video_roles | videoRoles |
audio_roles | audioRoles |
Do not send conflicting canonical and alias values. Use mediaType only on /quotes; generation endpoints determine the output type from their path. Customers cannot override prices, credits, internal provider metadata or job identifiers.
Reference files & uploads
Use multipart/form-data when supplying reference files. Let your HTTP client set the multipart boundary. Keep authentication and the saved idempotency key in headers. Check the selected model’s capabilities before sending each reference type.
| File field | Accepted formats | Maximum per file |
|---|---|---|
images | JPEG, PNG, WebP | 10 MiB |
videos | MP4, WebM, MOV | 25 MiB |
audios | MP3, WAV | 15 MiB |
The shared parser allows at most 24 files and 100 MiB combined. Individual models may impose lower counts, durations or sizes. File fields with [] suffixes are accepted too. JSON reference URLs and client-supplied file objects are not accepted.
# Choose a model that supports image references.
REFERENCE_REQUEST_ID=$(uuidgen)
curl --fail-with-body 'https://cmmtools.site/v1/videos' \
-H "Authorization: Bearer $CMM_API_KEY" \
-H "Idempotency-Key: $REFERENCE_REQUEST_ID" \
-F 'model=MODEL_WITH_IMAGE_SUPPORT' \
-F 'prompt=Animate the subject with a gentle camera movement' \
-F 'duration=5' \
-F 'aspectRatio=16:9' \
-F 'images=@reference.png;type=image/png'For models requiring reference order or roles, send referenceOrder, videoRoles and audioRoles as JSON arrays in form fields. Preserve the file bytes, filenames, MIME types, order and settings on retries so the request hash stays identical. The studio pipeline may trim reference videos to a model’s supported duration.
Job status & history
Read the saved status_url with your bearer key every 5–10 seconds. Jobs are private to their owning account. A different account cannot retrieve the job or its content.
| Status | Meaning |
|---|---|
queued | Accepted and waiting for processing. |
submitting | The worker is submitting the request. |
submitted | An upstream task has been accepted. |
processing | Generation is in progress. |
completed | Generation finished; check content_url. |
failed | Generation failed; inspect error and refunded_at. |
submit_error | Submission failed; inspect the error and refund state before deciding on a deliberate new attempt. |
A job can move through only some intermediate states. No completion-time guarantee is implied. The response exposes created_at, completed_at, credits_cost, error and refunded_at. API jobs also appear in the studio library.
curl --fail-with-body 'https://cmmtools.site/v1/videos?limit=25' \
-H "Authorization: Bearer $CMM_API_KEY"
curl --fail-with-body 'https://cmmtools.site/v1/images/generations?limit=25' \
-H "Authorization: Bearer $CMM_API_KEY"Lists return {"object":"list","data":[...]} and include studio jobs as well as API jobs. The default limit is 25; the API clamps a numeric limit to 1–100. Cursor pagination, webhooks and cancellation are not implemented by these endpoints.
Download generated files
Once content_url is available, request it with the same bearer authentication. URLs in job responses are relative to https://cmmtools.site, not to an additional /v1 prefix.
curl --fail-with-body -L \
'https://cmmtools.site/v1/videos/RETURNED_JOB_ID/content' \
-H "Authorization: Bearer $CMM_API_KEY" \
-o video.mp4The content endpoint can stream the output or redirect to a temporary storage URL. Enable normal redirect following in your HTTP client; do not manually forward your API key to a different storage host. Use the returned Content-Type when choosing an image filename. Outputs that are not ready return HTTP 409; an unavailable or deleted job returns 404.
Balance, usage & billing
Website and API generation share the same account credits, prices, model permissions and plan concurrency. Credits are reserved when the job is created, not when a quote is requested. Failed jobs use the existing studio refund process.
curl --fail-with-body 'https://cmmtools.site/v1/balance' \
-H "Authorization: Bearer $CMM_API_KEY"
# Example response:
# {"object":"balance","credits":895,"unit":"credits"}curl --fail-with-body 'https://cmmtools.site/v1/usage' \
-H "Authorization: Bearer $CMM_API_KEY"{
"object": "list",
"data": [{
"key_id": "KEY_ID",
"generations": 2,
"reserved_credits": 210,
"refunded_credits": 105,
"net_credits": 105
}]
}Usage groups API-created jobs by the key that originally created them. It excludes studio-created jobs and jobs deleted from the library. The account credit ledger remains the financial record. refunded_at records a processed refund; a failed status alone should not be treated as proof of a refund.
Safe retries & idempotency
Every generation submission requires an Idempotency-Key: 8–128 printable, non-space ASCII characters. Generate one per intended job and save it before submitting.
| Situation | Result |
|---|---|
| Same key + identical normalized request | Returns the same job without another debit. A replay detected before submission returns HTTP 200 and Idempotency-Replayed: true. |
| Concurrent identical submissions | Can both return 202, but refer to one job and one credit debit. |
| Same key + different request | HTTP 409. Do not change settings while retrying an existing request. |
| Same key after the job was deleted | HTTP 410. The request mapping stays as a tombstone. |
| Failed or refunded job | The key still maps to the original job. A deliberate new attempt needs a new key and can incur another charge. |
| Transaction rolled back | No accepted request mapping remains; retry with the same saved key. |
The namespace is shared across all API keys on the account and both image/video endpoints. The request hash includes the output type, normalized settings and ordered reference metadata and bytes. Retries can retrieve the existing job even if your remaining balance or model availability has changed; the calling key must still be valid.
Rate limits & concurrency
Each API key allows 120 authenticated requests per fixed UTC minute. This includes polling and reads, not just generation submissions. The counter is stored in the database and survives server restarts.
A rate-limited response returns HTTP 429 and Retry-After: 60. Wait before retrying and avoid synchronized polling bursts. Existing plan concurrency limits also apply across studio and API jobs; those can return 429 even when a key’s per-minute budget is not exhausted.
Poll every 5–10 seconds and back off on temporary failures. Respect key expiry, the ten-active-key limit, file limits and model-specific input limits. No key-specific budget caps are enforced in this version.
Errors & troubleshooting
Errors from the API handler use this shape. Media-download failures can also use the existing media service’s error format, so always check HTTP status before parsing or saving a response.
{
"error": {
"message": "A valid CMM Tools API key is required in Authorization: Bearer.",
"type": "authentication_error"
}
}| HTTP | Meaning | What to do |
|---|---|---|
| 400 | Invalid request | Check field names, model settings, payload format and required idempotency key. |
| 401 | Invalid, expired or revoked key | Check the bearer header or create a replacement key. API authentication responses include WWW-Authenticate. |
| 403 | Account/model access or management restriction | Check account access and model availability. Manage keys from a signed-in dashboard session. |
| 404 | Unknown endpoint or job | Check the path and job ID. Only the owning account can read a job. |
| 402 | Insufficient shared credits | Add credits through the existing studio payment flow before starting a new job. |
| 409 | Request conflict, output pending, or active key limit | Read the message: use the unchanged payload for retries, wait for output, or revoke an unused key. |
| 410 | Deleted idempotent job | The saved key cannot recreate that job. Use a fresh request ID only for a deliberate new paid attempt. |
| 413 | Request/upload too large | Reduce files or JSON size. JSON requests are limited to 256 KiB; see upload limits above. |
| 429 | Rate or concurrency limit | Wait, reduce polling, and allow active jobs to finish. |
| 5xx | Temporary server/service issue | Retry status reads with backoff. Retry generation with the identical payload and original idempotency key. |
Error types
authentication_error, insufficient_credits, rate_limit_error, server_error and invalid_request_error. Use HTTP status and the message together; there is no additional machine-readable error-code field in this version.
Before contacting support
Keep the job ID, request ID, time and HTTP status. Share a redacted request and response through the studio’s support link. Never share your bearer key or private reference files in a public issue.
Python & Node.js examples
These server-side examples create one video, poll for completion and save the result. Set CMM_API_KEY and CMM_MODEL_ID in your environment. They deliberately surface errors rather than automatically create another paid job. Add durable job/request storage and controlled backoff for production.
import os, time, uuid
import requests # pip install requests
BASE = "https://cmmtools.site/v1"
MODEL = os.environ["CMM_MODEL_ID"] # video model from GET /models
headers = {"Authorization": "Bearer " + os.environ["CMM_API_KEY"]}
# Persist this ID before submission. On an ambiguous POST failure,
# retry the same payload with THIS ID; do not rerun uuid4().
request_id = str(uuid.uuid4())
print("Save request ID:", request_id, flush=True)
payload = {"model": MODEL, "prompt": "A mountain sunrise",
"duration": 5, "aspectRatio": "16:9"}
# Adjust settings to the selected model. Add resolution if required.
response = requests.post(BASE + "/videos", headers={**headers,
"Idempotency-Key": request_id}, json=payload, timeout=60)
response.raise_for_status()
job = response.json()
print("Save job ID:", job["id"], flush=True)
# This example stops after 30 minutes; the saved job may still finish.
deadline = time.monotonic() + 30 * 60
while job["status"] not in ("completed", "failed", "submit_error"):
if time.monotonic() > deadline:
raise TimeoutError("Resume polling saved job " + job["id"])
time.sleep(10)
response = requests.get(BASE + "/videos/" + job["id"],
headers=headers, timeout=30)
response.raise_for_status()
job = response.json()
if job["status"] in ("failed", "submit_error"):
raise RuntimeError(job.get("error") or "Generation failed")
with requests.get(BASE + "/videos/" + job["id"] + "/content",
headers=headers, stream=True, timeout=120) as output:
output.raise_for_status()
with open("video.mp4", "wb") as file:
for chunk in output.iter_content(1024 * 1024):
file.write(chunk)
print("Saved video.mp4")import { randomUUID } from 'node:crypto';
import { writeFile } from 'node:fs/promises';
const base = 'https://cmmtools.site/v1';
const headers = { Authorization: `Bearer ${process.env.CMM_API_KEY}` };
const payload = {
model: process.env.CMM_MODEL_ID, // video model from GET /models
prompt: 'A mountain sunrise', duration: 5, aspectRatio: '16:9'
}; // Adjust settings to the model. Add resolution if required.
// Persist this ID before submitting. Reuse it with the identical payload
// after an ambiguous POST failure. Do not generate another ID for a retry.
const requestId = randomUUID();
console.log('Save request ID:', requestId);
async function json(url, options = {}) {
const response = await fetch(url, {
...options, signal: AbortSignal.timeout(60000)
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
return response.json();
}
let job = await json(`${base}/videos`, {
method: 'POST', headers: { ...headers,
'Content-Type': 'application/json', 'Idempotency-Key': requestId },
body: JSON.stringify(payload)
});
console.log('Save job ID:', job.id);
const deadline = Date.now() + 30 * 60 * 1000;
while (!['completed', 'failed', 'submit_error'].includes(job.status)) {
if (Date.now() > deadline) throw new Error(`Resume polling saved job ${job.id}`);
await new Promise(resolve => setTimeout(resolve, 10000));
job = await json(`${base}/videos/${job.id}`, { headers });
}
if (['failed', 'submit_error'].includes(job.status)) throw new Error(job.error || 'Generation failed');
const output = await fetch(`${base}/videos/${job.id}/content`, {
headers, signal: AbortSignal.timeout(120000)
});
if (!output.ok) throw new Error(`Download failed: ${output.status}`);
await writeFile('video.mp4', Buffer.from(await output.arrayBuffer()));
console.log('Saved video.mp4');Production checklist
- Store keys server-side and rotate them by creating a replacement before revoking the old key.
- Discover enabled models and validate settings; do not hardcode model display labels or permanent prices.
- Save the intended request payload and idempotency key before submitting; save the returned job ID immediately.
- On uncertain submission results, retry that identical request with its original request ID.
- Use bounded polling, timeouts and backoff. Respect HTTP 429 and plan concurrency.
- Check response status before saving output; handle streamed and redirected downloads.
- Monitor balance, job errors and processed refunds. Keep downloaded outputs in your own storage.
- Keep API secrets and private content out of logs. Include job/request IDs in redacted support reports.