MOSS Image API documentation
Everything you need to call MOSS Image from your code. Base URL https://cheapergen.com/api/v1. Try it first in the playground.
Using a coding agent?
Paste this into Claude Code, Cursor, Codex or any coding agent. It adds the API to your project, keeps the key in CHEAPERGEN_API_KEY and tests with a free quote before anything is spent.
Add MOSS Image (CheaperGen endpoint openmoss/ moss-image/ text-to-image) to this project by following https:/ / cheapergen.com/ agents/ integrate.mdAuthentication
Create a key in Dashboard → API keys and send it as a bearer token. Keep keys server-side.
export CHEAPERGEN_API_KEY="cg_live_…"
# every request
Authorization: Bearer $CHEAPERGEN_API_KEYMOSS Image Text to Image API
/api/v1/run/openmoss/moss-image/text-to-imageSubmits an asynchronous job and returns 202 with a generation id. Poll GET /api/v1/generations/{id} or pass webhook_url. See job lifecycle.
Input parameters
| Name | Type | Description | Affects price |
|---|---|---|---|
promptrequired | string | Natural language, comma-separated tags or a JSON layout (a scene caption plus items with text and bounding boxes, in pixels from the canvas centre). Put the exact words to render in quotes. | No |
aspect_ratio | string (enum) | Output image shape. At 1K: 1:1 = 1024 × 1024, 4:5 = 912 × 1136, 5:4 = 1136 × 912, 3:4 = 880 × 1168, 4:3 = 1168 × 880, 2:3 = 832 × 1248, 3:2 = 1248 × 832, 9:16 = 768 × 1360, 16:9 = 1360 × 768, 1:2 = 720 × 1440, 2:1 = 1440 × 720, 9:21 = 656 × 1552, 21:9 = 1552 × 656, 1:3 = 576 × 1760, 3:1 = 1760 × 576. Values: 1:1 · 4:5 · 5:4 · 3:4 · 4:3 · 2:3 · 3:2 · 9:16 · 16:9 · 1:2 · 2:1 · 9:21 · 21:9 · 1:3 · 3:1 Default: 1:1 | Yes |
resolution | string (enum) | Output size, the same price at every aspect ratio: 1K = 1 MP (1024 × 1024), 1.5K ≈ 2.25 MP (1536 × 1536), 2K = 4 MP (2048 × 2048) at 1:1, with 1 MP = 1024² px. Other ratios keep the pixels: each side is the 1:1 side × √ratio, rounded down to a multiple of 16 (e.g. 2K 16:9 = 2720 × 1536). Values: 1K · 1.5K · 2K Default: 1K | Yes |
seed | integer | Use the same seed and settings to reproduce a result. Leave empty for random. | No |
enable_safety_checker | boolean | If set to true, the safety checker will be enabled. Content our Acceptable Use Policy prohibits stays blocked either way. Default: true | No |
webhook_url | string (URL) | Optional. We POST the finished generation here, signed with your webhook secret. Webhooks | No |
Request
const API = "https://cheapergen.com/api/v1";
const headers = {
Authorization: `Bearer ${process.env.CHEAPERGEN_API_KEY}`,
"Content-Type": "application/json",
};
// 1. Submit the job
let job = await fetch(`${API}/run/openmoss/moss-image/text-to-image`, {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A hand-painted wooden sign outside a tea shop that reads “山间茶舍 MOUNTAIN TEA HOUSE — OPEN DAILY 9–6”, morning mist, warm light",
"aspect_ratio": "1:1",
"resolution": "1K"
}),
}).then((r) => r.json());
// 2. Poll until it finishes (or pass webhook_url and skip polling)
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 3000));
job = await fetch(`${API}/generations/${job.id}`, { headers }).then((r) => r.json());
}
console.log(job.status === "succeeded" ? job.output.images[0].url : job.error);Response
{
"id": "gen_8c2QmX1nq0k4",
"object": "generation",
"model": "openmoss/moss-image",
"endpoint": "openmoss/moss-image/text-to-image",
"mode": "text-to-image",
"status": "queued",
"input": {
"prompt": "A hand-painted wooden sign outside a tea shop that reads “山间茶舍 MOUNTAIN TEA HOUSE — OPEN DAILY 9–6”, morning mist, warm light",
"aspect_ratio": "1:1",
"resolution": "1K"
},
"output": null,
"error": null,
"cost": {
"amount_usd": 0.2255,
"currency": "usd",
"estimated": true,
"official_usd": null,
"list_price_source": "reference",
"list_price_label": "fal API",
"saved_usd": null
},
"source": "api",
"started_at": null,
"completed_at": null,
"urls": {
"get": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4",
"cancel": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4/cancel"
},
"created_at": "2026-10-15T09:21:04Z"
}Get the result
Generations are asynchronous. Poll until status is succeeded, failed or canceled — or pass webhook_url when you submit. Failed generations are refunded automatically.
curl https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4 \
-H "Authorization: Bearer $CHEAPERGEN_API_KEY"More: job lifecycle · webhooks · errors
MOSS Image pricing
Pay per image as you go, with no subscription required. Failed generations are refunded automatically.
| Tier | fal API | CheaperGen | You save |
|---|---|---|---|
1K 1024 × 1024 | $0.0384/img With a monthly plan: Pro $0.0368Max $0.0352 | −23% | |
1.5K 1536 × 1536 | $0.0826/img With a monthly plan: Pro $0.0788Max $0.0749 | −27% | |
2K 2048 × 2048 | $0.1534/img With a monthly plan: Pro $0.1469Max $0.1404 | −23% |
Monthly plans lower prices on most models (shown under each price); you can still pay as you go. Pro $499/month · Max $4,999/month.
- fal API: fal's public price for MOSS Image, $0.05 per megapixel, on the output's pixels (OpenMOSS sells no international API) — https://fal.ai/models/fal-ai/moss-image. Prices verified October 22, 2026.
- One price per resolution, whatever the aspect ratio.