Skip to content

Generate

Overview

    • Method: POST
    • Path: /ideogram/generate
    • Content-Type:application/json

Authentication

  • Authorization: Bearer sk-xxx (required)

Request Example

HeaderExampleRequired
Content-Typeapplication/jsonYes
AuthorizationBearer sk-xxxxYes

Request Body (JSON)

json
{
  "image_request": {
    "prompt": "A detailed image depicts a vast Stone Age city...",
    "model": "V_2",
    "aspect_ratio": "ASPECT_10_16",
    "magic_prompt_option": "AUTO"
  }
}

Parameter Description

ParameterTypeRequiredDefaultDescription
image_requestobjectYes-Image request object, refer to official documentation
- promptstringYes-Prompt
- modelstringNoV_2Model version, options: V_1/V_1_TURBO/V_2/V_2_TURBO
- aspect_ratiostringNoASPECT_1_1Aspect ratio
- resolutionstringNo-Supported on 2.0 only, for image resolution
- style_typestringNo-Style type, V_2+ only
- negative_promptstringNo-Negative prompt
- color_paletteobjectNo-Color palette config
- seedstringNo-Seed

Response Example (200)

json
{
  "created": "2024-10-30T18:45:11.507243+00:00",
  "data": [
    {
      "is_image_safe": true,
      "prompt": "A detailed image depicts a vast Stone Age city...",
      "resolution": "768x1232",
      "seed": 1705925986,
      "style_type": null,
      "url": "https://ideogram.ai/api/images/ephemeral/aUXMxzdBQy..."
    }
  ]
}