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 '{
  "filesUrl": [
    ""
  ],
  "isEnhance": false,
  "maskUrl": "",
  "nVariants": 1,
  "prompt": "A beautiful sunset over the mountains",
  "size": "1:1"
}'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
OpenAI’s multimodal image generation model with support for image understanding, editing, and masking features.

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 one of the supported formats

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 enhancement (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

Number of variants (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"