메인 콘텐츠로 건너뛰기
POST
/
v1
/
images
/
generations
OpenAI image generations
curl --request POST \
  --url https://maas.apigo.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,油画风格",
  "model": "gpt-image-1",
  "size": "1024x1024",
  "quality": "high"
}
'
{
  "created": 1589478378,
  "background": "auto",
  "output_format": "png",
  "quality": "high",
  "size": "1024x1024",
  "data": [
    {
      "url": "https://example.com/generated-image.png"
    }
  ],
  "usage": {
    "input_tokens": 15,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 15
    },
    "output_tokens": 1,
    "total_tokens": 16
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

텍스트 프롬프트에서 이미지를 만듭니다.
  • Authorization: Bearer {API_KEY}로 인증
  • 이것을 텍스트-이미지 경로로 사용하십시오. 편집, 인페인팅 또는 이미지 확장을 위해서는 /v1/images/edits를 사용하세요.
  • gpt-image-1, dall-e-3dall-e-2는 다양한 매개변수 세트를 노출하며 이러한 차이점은 이제 위의 기본 매개변수 패널에 렌더링됩니다.
  • 응답에 임시 url 값이 포함된 경우 해당 값을 서버 측에서 빠르게 미러링하세요. b64_json가 포함된 경우 메인 스레드에서 너무 많은 큰 이미지를 디코딩하지 마십시오.

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

본문

application/json
prompt
string
필수

Text prompt for the desired image.

예시:

"一只可爱的小猫在花园里玩耍,阳光明媚,油画风格"

model
enum<string>

Image generation model.

사용 가능한 옵션:
gpt-image-1,
dall-e-3,
dall-e-2
background
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
transparent,
opaque,
auto
moderation
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
auto,
low
n
integer
기본값:1

Number of images to generate. dall-e-3 only supports 1.

필수 범위: 1 <= x <= 10
output_compression
integer
기본값:100

Compression level for gpt-image-1 jpeg/webp output.

필수 범위: 0 <= x <= 100
output_format
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
png,
jpeg,
webp
partial_images
integer
기본값:0

Number of partial images for streaming previews.

필수 범위: 0 <= x <= 3
quality
enum<string>

Supported values vary by model.

사용 가능한 옵션:
auto,
high,
medium,
low,
hd,
standard
response_format
enum<string>

Only applies to dall-e-2 and dall-e-3.

사용 가능한 옵션:
url,
b64_json
size
enum<string>

Allowed values depend on the selected model.

사용 가능한 옵션:
1024x1024,
1536x1024,
1024x1536,
auto,
256x256,
512x512,
1792x1024,
1024x1792
stream
boolean
기본값:false

Only supported by gpt-image-1.

style
enum<string>

Only supported by dall-e-3.

사용 가능한 옵션:
vivid,
natural
user
string

Unique identifier for the end user.

응답

Successful image generation response

created
integer<int64>
필수

Unix timestamp in seconds.

data
object[]
필수
background
enum<string>
사용 가능한 옵션:
transparent,
opaque,
auto
output_format
enum<string>
사용 가능한 옵션:
png,
jpeg,
webp
quality
enum<string>
사용 가능한 옵션:
auto,
high,
medium,
low,
hd,
standard
size
string
usage
object