Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Canonical value: grok_imagine_image_quality_edit
Compatibility alias: grok-imagine-image-quality-edit
prompt string required
Text instruction describing the requested image edit
image object
Single input image to edit. Use images when providing multiple input images
url
stringrequiredPublic image URL or Base64-encoded data URL in JPEG, PNG, or WebP format
type
stringImage reference type
Value:
image_url
images array<object>
Multiple input images to use for the edit. Each item uses the same structure as image
url
stringrequiredPublic image URL or Base64-encoded data URL in JPEG, PNG, or WebP format
type
stringImage reference type
Value:
image_url
n integer
Number of edited images to generate
Default: 1
response_format string
Image response format requested from the upstream image API
Options: url, b64_json
Default: url
API Boundary
Call this model through /model/v1/generation. It is not exposed through the
OpenAI Images or Queue endpoints.
Input Image Behavior
Provide image for a single reference or images for multiple references.
At least one of these parameters is required. Vtrix accepts public image URLs
and Base64 data URLs at the generation boundary.
Output Behavior
The final task output contains hosted image URLs in output[].content[].url.
When the upstream model returns Base64 image data, Vtrix uploads the image and
returns the hosted URL instead of exposing the raw Base64 payload.
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
jobId
stringRemote task ID
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information