# Send Grok Imagine Image Pro to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "grok-imagine-image-pro",
    "name": "Grok Imagine Image Pro",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/NixeiFoit/grok-imagine-image-pro",
    "canonicalUrl": "https://clawhub.ai/NixeiFoit/grok-imagine-image-pro",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/grok-imagine-image-pro",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=grok-imagine-image-pro",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/grok-imagine-image-pro"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/grok-imagine-image-pro",
    "downloadUrl": "https://openagent3.xyz/downloads/grok-imagine-image-pro",
    "agentUrl": "https://openagent3.xyz/skills/grok-imagine-image-pro/agent",
    "manifestUrl": "https://openagent3.xyz/skills/grok-imagine-image-pro/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/grok-imagine-image-pro/agent.md"
  }
}
```
## Documentation

### Grok Imagine Image Pro

API Key: $XAI_API_KEY (already configured)
Save dir: ~/.openclaw/media/ (resolves to /data/.openclaw/media/ — allowed for Telegram sending)

### Available Models

grok-imagine-image — standard quality, faster
grok-imagine-image-pro — higher quality (default for generation)

### 1. Image Generation

curl -s https://api.x.ai/v1/images/generations \\
  -H "Authorization: Bearer $XAI_API_KEY" \\
  -H "Content-Type: application/json" \\
  --data '{
    "model": "grok-imagine-image-pro",
    "prompt": "<PROMPT>",
    "n": 1,
    "response_format": "b64_json"
  }' | python3 -c "
import json, sys, base64, os, time
os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True)
r = json.load(sys.stdin)
ts = int(time.time())
for i, img in enumerate(r['data']):
    img_data = base64.b64decode(img['b64_json'])
    fpath = os.path.expanduser(f'~/.openclaw/media/generated_{ts}_{i}.png')
    with open(fpath, 'wb') as f:
        f.write(img_data)
    print(fpath)
"

### Aspect Ratios

Add "aspect_ratio": "<ratio>" to the JSON body. Supported values:

RatioUse case1:1Social media, thumbnails16:9 / 9:16Widescreen, mobile stories4:3 / 3:4Presentations, portraits3:2 / 2:3Photography2:1 / 1:2Banners, headersautoModel picks best ratio (default)

### Batch Generation

Set "n": <count> (1-10) to generate multiple images in one request.

### 2. Image Editing / Style Transfer

Edit an existing image by providing a source image plus an edit prompt.
Uses the same /v1/images/generations endpoint with an added image_url field.

Do NOT use /v1/images/edits with multipart — xAI requires JSON.

IMPORTANT: For local files, use Python to build the payload JSON file, then curl with @file.
Inline base64 in curl args causes "Argument list too long" for images >~100KB.

NOTE: This is NOT true image editing — the API generates a new image inspired by the source.
It cannot make pixel-precise edits (e.g. changing only a car's color while keeping everything else identical).

### Edit from local file (recommended approach):

python3 -c "
import json, base64
with open('<SOURCE_PATH>', 'rb') as f:
    b64 = base64.b64encode(f.read()).decode()
payload = {
    'model': 'grok-imagine-image',
    'prompt': '<EDIT_PROMPT>',
    'image_url': f'data:image/png;base64,{b64}',
    'n': 1,
    'response_format': 'b64_json'
}
with open('/tmp/img_edit_payload.json', 'w') as f:
    json.dump(payload, f)
print('Payload ready')
" && \\
curl -s https://api.x.ai/v1/images/generations \\
  -H "Authorization: Bearer $XAI_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d @/tmp/img_edit_payload.json | python3 -c "
import json, sys, base64, os, time
os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True)
r = json.load(sys.stdin)
img_data = base64.b64decode(r['data'][0]['b64_json'])
fpath = os.path.expanduser(f'~/.openclaw/media/edited_{int(time.time())}.png')
with open(fpath, 'wb') as f:
    f.write(img_data)
print(fpath)
"

### Edit from URL:

curl -s https://api.x.ai/v1/images/generations \\
  -H "Authorization: Bearer $XAI_API_KEY" \\
  -H "Content-Type: application/json" \\
  --data '{
    "model": "grok-imagine-image",
    "prompt": "<EDIT_PROMPT>",
    "image_url": "<PUBLIC_IMAGE_URL>",
    "n": 1,
    "response_format": "b64_json"
  }' | python3 -c "
import json, sys, base64, os, time
os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True)
r = json.load(sys.stdin)
img_data = base64.b64decode(r['data'][0]['b64_json'])
fpath = os.path.expanduser(f'~/.openclaw/media/edited_{int(time.time())}.png')
with open(fpath, 'wb') as f:
    f.write(img_data)
print(fpath)
"

### Style Transfer Examples

Use editing with a style prompt, e.g.:

"Render this as an oil painting in impressionist style"
"Make this a pencil sketch with detailed shading"
"Convert to pop art with bold colors"
"Watercolor painting with soft edges"

### 3. Sending to Telegram

message tool: action=send, channel=telegram, target=<id>,
  message="<caption>", filePath=~/.openclaw/media/<file>.png

Always include message field (required even for media-only sends)
Allowed media paths: /tmp/, ~/.openclaw/media/, ~/.openclaw/agents/

### Notes

Do NOT pass size parameter — returns 400
Aspect ratio: pass aspect_ratio in JSON body (not size)
Editing: use image_url field in the generations endpoint (NOT the edits endpoint with multipart)
Always use "response_format": "b64_json" — URL format returns temporary URLs that often 403
For large images: build payload with Python → save to /tmp/ → curl with @file syntax
Max 10 images per request
Images are subject to content moderation
Editing is style-transfer/reimagination, NOT pixel-precise inpainting
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: NixeiFoit
- Version: 1.0.2
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/grok-imagine-image-pro)
- [Send to Agent page](https://openagent3.xyz/skills/grok-imagine-image-pro/agent)
- [JSON manifest](https://openagent3.xyz/skills/grok-imagine-image-pro/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/grok-imagine-image-pro/agent.md)
- [Download page](https://openagent3.xyz/downloads/grok-imagine-image-pro)