PixMind Docs
API ReferenceImage ModelsGrok Imagine 2.0 Eco

Grok Imagine 2.0 Eco API

Grok Imagine 2.0 Eco API reference

Expressive xAI text-to-image generation across seven common aspect ratios and batches of up to twelve images.

Provider

xAI

Model ID

grok-imagine-2-eco

Endpoint

POST /api-platform/v1/generations

Model notes

    Request parameters

    ParameterTypeRequiredDescription
    modelstringYes

    Stable PixMind model ID. Use `grok-imagine-2-eco`.

    Allowed values: grok-imagine-2-eco

    promptstringYes

    Natural-language generation or editing instructions.

    resolutionstringNo

    Output resolution tier. This field affects request pricing.

    Allowed values: quality

    Default: quality

    aspectRatiostringNo

    Requested output aspect ratio.

    Allowed values: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9

    Default: 1:1

    nintegerNo

    Number of images to generate in this request.

    Allowed values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

    Default: 1

    Request example

    cURL
    curl https://aihub-admin.aimix.pro/api-platform/v1/generations \
      -H "Authorization: Bearer $PIXMIND_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "grok-imagine-2-eco",
      "prompt": "A polished campaign image with clean composition and controlled lighting",
      "resolution": "quality",
      "aspectRatio": "1:1"
    }'
    JavaScript
    const response = await fetch("https://aihub-admin.aimix.pro/api-platform/v1/generations", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.PIXMIND_API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
      "model": "grok-imagine-2-eco",
      "prompt": "A polished campaign image with clean composition and controlled lighting",
      "resolution": "quality",
      "aspectRatio": "1:1"
    })
    });
    
    const task = await response.json();

    Accepted task response

    Generation is asynchronous. Save taskId and poll GET /api-platform/v1/tasks/{taskId} until status is ready or failed.

    200 OK
    {
      "code": 1000,
      "data": {
        "id": "img_44160",
        "taskId": 44160,
        "type": "image",
        "model": "grok-imagine-2-eco",
        "status": "processing"
      }
    }

    API pricing

    ConfigurationPrice
    default$0.090 / image

    API pricing uses the apiPlatform role and is separate from PixMind Studio credits. The accepted task response is the final pricing snapshot.