Skip to main content
POST
GPT Image 2 Official

Parameters and input modes

model and input are required; omitted optional fields use model defaults. See the Body section below for full field definitions.

Use cases

Submit an example to POST /api/v1/tasks/create_task with your own prompt and media URLs.
Track results via Query task or callback_url (Webhook security); see Create task for submission errors. Output URLs remain valid for 14 days; tasks unfinished after 24 hours fail at no charge.

Playground and pricing

Each task generates up to n images and settles once from actual Token usage, rounded up to 0.1 Credits (capped by the submission hold; unused Credits are returned). Partial success is charged only for the outputs returned; failed tasks cost 0. Check balances via Available Credits.

Try in Playground

Set parameters and generate an image.

View pricing

View Token rates, estimates, and hold caps.

Authorizations

Authorization
string
header
required

Sign in to APIstable, then create and copy a key from API Key management.

Send this HTTP header with every request:

Replace YOUR_API_KEY with the key you created.

Body

application/json
model
enum<string>
required

The APIstable model ID for this endpoint.

Available options:
gpt-image-2-official
Example:

"gpt-image-2-official"

input
object
required

Model input parameters. Omitted optional fields use model defaults.

callback_url
string<uri>

Optional public HTTPS endpoint for signed completion callbacks; no redirects or private IPs.

Callbacks

POST
{$request.body#/callback_url}Webhook

Body

application/json

When the task succeeds or fails, APIstable sends a JSON POST to the callback_url supplied at creation. Verify the signature and return HTTP 2xx to acknowledge delivery.

All outputs from the request are returned in result.urls (possibly fewer than n), with the single task total in charged_credits. Failed tasks return status: "failed" and result: null at no charge.

Use X-APIstable-Signature, X-APIstable-Timestamp, and X-APIstable-Event-Id to verify and deduplicate deliveries. See Webhook security.

Webhook payload example

code
integer
required
msg
string
required
Allowed value: "success"
data
object
required

Response

2XX

Webhook acknowledged.

Response

Accepted task. Poll the common task endpoint or use callback_url.

code
any
required
msg
any
required
data
object
required