curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-1.0",
"prompt": "雨夜的未来城市,写实摄影",
"size": "1024x1024",
"n": 1,
"response_format": "url",
"quality": "standard"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"index": 1,
"revised_prompt": "<string>"
}
],
"model": "<string>",
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"background": "<string>",
"usage": {}
}Image generation
Use POST /v1/images/generations for Grok text-to-image and reference-image generation. model and prompt are required; optional images accepts 1–5 reference images. Use size for the aspect ratio, quality for output resolution, and n for 1–4 outputs.
curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-1.0",
"prompt": "雨夜的未来城市,写实摄影",
"size": "1024x1024",
"n": 1,
"response_format": "url",
"quality": "standard"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"index": 1,
"revised_prompt": "<string>"
}
],
"model": "<string>",
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"background": "<string>",
"usage": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unified Grok image generation request with optional reference images.
1Required. Use a model ID or available alias returned by Get Models.
1"grok-imagine-1.0"
"grok-imagine-2.0"
"grok-imagine-image"
"grok-imagine-image-quality"
"grok-imagine-image-2.0"
Model-specific image options.
Number of outputs, from 1 to 4.
1 <= x <= 4Aspect ratio expressed as WIDTHxHEIGHT, such as 1024x1536 for 2:3. auto uses the model default ratio. quality controls output resolution.
^(auto|[1-9][0-9]*x[1-9][0-9]*)$Response format: url returns image URLs; b64_json returns Base64 image data.
url, b64_json standard produces 1K output; hd produces 2K output. Availability depends on the selected model.
standard, hd Optional reference images, 1–5 images. Omit for text-to-image generation; provide images to generate from references and the prompt. An independent mask is not supported.
1 - 5 elements1Response
Success
Creation timestamp.

