Skip to main content
POST
/
v1
/
images
/
generations
grok-4-image (text to image)
curl --request POST \
  --url https://api.example.com/v1/images/generations
curl --location --request POST 'https://gptproto.com/v1/images/generations' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "grok-4-image",
    "prompt": "Over-the-shoulder shot, horizontal lens. From behind a tall, bald man in a dark coat, we see into a chaotic, party-lit laboratory. The man'\''s sharp silhouette frames the scene. In the distance, under a spinning disco ball, three small, yellow creatures are dancing wildly among waving robotic arms. The man'\''s head is slightly tilted, and though we can'\''t see his full face, the corner of a smile is visible, suggesting his anger has been replaced by fond exasperation. The room is a swirl of color and light."
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgrok-4-imageThe model to use for image generation. grok-4-image
promptstring✅ Yes-The text prompt describing the image to generate