# xAI Grok Imagine Image Generation

> xAI Grok Imagine Image Generation is a paid API for AI agents from image.withzero.xyz, paid per call via MPP, $0.05/call, status unknown (last checked 2026-09-13).

Generates 1–4 images from a text prompt using xAI's Grok Imagine model, returning hosted image URLs.

## Facts

- Endpoint: POST https://image.withzero.xyz/api/v1/images/grok-imagine
- Price: $0.05/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 3
- Provider: image.withzero.xyz
- Website: https://image.withzero.xyz
- Canonical page: https://www.zero.xyz/c/image-withzero-xyz-xai-grok-imagine-image-generation-5c994abc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XXPk1ut_kTGSloSrM63YI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability image-withzero-xyz-xai-grok-imagine-image-generation-5c994abc -d '<json body>'
```

Example prompt: Use Grok Imagine to generate 3 images of a futuristic city skyline at sunset with neon lights reflecting off rain-soaked streets.

## When to prefer this

Choose this endpoint when you specifically want xAI's Grok Imagine model for image generation, particularly if you prefer Grok's visual style or are comparing outputs across providers. Use it over the OpenAI or Google alternatives when Grok's aesthetic or model provenance matters to the use case.

## Known failure modes

- Prompt exceeds 4000 character limit — request rejected with validation error
- Count outside 1–4 range — request rejected
- Prompt is empty or missing — required field validation error
- xAI model unavailability or upstream timeout — service error response
- Content policy violation on the prompt — request blocked or rejected

## How this service works

Generate images from a text prompt with xAI's Grok Imagine quality tier. Returns hosted image URLs.

## Output

An array of 1–4 generated image objects, each containing a hosted URL, MIME type, and file size in bytes. Also returns the model name used and the USDC price charged for the request.

## Example request

```json
{
 "count": 1,
 "prompt": "A serene mountain landscape with snow-capped peaks, a crystal-clear alpine lake reflecting the peaks, and golden hour sunlight"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "example": {
  "count": 1,
  "prompt": "A watercolor painting of a lighthouse at sunrise"
 },
 "required": [
  "prompt",
  "count"
 ],
 "properties": {
  "count": {
   "type": "integer",
   "default": 1,
   "maximum": 4,
   "minimum": 1,
   "description": "How many images to generate (1–4)."
  },
  "prompt": {
   "type": "string",
   "maxLength": 4000,
   "minLength": 1,
   "description": "Text description of the image to generate."
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "images",
  "model",
  "price_usdc"
 ],
 "properties": {
  "model": {
   "type": "string",
   "description": "The model that produced the images."
  },
  "images": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "url",
     "mimeType",
     "sizeBytes"
    ],
    "properties": {
     "url": {
      "type": "string"
     },
     "mimeType": {
      "type": "string"
     },
     "sizeBytes": {
      "type": "number"
     }
    },
    "additionalProperties": false
   },
   "description": "The generated images, as hosted URLs."
  },
  "price_usdc": {
   "type": "string",
   "description": "The amount charged for this request, in USDC."
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/image-withzero-xyz-xai-grok-imagine-image-generation-5c994abc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from image.withzero.xyz](https://www.zero.xyz/host/image.withzero.xyz/llms.txt)
