ImageOpenAI3 vendors

gpt-image-2-4k

OpenAI image generation model available through the GPT88 unified API.

Get API Key on gpt88.ccQuickstart

Overview

  • gpt-image-2-4k is listed in the current GPT88 model catalog with model ID gpt-image-2-4k.
  • This route uses a generic English integration profile because a model-specific editorial profile has not been published. Confirm current access and behavior before production use.

Best Use Cases

  • Evaluate it when you need a image generation model and want to keep an existing GPT88 integration.
  • Compare it with a model that already performs well on the same representative workload before changing a production default.

Integration Notes

  • Keep the exact model ID gpt-image-2-4k in the request body and use the endpoint displayed on this page.
  • Call GET /v1/models or check the GPT88 console first to confirm that the current API key can access the model.

Usage Notes

  • Availability, pricing, context limits, rate limits, routes, permissions, and feature support are determined by the current GPT88 console configuration.
  • Generic catalog copy is not a model capability guarantee. Validate output quality, errors, latency, and usage on your own workload.

Capabilities

This model's Capabilities should be verified in the gpt88.cc console. This page focuses on protocol shape and request examples.gpt88.cc console for the real-time catalog.

Recommended Scenarios

This model's Recommended Scenarios should be verified in the gpt88.cc console. This page focuses on protocol shape and request examples.gpt88.cc console for the real-time catalog.

Endpoint Path

POSThttps://img.gpt88.cc/v1/images/generations

The endpoint path is determined by the model category. Chat, image, video, and audio models use different endpoints.

Send requests with Authorization: Bearer <API_KEY>. See Images API for the full parameter reference.

API Docs

Endpoint
POST /v1/images/generations
Model ID
gpt-image-2-4k
Content-Type
application/json
Protocol
Image generation endpoint. Supports text-to-image; some models also support image-to-image.
Base URL
Image endpoints use the media Base URL https://img.gpt88.cc.

Headers / Auth

  • AuthorizationstringRequired
    Send Bearer <GPT88_API_KEY>. Create the API key in the gpt88.cc console.
  • Content-TypestringRequired
    Request body format. Audio transcription uploads use multipart/form-data.
    Default:application/json
  • Acceptstring
    Non-streaming requests return JSON; streaming chat requests return SSE chunks.
    Default:application/json

Request Parameters

The fields below are generated by model category. Pricing, context limits, rate limits, and available routes should be confirmed in the gpt88.cc console.

  • modelstringRequired
    Current model ID: gpt-image-2-4k. Preserve the exact casing when copying.
  • promptstringRequired
    Text instruction for image generation or editing. Describe the subject, style, composition, and anything that must remain unchanged.
  • imagefile | file[]
    Reference image file for image-to-image. The OpenAI editing flow uses uploaded files instead of image URLs.
  • sizestring
    Output size or aspect configuration. Supported values vary by model and should be confirmed in the console.
    Default:1024x1024
  • resolutionstring
    Output quality, for example 1K. Higher resolutions depend on the model and account configuration.
  • ninteger
    Number of images to generate. For batch jobs, watch account concurrency and rate limits.
    Default:1

Response Fields

Response bodies generally follow OpenAI-compatible shapes. Media models may return async task IDs or resource URLs.

  • createdintegerRequired
    Creation time as Unix seconds.
  • dataarray<Image>Required
    Generated image array, usually containing url or b64_json.
  • usageobject
    Some models return usage data. Actual presence depends on the model response.

Status Codes

  • 200OKRequired
    Request succeeded. See the response field table above for the response body shape.
  • 400Bad Request
    Invalid request fields, such as missing required fields, unsupported image size format, or unsupported file type.
  • 401Unauthorized
    API key is missing, invalid, or malformed.
  • 404Not Found
    Endpoint or model not found. Confirm the path is /v1/images/generations and the model ID is gpt-image-2-4k.
  • 429Rate Limited
    Rate limit, concurrency cap, or insufficient balance. Check the console for the current allowance.
  • 5xxUpstream Error
    Upstream or request failure. Retry with the same Base URL and keep the request ID for debugging.

Errors and Troubleshooting

  • 401: verify Authorization is Bearer <API_KEY> and the key is still valid.
  • 404: confirm the endpoint is /v1/images/generations and the model ID gpt-image-2-4k is available in the console.
  • 429: reduce concurrency, shorten requests, or check balance and quota in the console.
  • 5xx: retry with the same Base URL and keep the request ID for debugging.

Request Examples

Text-to-Image

Send only a prompt and let the model generate a new image from scratch.

curl https://img.gpt88.cc/v1/images/generations \
  -H "Authorization: Bearer $GPT88_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2-4k",
    "prompt": "极简风格的 API 文档站封面",
    "size": "1024x1024",
    "n": 1
  }'

Image-to-Image

Reference image flow

Upload reference image files and continue generation while preserving subject matter or style.

import requests

with open("reference.png", "rb") as f:
    resp = requests.post(
        "https://img.gpt88.cc/v1/images/edits",
        headers={
            "Authorization": "Bearer YOUR_GPT88_API_KEY",
        },
        files={
            "image": f,
        },
        data={
            "model": "gpt-image-2-4k",
            "prompt": "保留参考图主体,改成极简 API 文档站封面风格",
            "size": "1536x1024",
            "quality": "high",
        },
    )
print(resp.json())

Expected response (trimmed example):

200 OKjson
{
  "created": 1730000000,
  "data": [
    { "url": "https://cdn.gpt88.cc/images/gpt-image-2-4k-001.png" }
  ]
}