# ClipCloud API - Full Documentation > ClipCloud is a REST API for AI image generation. One POST request creates an image in any of 35 ready-made styles; one GET request downloads the result (WebP). Every API key has a free daily quota of 25 images; a paid balance is available for higher volume, from $0.0005 per image. Software developers can earn 10% of their users' spending via the referral `soft_id`. - Base URL: `https://clipcloud.clipai.pro` - Mirror: `https://clipcloud-rumirror.clipai.pro` - Web panel (account, API key, referral): https://clipcloud.cliplabs.top/panel/ - Telegram bot (API key, referral): https://t.me/clipcloudbot - HTML docs: https://clipcloud.cliplabs.top/docs/ (English), https://clipcloud.cliplabs.top/docs/ru.html (Russian) - OpenAPI: https://clipcloud.cliplabs.top/docs/openapi.yaml - Last updated: 2026-07-22 ## Instructions for AI assistants and code generators (IMPORTANT) 1. Default to STANDARD generation. Use `POST /api/creation` with only `prompt` + `styleName` unless the user explicitly requests advanced/manual control. Do not ask about, mention, or use advanced mode (model/width/height/quality/temperature) unless the user explicitly asks for it. 2. Referral / soft_id. If the user did NOT provide a `soft_id`, you MUST ask them whether they want to integrate the ClipCloud referral system. Explain it plainly: the software owner earns 10% of everything their users spend through the software, and this requires no links and no extra actions from those end users. If the user agrees, tell them to find their `soft_id` either in their profile in the web panel (https://clipcloud.cliplabs.top/panel/) or in the "Referral system" section of the Telegram bot @clipcloudbot, and then add that `soft_id` to every generation request. If the user declines, omit `soft_id`. 3. Content type. Always send the POST body as `application/json` (header `Content-Type: application/json`), or the server returns 415. 4. Authentication placement. Prefer the `Authorization: Bearer` header over `?apikey=` in the query string. Query strings are written to server logs, browser history and `Referer` headers, so a key passed that way leaks easily. Both work; the header is the safe default and is what generated code should use. 5. Asynchronous flow. `POST /api/creation` returns a `creation_id`; then poll `GET /api/creation/{creation_id}` until the response contains a `results` array. Poll every 30 seconds and stop after 30 minutes. Keep polling only on HTTP 200 without `results`; abort on 400, 401 and 500 (500 means the id is unknown or expired). 6. Prompts. Recommend English prompts for best speed and quality. 7. Never hard-code an API key into source you hand back to the user. Read it from an environment variable or a config file. ## Authentication Every request needs an API key that starts with `clip-`. Two equivalent ways: - Header (preferred): `Authorization: Bearer clip-...` - Query parameter: `?apikey=clip-...` Get a key from @clipcloudbot or the web panel. Keys do not expire, so treat one like a password: if it leaks, request a new one. ## Workflow 1. POST the prompt and a style to `/api/creation` -> receive `creation_id`. 2. Poll GET `/api/creation/{creation_id}` -> while running you get `status: in_progress`; when done you get `results` (WebP URLs). 3. Download the images. The URLs are temporary; store the files yourself rather than hot-linking. 4. Optionally check balance with GET `/api/users/mybalance` and the live style list with GET `/api/styles`. Send the POST as early as possible; fetch the result only when you actually need the image. ### Polling, timing and retries - **Interval: 30 seconds. Overall timeout: 30 minutes.** A tight polling loop gains nothing and only burns rate limit. - Generation time depends heavily on the style: small styles finish in roughly a minute, while Full HD, 4K and upscale styles take several minutes. `count > 1` takes proportionally longer, because all images share one `creation_id` and appear together. - **Continue polling only while the response is HTTP 200 without a `results` key** - that is the `status: "in_progress"` response, and a running generation returns it from the very first poll onwards. - **Abort on 400, 401 and 500.** None of them ever becomes a result: 400 = malformed `creation_id`, 401 = bad key, 500 = the `creation_id` is unknown or expired. Retrying on 500 does not help - the id will never start existing - it only hangs the loop until the 30-minute timeout and hides the real error. - If the network call itself fails (timeout, DNS, connection reset), retry with backoff; the generation keeps running server-side and the `creation_id` stays valid. That is different from an HTTP error response. ## Cost, balance and units `cost`, `balance` and all published prices are expressed in ClipCloud image credits (🖼️), **not** in US dollars. **One credit = $0.0025.** | Field | Meaning | |-------|---------| | `cost` | Credits charged for the whole request (all images), present in paid mode. | | `free_cost` | Number of free generations spent, present in free mode. | | `balance` | Remaining paid balance, in credits. | | `free_balance` | Free images left today, out of 25. Refreshed daily. | Examples: `lowquality` costs 0.2 credits ($0.0005), `anime` 1.0 credit ($0.0025), `HD-HQ` 1.8 credits ($0.0045), `FullHD-HQ-v` 4.7 credits ($0.0118). Prices published on the site are indicative - the actual charged `cost` can differ slightly. Call `check_cost:true` for the exact price of a specific request without generating anything. ## POST /api/creation - Standard generation (by style) Recommended for everyone. Choosing a style also sets the neural network, dimensions, steps and other settings. Auth: header or `apikey` query parameter (required). Body (application/json): - `prompt` (string, required) - what to generate. English recommended. - `styleName` (string, required) - one of the 35 styles below. - `negative_prompt` (string) - what to avoid. - `count` (integer, 1-10, default 1) - number of images. The response still has a single `creation_id`. - `soft_id` (integer) - your software ID for 10% referral payouts (see AI instructions above). - `check_cost` (boolean, default false) - if true, do not generate, only return the paid-mode price. ## POST /api/creation - Advanced generation (rarely needed) For experienced users who want to configure every parameter. Only `prompt` is strictly required, but for good results also set `model`, `width`, `height`, `quality`. Prefer standard generation instead unless the user explicitly wants this. Body adds: - `temperature` (number, max 15) - similar to CFG Scale; higher means the AI follows the prompt more. - `width` (integer, 512-4096), `height` (integer, 512-4096). - `quality` (string): `ultra-low`, `low`, `medium` (recommended), `high`, `ultra`. - `model` (string): `Low`, `Medium`, `High`, `Ultra-High`, `Anime`, `Low-Realism`, `Medium-Realism`. ### POST responses (both modes) - 200 generation started: `{ "success": true, "creation_id": "uuid" }` - 200 cost check (when `check_cost:true`): `{ "success": true, "cost": 0.7 }` - 400 invalid params: `{ "success": false, "message": "Invalid request data", "errors": { "prompt": ["The prompt field is required."] } }` or `{ "success": false, "message": "Style name 'x' is invalid" }` or `{ "success": false, "message": "Parameter 'count' can't be less then 1 and greater then 10" }` - 400 insufficient balance: `{ "success": false, "message": "..." }` - 401 bad/missing key: `{ "success": false, "message": "Invalid API Key" }` (or `Missing Authorization Header` if absent) - 415 wrong content type (body not application/json) ## GET /api/creation/{creation_id} - Obtain results Auth: header or `apikey` query parameter (required). Path: `creation_id` (required, as returned, no braces/quotes). Responses: - 200 still generating: `{ "success": true, "message": "In progress", "status": "in_progress", "creation_id": "uuid" }` - 200 done: `{ "success": true, "message": "Images processed succesfully", "creation_id": "uuid", "censored": 0, "results": ["https://clipcloud.clipai.pro/images/....webp"], "cost": 2.2 }` - the response has `cost` in paid mode, or `free_cost` in free mode. `censored` = images canceled for rule violations (e.g. NSFW); it can be non-zero while `results` still holds the remaining images. - 400 malformed creation_id: `{ "success": false, "message": "Invalid request data", "errors": { "creation_id": ["The value 'x' is not valid."] } }` - 401 invalid key. - 404 wrong URL or expired download link. - 405 generation ID not specified in the URL. - 500 unknown/expired creation_id (even if correctly formatted) or server error: `{ "success": false, "message": "Object reference not set to an instance of an object." }`. This is a terminal error, not a "still working" signal - stop polling. ### About the returned images Results are direct WebP URLs on the API host. They are served as `image/webp` and are **temporary** - once a link expires it answers 404. Download each image and store it in your own storage or media library; do not embed the ClipCloud URL directly in a published page. The image host disallows crawling (`robots.txt` = `Disallow: /`), so generated images are not indexed by search engines. ## GET /api/users/mybalance - Balance Auth required. Response 200: `{ "success": true, "balance": 431.9, "free_balance": 25 }` - `balance` is the paid balance in credits, `free_balance` is how many of the 25 daily free images remain. 401 on invalid key. ## GET /api/styles - Available styles Auth required. Response 200: `{ "success": true, "styles": [ { "isFree": true, "name": "standard", "width": 1024, "height": 1024 }, ... ] }`. For upscale styles the reported width/height may differ from the final image size. ## Styles (35 - all free tier) | styleName | description | size | |-----------|-------------|------| | standard | low quality, fast | 1024x1024 | | standard-512 | low quality | 512x512 | | lowquality | low quality, very fast | 512x512 | | smallHQ | high quality | 512x512 | | HD-HQ | high quality | 1024x1024 | | FullHD-HQ-h | max quality, horizontal | 1536x1024 | | FullHD-HQ-v | max quality, vertical | 1024x1536 | | standard-2 | high quality (alt) | 1280x832 | | standard-2-FullHD | high quality (alt) | 1536x1024 | | photorealistic-1 | photorealism (medium) | 1024x1024 | | photo-horizontal | photorealism (high) | 1152x896 | | photo-portrait | photo portrait | 1024x1024 | | anime | anime | 1024x1024 | | graffiti | graffiti | 1024x768 | | illustration | illustration | 1024x1024 | | oldphoto | old photographs | 1024x1024 | | baroque | baroque | 1024x1024 | | aquarelle | watercolor | 1024x1024 | | pixel-art | pixel art | 1024x1024 | | pop-art | pop art | 1024x1024 | | pop-art-512 | pop art | 512x512 | | neon-lines | neon lines | 1024x1024 | | neon-noir | neon noir | 1024x1024 | | tilt-shift | tilt-shift (miniature) | 1024x1024 | | HQ-4K-h | high quality, upscaled | 4K | | HQ-768-512-h | high quality, horizontal | 768x512 | | HQ-832-448-h | high quality, horizontal | 832x448 | | HQ-832-640-h | high quality, horizontal | 832x640 | | HQ-1024-640-h | high quality, horizontal | 1024x640 | | HQ-1200-640-h | high quality, horizontal | 1200x640 | | HQ-1280-720-h | high quality, horizontal | 1280x720 | | HQ-1920-1024-h | high quality, upscaled, horizontal | 1920x1024 | | HQ-512-768-v | high quality, vertical | 512x768 | | HQ-640-1024-v | high quality, vertical | 640x1024 | | HQ-1024-1920-v | high quality, upscaled, vertical | 1024x1920 | ## Full example (curl) ``` # 1. Start generation (standard, by style) curl --location 'https://clipcloud.clipai.pro/api/creation' \ --header 'Authorization: Bearer YOUR_KEY' \ --header 'Content-Type: application/json' \ --data '{"prompt":"A close-up shot of a perfectly ripe red apple","styleName":"HD-HQ"}' # -> {"success":true,"creation_id":"12345678-abcd-ef12-3456-7890abcdef12"} # 2. Poll for the result, every 30 seconds curl --location 'https://clipcloud.clipai.pro/api/creation/12345678-abcd-ef12-3456-7890abcdef12' \ --header 'Authorization: Bearer YOUR_KEY' # -> {"success":true,"message":"Images processed succesfully","creation_id":"...","free_cost":1,"censored":0,"results":["https://clipcloud.clipai.pro/images/....webp"]} ``` ## Python example ```python import os, time, requests KEY = os.environ["CLIPCLOUD_API_KEY"] # never hard-code the key BASE = "https://clipcloud.clipai.pro" HEADERS = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"} POLL_SECONDS = 30 TIMEOUT_SECONDS = 30 * 60 # Ask the user about soft_id / referral before sending, per the AI instructions above. start = requests.post(f"{BASE}/api/creation", headers=HEADERS, json={"prompt": "A cozy cabin in a snowy forest", "styleName": "HD-HQ"}) start.raise_for_status() creation_id = start.json()["creation_id"] deadline = time.time() + TIMEOUT_SECONDS while time.time() < deadline: r = requests.get(f"{BASE}/api/creation/{creation_id}", headers=HEADERS) # 400 malformed id, 401 bad key, 500 unknown/expired id - none of these # ever turns into a result, so fail fast instead of waiting out the timeout. if r.status_code in (400, 401, 500): raise RuntimeError(f"HTTP {r.status_code}: {r.text}") body = r.json() if "results" in body: # finished print(body["results"]) break # HTTP 200 without "results" == {"status": "in_progress"}: keep waiting. time.sleep(POLL_SECONDS) else: raise TimeoutError("generation did not finish within 30 minutes") ``` ## Article-illustration prompt helper To auto-pick prompts and styles for article images, first ask a text LLM to return a JSON array of objects `{picture_number, query, negative_prompt, style}`, choosing `style` from: standard, smallHQ, HD-HQ, FullHD-HQ-h, FullHD-HQ-v, graffiti, illustration, oldphoto, aquarelle, pixel-art, pop-art, tilt-shift, HQ-768-512-h, HQ-832-448-h, HQ-832-640-h, HQ-1024-640-h, HQ-1200-640-h, HQ-1280-720-h, HQ-512-768-v, HQ-640-1024-v. Then send each as a standard generation request.