Skip to main content
POST
/
generate
/
k
/
gpt4o-image
GPT-4o Image Generation
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/gpt4o-image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "size": "1:1",
  "filesUrl": [
    ""
  ],
  "isEnhance": false,
  "maskUrl": "",
  "nVariants": 1,
  "prompt": "A beautiful sunset over the mountains"
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Create and edit images using OpenAI’s GPT-4o native image generation capabilities. Key Features:
  • Native Multimodal - Image generation built into GPT-4o architecture, not external model calls
  • Precise Text Rendering - Significantly better text generation than DALL·E 3
  • Multi-Turn Consistency - Refine images through natural conversation while maintaining style coherence
  • Image Understanding & Editing - Support uploading images as input for understanding and transformation

Authorizations

Authorization
string
header
required

Please use your API Token for authentication

Body

application/json

Task parameters

size
enum<string>
default:1:1
required

Size (required) - Image aspect ratio, must be a supported format

Available options:
1:1,
3:2,
2:3
Example:

"1:1"

filesUrl
string[]

File URL list (optional) - File URL list, max 5 images

Example:
[""]
isEnhance
boolean
default:false

Enable enhance (optional) - Prompt enhancement, default false

Example:

false

maskUrl
string

Mask URL (optional) - Mask image URL for editing, black areas will be replaced/modified

Example:

""

nVariants
enum<integer>
default:1

Variant count (optional) - Image variant count, options 1, 2, or 4, default 1

Available options:
1,
2,
4
Example:

1

prompt
string

Prompt (optional) - Describe what you want GPT-4o to generate

Example:

"A beautiful sunset over the mountains"

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"