Skip to content

Grok Imagine Image 2.0 Segment Map ​

Input mode 1: task_id ​

Endpoint ​

POST /images/generations

Full URL: https://modelfold.ai/v1/images/generations

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.

Input parameters for the segment map task.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name used for generation. This field is required. This endpoint must use the grok-imagine-image-2-0/segment-map model. Default:"grok-imagine-image-2-0/segment-map"。 Allowed values:grok-imagine-image-2-0/segment-map。 Example:grok-imagine-image-2-0/segment-map。
task_idstringYesThe ID of an existing task. Required. minLength: 1. Example:task_grok_imagine_1765180586443。
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. maxLength: 2000.

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine-image-2-0/segment-map",
  "task_id": "task_grok_imagine_1765180586443",
  "prompt": "A paper boat drifting down a rainy street."
}'
json
{
  "model": "grok-imagine-image-2-0/segment-map",
  "task_id": "task_grok_imagine_1765180586443",
  "prompt": "A paper boat drifting down a rainy street."
}

Response ​

200 — Generation completed. usage contains actual billing details; result URLs are illustrative. ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

Input mode 2: image_url ​

Endpoint ​

POST /images/generations

Full URL: https://modelfold.ai/v1/images/generations

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.

Input parameters for the segment map task.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name used for generation. This field is required. This endpoint must use the grok-imagine-image-2-0/segment-map model. Default:"grok-imagine-image-2-0/segment-map"。 Allowed values:grok-imagine-image-2-0/segment-map。 Example:grok-imagine-image-2-0/segment-map。
image_urlstringYesThe URL of the reference image.
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. maxLength: 2000.

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine-image-2-0/segment-map",
  "image_url": "https://example.com/reference.png",
  "prompt": "A paper boat drifting down a rainy street."
}'
json
{
  "model": "grok-imagine-image-2-0/segment-map",
  "image_url": "https://example.com/reference.png",
  "prompt": "A paper boat drifting down a rainy street."
}

Response ​

200 — Generation completed. usage contains actual billing details; result URLs are illustrative. ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — one API for all the best AI models.