GPT Image 2 API-Dokumente
GPT Image 2 API-Dokumente
GPT Image 2 APIQuickstartAuthenticationPricing
API referenceGenerate imageGenerate videoGet task status
API reference

API reference

Every endpoint, request body, and response shape.

Three endpoints cover the full generation loop.

  • POST /api/ai/image/generate — submit an image generation task.
  • POST /api/ai/video/generate — submit a video generation task.
  • GET /api/ai/tasks/{id} — poll the current status and fetch the result.

Each endpoint page includes model-specific notes, parameter guidance, and an interactive playground. For the exact credit matrix behind those requests, see Pricing.

Base URL

  • Production — https://gptimage2api.org
  • Local dev — http://localhost:3000

Conventions

  • Request and response bodies are JSON.
  • Authentication is Authorization: Bearer <api-key>. See Authentication.
  • Task IDs, provider IDs, and user IDs are opaque strings. Don't parse them.
  • Errors use a consistent shape: { error: string, ...details }. See Errors & refunds.

Pricing

Per-model credit costs for every supported image and video endpoint.

Generate image

POST /api/ai/image/generate — submit a text-to-image or image-to-image task across GPT Image 2 and Nano Banana models.

Inhaltsverzeichnis

Base URLConventions