Install
openclaw skills install maliang-imageGenerate images from text prompts or edit existing images with AI. Powered by Google Gemini via Maliang API. Free $6 credit on first use (~10 images). Suppor...
openclaw skills install maliang-imageProvider: Maliang API (nano.djdog.ai) Model: Google Gemini (image generation & editing) Pricing: $0.60/image, free $6 credit on first use (~10 images)
Generate images from text descriptions or edit existing images using AI.
POST /api/v1/provision. The key is stored only in your local environment (MALIANG_API_KEY). You can revoke it at any time.| Input | Source | Required |
|---|---|---|
| Text prompt | User message | YES |
| Reference images | User provides file paths or URLs | NO (if omitted, generates from text) |
| Aspect ratio | User preference | NO (default: 1:1) |
On first use (when MALIANG_API_KEY is not set), automatically provision a new account:
curl -s -X POST "https://nano.djdog.ai/api/v1/provision"
Response:
{
"success": true,
"data": {
"api_key": "sk-...",
"short_code": "ML-XXXXXX",
"balance": 6.0,
"currency": "USD",
"recharge_url": "https://nano.djdog.ai/recharge/ML-XXXXXX",
"message": "Your API key has been created with $6 initial credit (~10 images)..."
}
}
Save the returned api_key as MALIANG_API_KEY for all subsequent requests.
Tell the user their short code (ML-XXXXXX) and initial balance — they'll need the short code to recharge later.
After each task, check remaining balance:
curl -s "https://nano.djdog.ai/api/v1/balance" \
-H "Authorization: Bearer ${MALIANG_API_KEY}"
Response includes short_code for recharge reference. If balance is low, remind the user:
Your balance is $X.XX. To recharge, visit: https://nano.djdog.ai/recharge/{short_code}
If MALIANG_API_KEY is not set, run Auto-Provision first (see above) and store the returned key.
For each image the user provides:
data:image/...;base64, prefix — the API accepts raw base64.Generate mode — call:
curl -s -X POST "https://nano.djdog.ai/api/v1/generate" \
-H "Authorization: Bearer ${MALIANG_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "<user prompt>",
"aspect_ratio": "<ratio, default 1:1>"
}'
Edit mode — call:
curl -s -X POST "https://nano.djdog.ai/api/v1/edit" \
-H "Authorization: Bearer ${MALIANG_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "<user editing instruction>",
"image": "<base64 string or array of base64 strings>",
"aspect_ratio": "<ratio, optional>"
}'
Both return:
{
"success": true,
"data": {
"task_id": "...",
"status": "pending",
"created_at": "..."
}
}
Extract task_id from the response.
Poll every 3 seconds, up to 120 seconds max:
curl -s "https://nano.djdog.ai/api/v1/tasks/${TASK_ID}" \
-H "Authorization: Bearer ${MALIANG_API_KEY}"
Response data.status values:
| Status | Meaning | Action |
|---|---|---|
pending | Queued | Keep polling |
processing | Generating | Keep polling |
completed | Done | Get image from image_url or image_base64 |
failed | Error | Show error.message to user |
dead | Max retries exceeded | Show error, suggest retry |
When status is completed:
image_url is present: show the URL to the user (preferred).image_base64 is present: save to a local file and show the path.Image generated successfully!
URL: https://...
Aspect ratio: 1:1
Prompt: "<original prompt>"
| Error | Action |
|---|---|
| 401 Unauthorized | MALIANG_API_KEY is invalid or missing. Try re-provisioning a new account. |
| 402 Insufficient Balance | Tell user to recharge via https://nano.djdog.ai/recharge/{short_code} (get short_code from balance endpoint) |
| 400 IMAGE_TOO_LARGE | Tell user the image exceeds 10 MB limit |
| 400 TOO_MANY_IMAGES | Tell user max 10 images allowed |
| Network error | Retry once, then report failure |
| Timeout (120s) | Report task ID, suggest checking later |
Text-to-image:
User: Generate a cute orange cat sitting on a windowsill at sunset, anime style
→ Auto-provision if no API key → POST /api/v1/generate with prompt → poll for result → return image URL
Image editing:
User: Change the background of this photo to a beach scene [attaches photo]
→ Base64-encode the photo
→ POST /api/v1/edit with prompt + image, poll for result, return image URL
Multi-image editing:
User: Combine these character designs into one group portrait [attaches 3 images]
→ Base64-encode all 3 images
→ POST /api/v1/edit with prompt + image array, poll for result, return image URL