reAPIGénération d’imagesAI generation

OpenAI: GPT Image 2

reapi.image-gen.gpt-image-2

Generate or edit one image with GPT Image 2 at a flat per-resolution price.

Prix
$0.081/successAu prix catalogue
Taux de réussite
100 %30 derniers jours · 12 465 appels
Latence p50
346 msp95 622 ms
Dernière vérification
14 sept. 2026Vérifié et opérationnel
POSThttps://toolswitch.dev/v1/tools/reapi.image-gen.gpt-image-2Beta
  • Utilise le quota de la plateforme
  • Réponse asynchrone
  • Lit des données publiques

Paramètres

ParamètreTypeObligatoireDescriptionExemple
Corps (JSON)
sizechaîneFacultatifAspect ratio.1:1
modelchaîneObligatoiregpt-image-2
promptchaîneObligatoireA clean editorial illustration of a paper airplane.
image_urlstableauFacultatifUp to 16 public image URLs for image-to-image. Each URL must answer a plain GET with the raw image bytes and an image/* content-type (signed cloud-storage or CDN links work; file-page hosts such as tmpfiles.org return HTML, and the task then fails unbilled with the vendor's generic upstream error). `treg host <file>` prints a URL that satisfies this.
resolutionchaîneFacultatif1k
  • Corps (JSON)
  • sizechaîneFacultatif

    Aspect ratio.

    Exemple : 1:1

  • modelchaîneObligatoire

    Exemple : gpt-image-2

  • promptchaîneObligatoire

    Exemple : A clean editorial illustration of a paper airplane.

  • image_urlstableauFacultatif

    Up to 16 public image URLs for image-to-image. Each URL must answer a plain GET with the raw image bytes and an image/* content-type (signed cloud-storage or CDN links work; file-page hosts such as tmpfiles.org return HTML, and the task then fails unbilled with the vendor's generic upstream error). `treg host <file>` prints a URL that satisfies this.

  • resolutionchaîneFacultatif

    Exemple : 1k

Exemples de code

Remplacez $TOOLSWITCH_KEY par la clé créée dans la console.

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/reapi.image-gen.gpt-image-2' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"size":"1:1","model":"gpt-image-2","prompt":"A clean editorial illustration of a paper airplane.","resolution":"1k"}'

Cette API de passerelle est en version Beta ; son URL et son authentification peuvent changer. Les paramètres de l’exemple sont des données fictives. Les appels sont facturés à $0.081/success, frais de service inclus.