Lompat ke konten

GPT Image 2 API

Integrasikan

ID model openai/gpt-image-2
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/openai/gpt-image-2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Permintaan ini: ≈$0,106 106 kredit API Jalankan di halaman ini

Dapatkan kunci API
OpenAI Teks ke Gambar #gpt-image-2#openai#typography#chatgpt-images-2

GPT Image 2 text-to-image dengan ukuran fleksibel hingga sisi 3840px, ditujukan untuk tipografi presisi

Dibuat di Doitong

Karya publik yang dibuat dengan GPT Image 2 API oleh komunitas Doitong. Gunakan kembali prompt dengan satu klik.

Karya publik yang ditampilkan: 16
A polished studio concept art board — a single composite page that reads as a high-end pre-produc...

A polished studio concept art board — a single composite page that reads as a high-end pre-production pitch deck for an animated short. NOT a vintage pencil sketch, NOT a finished movie frame, but a polished concept page in the visual treatment described below. Layout: TOP HEADER (left): bold...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое наполь...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое напольное зеркало в тонкой арочной раме. Спиной к камере у зеркала стоит взрослая девушка-, корпус развёрнут к своему отражению, голова слегка повёрнута в профиль, взгляд направлен в зеркало на свою...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое наполь...

Создай не меняя черты лица. Фотореалистичный винтажный cinematic portrait. В кадре большое напольное зеркало в тонкой арочной раме. Спиной к камере у зеркала стоит взрослая девушка-, корпус развёрнут к своему отражению, голова слегка повёрнута в профиль, взгляд направлен в зеркало на свою...

Create image: ultra realistic image: man 35 years old sitting in super luxury house (ref4). Luxur...

Create image: ultra realistic image: man 35 years old sitting in super luxury house (ref4). Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furni...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The man is...

Сделай этикетку на продукцию оформленную красиво и стильно в соответствии с составом. Можешь орие...

Сделай этикетку на продукцию оформленную красиво и стильно в соответствии с составом. Можешь ориентироваться по стилю на фото 1. Текст на этикетке: производитель ИП Стрини Ю.Л. «соломка горбуши», состав: рыба горбуша, соль, сахар, специи. Срок хранения при t не от 0 до -3 60 суток. Вес: 500гр

Create image: ultra realistic image: man 35 years old (attached reference ) sitting in super luxu...

Create image: ultra realistic image: man 35 years old (attached reference ) sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furni...

Create image: ultra realistic image: man 35 years old sitting in super luxury house. Luxury furniture, marble floor with east carpet. The most luxurious way. Middle shot One cake in front of him on the marble table, with thin golden lit candles. A man sits relaxed on a luxurious sofa. The man is...

Buat permintaan

Kontrol dibuat dari skema model. Kode dan harga diperbarui saat Anda mengubahnya.

•wajib 88 / 32000

Prompt yang digunakan untuk membuat gambar.

image_size bawaan landscape_4_3

Dimensi output menerima nama preset, objek {width, height}, atau 'auto' untuk pilihan ukuran terbaik model. Semua ukuran konkret harus memiliki dimensi yang habis dibagi 16, sisi tidak lebih panjang dari 3840px, rasio aspek paling besar 3:1, dan jumlah piksel total 655,360–8,294,400.

num_images bawaan 1

Jumlah gambar yang akan dibuat.

Lanjutan background · quality · output_format · enable_safety_checker
background bawaan auto

Latar belakang gambar yang dihasilkan.

quality bawaan high

Pilihan kualitas gambar, termasuk 'auto' untuk pilihan kualitas terbaik oleh model berdasarkan prompt.

output_format bawaan png

Format file gambar output.

POST /run/openai/gpt-image-2?wait=20 estimasi harga → $0,106
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/openai/gpt-image-2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Jalankan permintaan ini

Key Anda tetap berada di browser ini: key hanya dikirim ke Doitong API dan disimpan (localStorage) hanya jika Anda mencentang Ingat. Dapatkan kunci API

Tentang GPT Image 2 API

Membuat gambar dari prompt hingga 32000 karakter. `image_size` menerima prasetel, auto, atau lebar dan tinggi eksplisit, dengan kedua dimensi harus merupakan kelipatan 16 dan sisi maksimum 3840px. Kualitas dapat berupa auto, low, medium, atau high, dengan hingga 4 gambar per panggilan dalam png, jpeg, atau webp.

Parameter

Kirim nama kanonis atau nama asli, bukan keduanya. Nama kanonis

NamaTipe BawaanDiizinkan Deskripsi
promptwajib
Tipestring
≤ 32.000 karakter≥ 2 karakter
Prompt yang digunakan untuk membuat gambar.
image_sizeopsional
Tipeobject
Bawaanlandscape_4_3
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
Dimensi output menerima nama preset, objek {width, height}, atau 'auto' untuk pilihan ukuran terbaik model. Semua ukuran konkret harus memiliki dimensi yang habis dibagi 16, sisi tidak lebih panjang dari 3840px, rasio aspek paling besar 3:1, dan jumlah piksel total 655,360–8,294,400.
backgroundopsional
Tipeenum
Bawaanauto
autotransparentopaque
Latar belakang gambar yang dihasilkan.
qualityopsional
Tipeenum
Bawaanhigh
autolowmediumhigh
Pilihan kualitas gambar, termasuk 'auto' untuk pilihan kualitas terbaik oleh model berdasarkan prompt.
num_imagesopsional num_outputs
Tipeinteger
Bawaan1
1 – 4
Jumlah gambar yang akan dibuat.
output_formatopsional
Tipeenum
Bawaanpng
jpegpngwebp
Format file gambar output.
enable_safety_checkeropsional
Tipeboolean
Bawaantrue
Penyaringan dapat dilonggarkan dengan menetapkan false, jika pemanggil berwenang.
wajib Nama kanonis, juga diterima

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "openai/gpt-image-2",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 106,
    "usd": "0.106",
    "charged": 106,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
File Anda, pilihan AndaSetiap outputs[].url adalah salinan di penyimpanan kami: disimpan selamanya (dikenai biaya per GB-bulan) atau 7 hari gratis, sesuai setelan akun atau ?storage=.
Struktur sama di setiap modeltype, url, content_type, width, height, dan duration, untuk gambar, video, dan audio. output adalah objek hasil milik model.
Field output
images
array of object {url, content_type, file_name, file_size, width, height}Gambar yang dihasilkan oleh model.

Model lainnya: Teks ke Gambar

Untuk agen AI: halaman ini dalam Markdown tersedia di https://doitong.com/id/developers/models/openai/gpt-image-2.md. Semua model dan panduan: https://doitong.com/developers/llms.txt