{
  "schemaVersion": "1.0",
  "item": {
    "slug": "xai-image-gen",
    "name": "xAI Image Generator",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/mexicanamerican/xai-image-gen",
    "canonicalUrl": "https://clawhub.ai/mexicanamerican/xai-image-gen",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/xai-image-gen",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=xai-image-gen",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "DEPLOYMENT.md",
      "README.md",
      "SKILL.md",
      "SUMMARY.md",
      "requirements.txt",
      "skill.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-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/xai-image-gen"
    },
    "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/xai-image-gen",
    "agentPageUrl": "https://openagent3.xyz/skills/xai-image-gen/agent",
    "manifestUrl": "https://openagent3.xyz/skills/xai-image-gen/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/xai-image-gen/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "xai-image-gen",
        "body": "Generate images using xAI's Grok API (grok-imagine-image model)."
      },
      {
        "title": "Description",
        "body": "Production-ready CLI tool for generating images via xAI's image generation API. Supports multiple output formats, resolutions, and batch generation. Automatically outputs MEDIA: paths for OpenClaw auto-attachment.\n\nFeatures:\n\n🎨 Simple CLI interface: xai-gen \"<prompt>\"\n🖼️ Multiple output formats: URL download, base64 encoding\n🔢 Batch generation (multiple images per prompt)\n⚡ Fast, pure API implementation (Pi-safe)\n🛡️ Robust error handling with user-friendly messages\n📎 Auto-attaches generated images in OpenClaw\n🎯 Uses xAI's native resolution (no size parameter needed)"
      },
      {
        "title": "Installation",
        "body": "# Navigate to skills directory\ncd ~/.openclaw/workspace/skills\n\n# Clone or copy this skill\n# (or install via clawhub when published)\n\n# Install dependencies\npip3 install requests\n\n# Ensure the script is executable\nchmod +x xai-image-gen/xai-gen\n\nSet your xAI API key:\n\nexport XAI_API_KEY=\"your-api-key-here\"\n\nAdd to your shell profile (~/.bashrc, ~/.zshrc) to persist:\n\necho 'export XAI_API_KEY=\"your-api-key-here\"' >> ~/.bashrc"
      },
      {
        "title": "Basic Usage",
        "body": "# Generate with simple prompt\nxai-gen \"sunset over mountains\"\n\n# Custom filename\nxai-gen \"cyberpunk city\" --filename city.png\n\n# Generate multiple images\nxai-gen \"futuristic vehicle\" --n 3\n\n# Base64 output (no download)\nxai-gen \"logo design\" --format b64\n\n# Verbose mode\nxai-gen \"space station\" --verbose"
      },
      {
        "title": "Options",
        "body": "positional arguments:\n  prompt                Text description of the image to generate\n\noptions:\n  -h, --help            Show help message\n  --model MODEL         Model name (default: grok-imagine-image)\n  --filename FILENAME   Output filename (default: out.png)\n  --format {url,png,b64}\n                        Response format: url (download), png (alias), b64 (base64)\n  --n N                 Number of images to generate (default: 1)\n  --verbose, -v         Show detailed progress"
      },
      {
        "title": "Examples",
        "body": "Generate a meme:\n\nxai-gen \"dumbest trade meme: YOLO panic fail\" --filename trade_meme.png\n\nBatch generation:\n\nxai-gen \"logo variations for tech startup\" --n 5\n# Outputs: out_1.png, out_2.png, out_3.png, out_4.png, out_5.png\n\nHigh-quality artwork:\n\nxai-gen \"photorealistic portrait of a cat astronaut\" --filename cat_astronaut.png"
      },
      {
        "title": "Integration with OpenClaw",
        "body": "The tool outputs MEDIA: /path/to/image.png which OpenClaw automatically detects and attaches to messages. Use in agent workflows:\n\n# In an agent skill or automation\nxai-gen \"chart showing Q1 sales data\" --filename sales_chart.png\n# → Image auto-attaches to response"
      },
      {
        "title": "API Details",
        "body": "Endpoint: https://api.x.ai/v1/images/generations\nModel: grok-imagine-image\nAuthentication: Bearer token via XAI_API_KEY\nRate Limits: Subject to xAI API limits (check xAI docs)\nTimeout: 60s for generation, 30s for download"
      },
      {
        "title": "Error Handling",
        "body": "The tool handles common errors gracefully:\n\n❌ Missing API key → Clear instructions\n❌ Network errors → Descriptive messages\n❌ API timeouts → Retry suggestions\n❌ Invalid parameters → Usage hints\n❌ File write errors → Permission checks"
      },
      {
        "title": "Requirements",
        "body": "Python: 3.7+\nDependencies: requests\nAPI Key: xAI API key (get from https://console.x.ai)\nNetwork: Internet connection required"
      },
      {
        "title": "Platform Compatibility",
        "body": "✅ Linux (tested on Raspberry Pi)\n✅ macOS\n✅ Windows (via WSL or native Python)\n✅ ARM64 / ARMv7 (Pi-safe, pure API calls)"
      },
      {
        "title": "Troubleshooting",
        "body": "\"XAI_API_KEY not found\"\n\nexport XAI_API_KEY=\"xai-...\"\n\n\"requests library not found\"\n\npip3 install requests\n\nPermission denied\n\nchmod +x xai-gen\n\nAPI errors\n\nCheck API key validity\nVerify account has credits\nCheck xAI status page"
      },
      {
        "title": "License",
        "body": "MIT License - Free to use and modify"
      },
      {
        "title": "Author",
        "body": "Built for OpenClaw by subagent xAI Image Gen Skill Builder"
      },
      {
        "title": "Version",
        "body": "1.0.0 - Initial release"
      }
    ],
    "body": "xai-image-gen\n\nGenerate images using xAI's Grok API (grok-imagine-image model).\n\nDescription\n\nProduction-ready CLI tool for generating images via xAI's image generation API. Supports multiple output formats, resolutions, and batch generation. Automatically outputs MEDIA: paths for OpenClaw auto-attachment.\n\nFeatures:\n\n🎨 Simple CLI interface: xai-gen \"<prompt>\"\n🖼️ Multiple output formats: URL download, base64 encoding\n🔢 Batch generation (multiple images per prompt)\n⚡ Fast, pure API implementation (Pi-safe)\n🛡️ Robust error handling with user-friendly messages\n📎 Auto-attaches generated images in OpenClaw\n🎯 Uses xAI's native resolution (no size parameter needed)\nInstallation\n# Navigate to skills directory\ncd ~/.openclaw/workspace/skills\n\n# Clone or copy this skill\n# (or install via clawhub when published)\n\n# Install dependencies\npip3 install requests\n\n# Ensure the script is executable\nchmod +x xai-image-gen/xai-gen\n\n\nSet your xAI API key:\n\nexport XAI_API_KEY=\"your-api-key-here\"\n\n\nAdd to your shell profile (~/.bashrc, ~/.zshrc) to persist:\n\necho 'export XAI_API_KEY=\"your-api-key-here\"' >> ~/.bashrc\n\nUsage\nBasic Usage\n# Generate with simple prompt\nxai-gen \"sunset over mountains\"\n\n# Custom filename\nxai-gen \"cyberpunk city\" --filename city.png\n\n# Generate multiple images\nxai-gen \"futuristic vehicle\" --n 3\n\n# Base64 output (no download)\nxai-gen \"logo design\" --format b64\n\n# Verbose mode\nxai-gen \"space station\" --verbose\n\nOptions\npositional arguments:\n  prompt                Text description of the image to generate\n\noptions:\n  -h, --help            Show help message\n  --model MODEL         Model name (default: grok-imagine-image)\n  --filename FILENAME   Output filename (default: out.png)\n  --format {url,png,b64}\n                        Response format: url (download), png (alias), b64 (base64)\n  --n N                 Number of images to generate (default: 1)\n  --verbose, -v         Show detailed progress\n\nExamples\n\nGenerate a meme:\n\nxai-gen \"dumbest trade meme: YOLO panic fail\" --filename trade_meme.png\n\n\nBatch generation:\n\nxai-gen \"logo variations for tech startup\" --n 5\n# Outputs: out_1.png, out_2.png, out_3.png, out_4.png, out_5.png\n\n\nHigh-quality artwork:\n\nxai-gen \"photorealistic portrait of a cat astronaut\" --filename cat_astronaut.png\n\nIntegration with OpenClaw\n\nThe tool outputs MEDIA: /path/to/image.png which OpenClaw automatically detects and attaches to messages. Use in agent workflows:\n\n# In an agent skill or automation\nxai-gen \"chart showing Q1 sales data\" --filename sales_chart.png\n# → Image auto-attaches to response\n\nAPI Details\nEndpoint: https://api.x.ai/v1/images/generations\nModel: grok-imagine-image\nAuthentication: Bearer token via XAI_API_KEY\nRate Limits: Subject to xAI API limits (check xAI docs)\nTimeout: 60s for generation, 30s for download\nError Handling\n\nThe tool handles common errors gracefully:\n\n❌ Missing API key → Clear instructions\n❌ Network errors → Descriptive messages\n❌ API timeouts → Retry suggestions\n❌ Invalid parameters → Usage hints\n❌ File write errors → Permission checks\nRequirements\nPython: 3.7+\nDependencies: requests\nAPI Key: xAI API key (get from https://console.x.ai)\nNetwork: Internet connection required\nPlatform Compatibility\n✅ Linux (tested on Raspberry Pi)\n✅ macOS\n✅ Windows (via WSL or native Python)\n✅ ARM64 / ARMv7 (Pi-safe, pure API calls)\nTroubleshooting\n\n\"XAI_API_KEY not found\"\n\nexport XAI_API_KEY=\"xai-...\"\n\n\n\"requests library not found\"\n\npip3 install requests\n\n\nPermission denied\n\nchmod +x xai-gen\n\n\nAPI errors\n\nCheck API key validity\nVerify account has credits\nCheck xAI status page\nLicense\n\nMIT License - Free to use and modify\n\nAuthor\n\nBuilt for OpenClaw by subagent xAI Image Gen Skill Builder\n\nVersion\n\n1.0.0 - Initial release"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/mexicanamerican/xai-image-gen",
    "publisherUrl": "https://clawhub.ai/mexicanamerican/xai-image-gen",
    "owner": "mexicanamerican",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/xai-image-gen",
    "downloadUrl": "https://openagent3.xyz/downloads/xai-image-gen",
    "agentUrl": "https://openagent3.xyz/skills/xai-image-gen/agent",
    "manifestUrl": "https://openagent3.xyz/skills/xai-image-gen/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/xai-image-gen/agent.md"
  }
}