GenCraft.ccPOST /api/v1/generate · GET /api/v1/tasks
Public endpoints for batch and agent integrations. Authenticate with the API key already issued to your account — no separate token required.
Include your API key in the Authorization header. The key is the same one assigned to your account in user_keys (provided by GenCraft after your plan is activated). A bad key returns 401.
Authorization: Bearer <your_api_key>{ "error": { "type": "invalid_api_key", "message": "Invalid API key" } }/api/v1/generateSubmits the task to the upstream image provider and immediately returns task_ids. To get the resulting image you can either (A) poll GET /v1/tasks/{id} yourself, or (B) just open the website — the same account's Image Creation tab will auto-pick up the task and persist results to "My Works".
curl -X POST https://www.gencraft.cc/api/v1/generate \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene Japanese garden in autumn",
"model": "flash",
"mode": "text",
"aspect": "16:9",
"imageSize": "2K",
"count": 1
}'{
"task_ids": ["task_abc123"],
"email": "you@example.com"
}| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | ✓ | — | Generation prompt |
| model | string | gpt-image-2 | Model id (see below) | |
| mode | text | edit | fusion | text | text=text-to-image; edit=single-image edit; fusion=multi-image blend | |
| aspect | string | 1:1 | Ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9, … | |
| imageSize | 1K | 2K | 4K | 2K | Output resolution | |
| count | number | 1 | Image count (capped per model) | |
| imageUrls | string[] | [] | Reference image URLs for edit / fusion |
| model | Name | Supported modes |
|---|---|---|
| gpt-image-2 | GPT Image 2 | text, edit |
| pro | Nano Banana Pro | text, edit |
| flash2 | Nano Banana 2 | text, edit |
| flash | Nano Banana | text, edit |
| HTTP | error.type | When |
|---|---|---|
| 400 | invalid_request | Body is not JSON, prompt is empty, model unknown, or model does not support the mode |
| 401 | unauthorized | Missing Authorization header or wrong format |
| 401 | invalid_api_key | API key not found in user_keys |
| 500 | upstream_error | Upstream provider returned an error (message included) |
/api/v1/tasks/{task_id}Returns the upstream task status. status is one of queued / in_progress / completed / failed. completed adds an imageUrl field; failed adds an error field.
curl https://www.gencraft.cc/api/v1/tasks/task_abc123 \
-H "Authorization: Bearer <your_api_key>"{
"task_id": "task_abc123",
"status": "completed",
"progress": 100,
"imageUrl": "https://files.example.com/generated/xxx.png"
}/api/v1/tasks?ids=t1,t2Polls many tasks in one call to save round-trips and auth lookups. Results are returned in the same order as the input ids. Max 20 ids per request.
curl "https://www.gencraft.cc/api/v1/tasks?ids=task_abc,task_def,task_ghi" \
-H "Authorization: Bearer <your_api_key>"{
"tasks": [
{ "task_id": "task_abc", "status": "completed", "progress": 100, "imageUrl": "https://..." },
{ "task_id": "task_def", "status": "in_progress", "progress": 60 },
{ "task_id": "task_ghi", "status": "failed", "progress": 0, "error": "model overloaded" }
]
}| HTTP | error.type | When |
|---|---|---|
| 400 | invalid_request | Missing ids param, or more than 20 ids |
| 401 | unauthorized | Missing Authorization header or wrong format |
| 401 | invalid_api_key | API key not found in user_keys |
/api/v1/uploadServer-side fetches an image from a public URL and re-hosts it on the upstream CDN, returning a stable URL. Pass the result to generate_image's imageUrls. Max 25 MB per image; png / jpeg / webp / gif / bmp accepted.
curl -X POST https://www.gencraft.cc/api/v1/upload \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"source_url": "https://example.com/cat.png"}'{
"url": "https://files.example.com/uploads/abc123.png",
"filename": "cat.png",
"content_type": "image/png",
"bytes": 524288
}/api/v1/history?page=1&limit=20Returns past generations attributed to this API key, most recent first. Pagination via page (1-indexed) and limit (max 50).
curl "https://www.gencraft.cc/api/v1/history?page=1&limit=20" \
-H "Authorization: Bearer <your_api_key>"{
"items": [
{
"id": "tsk_img_xxx",
"prompt": "a cat in autumn",
"model": "flash",
"mode": "text",
"aspect": "16:9",
"imageSize": "2K",
"imageCount": 1,
"images": ["https://..."],
"refs": [],
"createdAt": 1777461252000
}
],
"total": 42,
"page": 1,
"limit": 20,
"total_pages": 3
}/api/v1/user/statusReturns the email, tier (trial / starter / standard / pro), and whether the upstream key is configured. Useful for agents to decide whether they can afford a high-cost model.
curl https://www.gencraft.cc/api/v1/user/status \
-H "Authorization: Bearer <your_api_key>"{
"email": "you@example.com",
"tier": "pro",
"has_key": true
}For LLM agents, the easiest way to use GenCraft is via the official MCP server published as @gencraft/mcp-server on npm. It exposes 6 tools (generate_image, get_task, batch_get_tasks, upload_reference_image, list_my_generations, get_account_status) over stdio and works with any MCP-compatible client. Add the snippet below to your client's MCP config — that's it.
Path: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) · %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"gencraft": {
"command": "npx",
"args": ["-y", "@gencraft/mcp-server"],
"env": {
"GENCRAFT_API_KEY": "<your_api_key>"
}
}
}
}