
Grok Imagine API
activexAI's Grok Imagine — powerful AI image generation and upscaling from the creators of Grok. Fast, high-quality, and unrestricted.
Quick Start
Send a request to the Grok Imagine API:
| 1 | curl -X POST https://apiin.one/api/v1/images/generations \ |
| 2 | -H "Authorization: Bearer YOUR_API_KEY" \ |
| 3 | -H "Content-Type: application/json" \ |
| 4 | -d '{ |
| 5 | "model": "grok-imagine/text-to-image", |
| 6 | "prompt": "An astronaut riding a horse on Mars, photorealistic" |
| 7 | }' |
API Endpoint
/api/v1/images/generationsSend a POST request with your API key to generate content using Grok Imagine.
Headers
Bearer YOUR_API_KEY
application/json
Body Parameters
Model identifier: grok-imagine
Text prompt for image generation (max 5000 chars)
Sub-model: grok-imagine/text-to-image (5cr) or grok-imagine/upscale (12cr) Defaults to grok-imagine/text-to-image.
Task ID for upscale mode (upscale a previously generated image)
Example Request
| 1 | { |
| 2 | "model": "grok-imagine/text-to-image", |
| 3 | "prompt": "An astronaut riding a horse on Mars, photorealistic" |
| 4 | } |
Example Response
Successful task creation response.
| 1 | { |
| 2 | "code": 200, |
| 3 | "message": "success", |
| 4 | "data": { |
| 5 | "task_id": "n31xxxx_grok", |
| 6 | "status": "IN_PROGRESS" |
| 7 | } |
| 8 | } |
Check Task Status
For asynchronous tasks, poll the status endpoint to check when your task is complete:
/api/v1/tasks/{task_id}Returns the current status of a generation task. Poll until status is 'completed' or 'failed'.
| 1 | curl https://apiin.one/api/v1/tasks/task_abc123 \ |
| 2 | -H "Authorization: Bearer aio_your_key" |
Use Cases
- ✓Generate creative and unrestricted AI imagery
- ✓Upscale AI-generated images for higher resolution
- ✓Build AI art generation features into apps
- ✓Create marketing and social media visuals
API Tester
Test the Grok Imagine API directly from your browser:
Error Codes
| 1 | { |
| 2 | "error": { |
| 3 | "code": 400, |
| 4 | "message": "Invalid parameters", |
| 5 | "type": "invalid_request" |
| 6 | } |
| 7 | } |
Frequently Asked Questions
How much does Grok Imagine cost?
Text-to-image: 5 credits (~$0.01), upscale: 12 credits (~$0.024).
What modes does Grok Imagine support?
Two image modes: text-to-image and upscale. For video generation, see Grok Video.
Do I need a Twitter/X Premium subscription?
No. API in One provides direct API access without any X/Twitter subscription.
Why Use Grok Imagine Through API in One?
Ready to use Grok Imagine?
Get Your API Key →