Gpt Image 1

gpt-image-1-text-to-image

post

OpenAI's latest image generation and editing model: gpt-1-image.

Header parameters
AuthorizationstringRequiredExample: sk-Qp03mnjjNqXKxpnw5qQ4IqVABNfad5YOk1axUhp7pJbokFmu
Body
modelstringRequired

model is the model name

Example: gpt-image-1-text-to-image
promptstringRequired

prompt is the prompt.

Example: A cute baby sea otter.
sizestring · enumOptional

The size of the image to generate. Default value: "auto"

Possible enum values: auto, 1024x1024, 1536x1024, 1024x1536

Default: autoExample: autoPossible values:
qualitystring · enumOptional

The quality of the image to generate. Default value: "auto"

Possible enum values: auto, low, medium, high

Default: autoExample: autoPossible values:
backgroundstring · enumOptional

The background of the image to generate. Default value: "auto"

Possible enum values: auto, transparent, opaque

Default: autoExample: autoPossible values:
moderationstring · enumOptionalDefault: autoExample: autoPossible values:
nintegerOptional

n is the number of images to generate, default value is 1.

Default: 1Example: 1
output_formatstring · enumOptional

output_format indicate the output format, default value is url.

Default: urlExample: urlPossible values:
Responses
200Success
application/json
post
/v1/images/generations
POST /v1/images/generations HTTP/1.1
Host: image.onerouter.pro
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 170

{
  "model": "gpt-image-1-text-to-image",
  "prompt": "A cute baby sea otter.",
  "size": "auto",
  "quality": "auto",
  "background": "auto",
  "moderation": "auto",
  "n": 1,
  "output_format": "url"
}
200Success
{
  "data": [
    {
      "url": "https://resource.onerouter.pro/image/generated%2Fonerouter_c0f827fd-09fb-40e3-8a66-3b377cd67920.png",
      "b64_json": "",
      "revised_prompt": ""
    }
  ],
  "created": 1760510251
}