Developer documentation

CMM Tools API

From your first request to a complete integration. Everything you need to generate videos and images from your application.

REST API · v1Server-side integrationsShared studio credits

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/v1
API contract: CMM Tools uses its own REST API and model IDs. Both video and image submission return a job with HTTP 202. Image submission does not return an immediate image array. This is not a drop-in OpenAI SDK endpoint.

Your first generation

  1. Create an API key and save it as CMM_API_KEY in your server environment.
  2. Call GET /models and select an enabled video model.
  3. Use its supported duration, resolution and aspect ratio in your request.
  4. Generate and save a unique request ID. Reuse it with the identical payload if submission times out.
  5. Save the returned job ID, poll every 5–10 seconds, then download the completed file.
Discover available models
export CMM_API_KEY='YOUR_CUSTOMER_API_KEY'
curl --fail-with-body 'https://cmmtools.site/v1/models' \
  -H "Authorization: Bearer $CMM_API_KEY"
Submit once; keep REQUEST_ID for retries
# 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"}'
Check status and download
# 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.mp4
These cURL examples use a Bash-compatible shell. The sample model ID and settings are placeholders. For a complete submit → poll → download example, see the Python and Node.js examples.

Authentication & 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 header
Authorization: Bearer cmm_live_YOUR_KEY_SECRET
RuleBehavior
Key expiryThe dashboard offers 30, 90 or 365 days.
Active keysUp to 10 unexpired, unrevoked keys per account.
AccessEach key can use the issuing account’s enabled models, balance and API-visible jobs, including jobs created in the studio.
RevocationRevoke from the dashboard to block subsequent API requests. Accepted jobs continue processing.
Key managementCreating and revoking keys requires a signed-in website session. A customer API key cannot manage keys or access Admin.
Key permissionsThis version has no key-specific model scopes or spending caps.
Keep secrets on your server. Store keys in environment variables or a secret manager. Do not put them in browser JavaScript, mobile bundles, public repositories, screenshots or URLs. API endpoints do not grant cross-origin browser access. Use HTTPS. If a key is exposed, revoke it and create a replacement.

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.

MethodPathPurposeSuccess
GET/modelsEnabled video and image models200
GET/balanceShared account balance200
GET/usageAPI usage grouped by key200
POST/quotesPrice a request without reserving credits200
POST/videosQueue a video job202; replay may return 200
GET/videos?limit=25List recent account video jobs200
GET/videos/{id}Read an owned video job200
GET/videos/{id}/contentDownload video output200 / 206 / redirect
POST/images/generationsQueue an image job202; replay may return 200
GET/images/generations?limit=25List recent account image jobs200
GET/images/generations/{id}Read an owned image job200
GET/images/generations/{id}/contentDownload image output200 / 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.

List models
curl --fail-with-body 'https://cmmtools.site/v1/models' \
  -H "Authorization: Bearer $CMM_API_KEY"
Illustrative response envelope
{
  "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.

Quote a video
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"}'
Illustrative quote response
{
  "object": "quote",
  "model": "MODEL_ID",
  "credits": 105,
  "is_estimate": false,
  "unit": "credits"
}
The amount above is illustrative. A quote does not reserve credits or guarantee future availability. The accepted job’s 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.

Video request body
{
  "model": "MODEL_ID",
  "prompt": "A slow camera move over a mountain lake at sunrise",
  "duration": 5,
  "resolution": "720p",
  "aspectRatio": "16:9"
}
Illustrative accepted response
{
  "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.

Submit an image
# 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.

Image references are supported only where the model’s capabilities permit them. Send them as multipart 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.

FieldTypeUse
modelString · requiredExact ID from GET /models.
promptString · required to create a jobDescription of the output. The generation pipeline enforces its prompt limits.
durationPositive numberVideo seconds; use a supported duration.
resolutionStringSupported video resolution.
aspectRatioStringSupported output ratio, such as 16:9 or 1:1.
generateAudioBooleanRequest generated audio where supported. Multipart values: true, false, 1, 0.
generationModeStringModel-specific generation mode, where supported.
qualityStringModel-supported image quality.
imageSizeStringModel-supported image size.
images / videos / audiosMultipart filesSupported reference inputs. JSON file objects and URLs are rejected.
referenceOrderArray / JSON array stringOrdered reference metadata where the model requires it. Follow its capabilities and studio conventions.
videoRoles / audioRolesArray / JSON array stringModel-specific reference roles; use the supported roles.
reuseGenerationIdStringReuse an accessible prior generation as a reference, only where supported by the studio pipeline.
reuseImageIdsArray / JSON array stringReuse accessible prior images, where supported. IDs must belong to your account.

Supported aliases

AliasCanonical field
secondsduration
aspect_ratio or ratioaspectRatio
reference_orderreferenceOrder
video_rolesvideoRoles
audio_rolesaudioRoles

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 fieldAccepted formatsMaximum per file
imagesJPEG, PNG, WebP10 MiB
videosMP4, WebM, MOV25 MiB
audiosMP3, WAV15 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.

Upload an image reference
# 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.

The API follows the same supported reference transport as the studio. A provider’s advertised capabilities do not automatically enable inputs that CMM Tools currently disables.

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.

StatusMeaning
queuedAccepted and waiting for processing.
submittingThe worker is submitting the request.
submittedAn upstream task has been accepted.
processingGeneration is in progress.
completedGeneration finished; check content_url.
failedGeneration failed; inspect error and refunded_at.
submit_errorSubmission 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.

List recent jobs
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.

Authenticated download
curl --fail-with-body -L \
  'https://cmmtools.site/v1/videos/RETURNED_JOB_ID/content' \
  -H "Authorization: Bearer $CMM_API_KEY" \
  -o video.mp4

The 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.

Save completed outputs to storage you control. Job history and output availability can change if the job is deleted through the studio. Treat temporary storage URLs as private and temporary.

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.

Read shared balance
curl --fail-with-body 'https://cmmtools.site/v1/balance' \
  -H "Authorization: Bearer $CMM_API_KEY"

# Example response:
# {"object":"balance","credits":895,"unit":"credits"}
Read API usage
curl --fail-with-body 'https://cmmtools.site/v1/usage' \
  -H "Authorization: Bearer $CMM_API_KEY"
Illustrative usage response
{
  "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.

SituationResult
Same key + identical normalized requestReturns the same job without another debit. A replay detected before submission returns HTTP 200 and Idempotency-Replayed: true.
Concurrent identical submissionsCan both return 202, but refer to one job and one credit debit.
Same key + different requestHTTP 409. Do not change settings while retrying an existing request.
Same key after the job was deletedHTTP 410. The request mapping stays as a tombstone.
Failed or refunded jobThe key still maps to the original job. A deliberate new attempt needs a new key and can incur another charge.
Transaction rolled backNo 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.

After a timeout or 5xx: repeat the identical generation request with the same saved idempotency key. Never automatically switch to a fresh request ID: the first request may already have been accepted and charged.

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.

Illustrative error response
{
  "error": {
    "message": "A valid CMM Tools API key is required in Authorization: Bearer.",
    "type": "authentication_error"
  }
}
HTTPMeaningWhat to do
400Invalid requestCheck field names, model settings, payload format and required idempotency key.
401Invalid, expired or revoked keyCheck the bearer header or create a replacement key. API authentication responses include WWW-Authenticate.
403Account/model access or management restrictionCheck account access and model availability. Manage keys from a signed-in dashboard session.
404Unknown endpoint or jobCheck the path and job ID. Only the owning account can read a job.
402Insufficient shared creditsAdd credits through the existing studio payment flow before starting a new job.
409Request conflict, output pending, or active key limitRead the message: use the unchanged payload for retries, wait for output, or revoke an unused key.
410Deleted idempotent jobThe saved key cannot recreate that job. Use a fresh request ID only for a deliberate new paid attempt.
413Request/upload too largeReduce files or JSON size. JSON requests are limited to 256 KiB; see upload limits above.
429Rate or concurrency limitWait, reduce polling, and allow active jobs to finish.
5xxTemporary server/service issueRetry 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.

Python · requests
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")

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.