DataEyesAI
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models APITerms & Policies
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models APITerms & Policies
  1. Image Models
  • Documentation
    • Getting Started
      • Welcome to DataEyesAI
      • Quickstart
      • API Keys and Authentication
      • Base URL and SDKs
      • Models, Groups, and Pricing
    • Developer Tool Integration
      • Claude Code
      • Claude Code for VS Code
      • Codex
      • OpenClaw
      • OpenCode
      • Cline
      • Gemini CLI
      • Grok CLI
      • n8n
      • AutoClaw
      • Other tools
      • Claude Code 400 troubleshooting
    • AI Models API
      • API Overview
      • Chat Completions
      • Responses
      • Messages (Claude)
      • Gemini (generateContent)
      • Embeddings
      • Image Models
        • Images
        • Gemini Image Generation
        • Grok Imagine Image
      • Midjourney format
        • Midjourney API Reference
        • Task query interface
        • Upload image
        • Get seed (Seed)
        • Submit Imagine task
        • Query tasks based on ID list
        • FaceSwap
        • Execute Action operation
        • /mj/submit/blend
        • Submit Describe task
        • Submit Modal
        • Refresh link
        • Edit image
        • Query task status by task ID
        • Get the seed of the task image
      • Video Model
        • FLUX Video Generation (flux-3-video)
        • Grok Video Generation
          • 00-Overview
          • 01-Text-to-Video
          • 02-Image-to-Video
          • 03-Reference-to-Video
          • 04-Video-Editing
          • 05-Video-Extension
        • Seedance Video Generation
          • 00-Overview
          • 01-Create-Video-Generation-Task
          • 02-Query-Video-Generation-Task
          • 03-Query-Video-Generation-Task-List
          • 04-Cancel-or-Delete-Task
          • Seedance Private Asset Library API Documentation
        • MiniMax-H3 Video Generation
          • 00-Overview
          • 01-Create-Video-Generation
          • 02-Create-Video-Regeneration
          • 03-Create-H3-Context-IR
          • 04-Query-Task
          • 05-List-Tasks
          • 06-Cancel-or-Delete-Task
        • Hailuo Video Generation
          • 00-Overview
          • 01-Text-to-Video-T2V
          • 02-Image-to-Video-I2V
          • 03-First-Last-Frame-FL2V
          • 04-Subject-Reference-S2V
          • 05-Query-Task-Status
          • 06-Video-Download
          • 99-Appendix-Camera-Movement-and-Webhooks
        • Jimeng Video Generation
          • 00-Overview
          • 01-3.0-Pro-Video-Generation
          • 02-720P-Text-to-Video
          • 03-720P-Image-to-Video-First-Frame
          • 04-720P-Image-to-Video-Start-End-Frame
          • 05-720P-Image-to-Video-Camera
          • 06-1080P-Text-to-Video
          • 07-1080P-Image-to-Video-First-Frame
          • 08-1080P-Image-to-Video-Start-End-Frame
          • 09-Error-Codes
        • Kling AI Video Generation
          • 00-Overview
          • 01-Text-to-Video
          • 02-Image-to-Video
          • 03-Omni-Video
          • 04-Multi-Image-to-Video
          • 05-Motion-Control
          • 06-Multi-Elements
          • 07-Video-Extension
          • 08-Lip-Sync
          • 09-Avatar
          • 10-Text-to-Audio
          • 11-Video-to-Audio
          • 12-TTS
          • 13-Custom-Voices
          • 14-Image-Recognition
          • 15-Element-Management
          • 16-Video-Effects
          • 17-Kling-4.0-Video-Generation
        • Vidu Video Generation
          • 00-Overview
          • 01-Text-to-Video
          • 02-Image-to-Video
          • 03-Reference-to-Video
          • 04-Start-End-Frame
          • 05-Multi-Frame
          • 06-Scene-Template
          • 07-Template-Story
          • 08-Query-Tasks
        • HappyHorse
          • HappyHorse Text-to-Video
          • HappyHorse Image-to-Video (First Frame)
          • HappyHorse Reference-to-Video
          • HappyHorse Video Editing
        • Wan Video Generation
          • 00-Overview.md
          • 01-Text-to-Video
          • 02-Image-to-Video
          • 03-Reference-to-Video
          • 04-Video-Editing
          • 05-First-Last-Frame-to-Video
          • 06-Motion-Transfer-and-Character-Swap
          • 07-Digital-Human-Video
          • 08-VACE-Video-Editing
          • 09-Query-Task
      • Audio API
        • Audio API
        • Gemini TTS API
        • Google DeepMind Lyria API
        • Elevenlabs Speech to Text API Reference
    • Search / Reader Product
      • Search & Reader
      • Web Search
      • Search and Read
      • Video Search
      • Web Reader
      • Document Parsing
      • Trending
      • Weather
      • All City ID
    • Advanced & System API
      • FAQ
      • System interface
        • API Key & Quota Query API
        • API Key Management API
      • API Reference​​
        • Error Codes
        • Rate Limits and Billing Rules
      • List models
        • Models
  • Terms & Policies
    • DataEyesAI API Terms of Service
    • DataEyesAI Legal Notice and Privacy Policy
    • DataEyesAI Paid Services Agreement
    • Automatic Renewal Service Rules
  1. Image Models

Grok Imagine Image

xAI's image models come in two versions:
ModelNotes
grok-imagine-image-2.0Supports quality; priced by quality and resolution tier
grok-imagine-imageFixed price per image; 2k costs the same
UseEndpoint
Text to imagePOST https://studio.dataeyes.ai/v1/images/generations
Image editing (with a reference image)POST https://studio.dataeyes.ai/v1/images/edits (JSON)

Quick example#

cURL
Python
Response (excerpt, Base64 truncated):
{
  "data": [
    { "b64_json": "/9j/4AAQSkZJRgABAQAAAQAB…", "mime_type": "image/jpeg" }
  ]
}
Without response_format, an image link is returned in data[].url. In our tests the link returned 403 from some networks, so b64_json is recommended.

Request parameters#

ParameterTypeRequiredDescription
modelstringYesgrok-imagine-image-2.0 or grok-imagine-image
promptstringYesImage description
aspect_ratiostringNoAspect ratio, such as 1:1, 16:9, 9:16
resolutionstringNo1k (default) or 2k
qualitystringNogrok-imagine-image-2.0 only: low, medium, auto. Defaults to low for generation and medium for editing. high is not supported
nintegerNoNumber of images, default 1; billed per image
response_formatstringNourl (default) or b64_json
size is not supported; use aspect_ratio and resolution instead. Sizes from our tests:
Settinggrok-imagine-image-2.0grok-imagine-image
Default1024×10241248×832
resolution: "2k"2048×20482496×1664
aspect_ratio: "16:9", 1k1280×720
aspect_ratio: "9:16", 2k1584×2816

Image editing#

Use POST https://studio.dataeyes.ai/v1/images/edits with a JSON body. Put the reference image in the image object; url can be a public image URL or data:image/png;base64,.... Both models support editing.
WARNING
The edits endpoint accepts JSON only; multipart/form-data file uploads are not supported (the OpenAI SDK's images.edit does not work).
Do not pass image to /v1/images/generations: the reference image has no effect there.

Billing#

Billed per image: grok-imagine-image has a fixed price per image; grok-imagine-image-2.0 is tiered by quality and resolution. For editing, the reference image is billed as input in addition. See prices in the Model Hub and charges in Usage logs. Failed requests are not billed.

FAQ#

grok-imagine models do not support the size parameter
This model only supports the following quality value(s)
422 error
The image link returns 403
Previous
Gemini Image Generation
Next
Midjourney API Reference