Images & Video API
OpenAI-compatible image generation and Grok Imagine video routes, model ids, and published flat prices.
Authenticate with Authorization: Bearer $SCALEMAX_API_KEY. Match the billing surface: credit keys use https://api.scalemax.pro/v1; token keys use https://api.scalemax.pro/token/v1. Image models appear in GET /v1/models with family: "image". Video models use family: "video" when listed.
Image model ids and prices
Flat per-image pricing by quality tier (same rates as ScaleMax Image 2). Token keys debit the derived token units at the published $2.50 = 1M rate.
| Model id | Low | Medium | High |
|---|---|---|---|
grok-imagine-image | $0.006 | $0.053 | $0.211 |
grok-imagine-image-quality | $0.006 | $0.053 | $0.211 |
Also published: qwen-image-*, wan2.7-image*, flux-2-*, gpt-image-* — see the live catalog or GET /v1/models. | |||
POST /v1/images/generations
OpenAI-compatible image generation. Returns a synchronous JSON body with image URLs or base64 data.
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | One of the published image model ids. |
prompt | string | yes | Text prompt. |
n | integer | no | Batch size up to the model limit (Grok Imagine: 4). |
size | string | no | Pixel size or aspect ratio (Grok Imagine accepts 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, auto). |
quality | string | no | low | medium | high (selects the flat tier). |
curl -X POST "https://api.scalemax.pro/v1/images/generations" \
-H "Authorization: Bearer $SCALEMAX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-image","prompt":"A red circle on white","size":"1:1","quality":"medium","n":1}'POST /v1/images/edits
Edit an existing image. Grok Imagine models accept a reference image URL or upload (model-dependent).
Video model ids and prices
Flat per-job charge at the published $2.50 = 1M token rate. Duration 1–15 seconds; resolutions 480p, 720p, 1080p.
| Model id | Credit price | Token units | Notes |
|---|---|---|---|
grok-imagine-video | $0.25 | 100,000 | Text-to-video and image-to-video. |
grok-imagine-video-1.5 | $0.375 | 150,000 | Image-to-video only — an input image is required. |
Video routes
Native video generation is async: create returns 202 with a task id, poll until status is terminal, then download from the ScaleMax url field (never a third-party host). Completed jobs include usage with total_tokens and frontend_cost_microusd.
POST /v1/videos/generations
Start text-to-video or image-to-video generation.
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | grok-imagine-video or grok-imagine-video-1.5. |
prompt | string | yes | Scene description. |
image | string | object | conditional | Required for grok-imagine-video-1.5 (I2V only). URL or uploaded reference. |
aspect_ratio | string | no | 1:1, 16:9, 9:16, 4:3, or 3:4. |
resolution | string | no | 480p, 720p, or 1080p. |
duration | integer | no | 1–15; default 6. duration_seconds is accepted as an alias. |
POST /v1/videos/edits
Edit an existing video clip with a new prompt.
POST /v1/videos/extensions
Extend a completed clip.
GET /v1/videos/:id
Poll task status and progress. Optional ?wait=0..20 long-poll seconds.
GET /v1/videos/:id/content
Stream the finished mp4. Supports Range after the task completes.
curl -X POST "https://api.scalemax.pro/v1/videos/generations" \
-H "Authorization: Bearer $SCALEMAX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-video","prompt":"Ocean waves at sunset","aspect_ratio":"16:9","duration":6}'Key scope
- Credit keys: any general-purpose scope may call image and video models.
- Token keys: Claude, OpenAI, combined, Gemini, GLM, Local, and Qwen packs may call the general image catalogue and all published video models.
- Grok token packs may call
grok-imagine-image*andgrok-imagine-video*only — not Azure or Qwen image models.