Skip to content
הדף עדיין אינו זמין בשפה שלכם, ולכן הוא מוצג באנגלית.
OpenAI · GPT Image

gpt-image-2 API

Generate images from text or reference images with gpt-image-2 on APISea.

יצירת תמונותתמונותמשימה אסינכרונית
מזהה מודל
gpt-image-2

תמחור API של gpt-image-2

כל המחירים נקובים ב-USD. תעריפי APISea בהשוואה למחירון הרשמי עבור אותה יחידה.

אפשרותAPISeaרשמיחיסכון
ברירת מחדלברירת מחדל$0.00935$0.2107−96%
1K$0.00935$0.2107−96%
2K$0.0165$0.4282−96%
4K$0.0242$0.7116−97%

המחירים הם לכל תמונה.

מהו gpt-image-2?

gpt-image-2 is an OpenAI GPT Image model for text-to-image and image-to-image generation on APISea. Submit a detailed English or Chinese prompt, or supply reference images to guide generation. The endpoint supports 15 aspect ratios, with output tiers controlled through the resolution parameter: 1k, 2k, or 4k. Reference inputs can combine public image URLs and base64 data URIs. Processing is asynchronous: the generation request returns a task ID for subsequent queries, and completed results return image URLs.

Call gpt-image-2 through APISea’s OpenAI Images-compatible endpoint using your API key. Pricing is pay-as-you-go and billed by resolution tier, with billing only for successful requests. Default and 1K generation cost $0.00935 per image; 2K costs $0.0165 per image, and 4K costs $0.0242 per image. The default configuration is about 96% below the provider list price. The backward-compatible alias gpt-image-2-ext is interchangeable with gpt-image-2 and produces identical results.

המאפיינים הבולטים של gpt-image-2

Two Generation Modes

Generate images from a text prompt, or provide image_urls to switch to image-to-image generation.

Flexible Reference Inputs

Supply up to 15 reference images using public URLs, base64 data URIs, or a mix of both.

Aspect Ratio Controls

Choose from 15 supported aspect ratios through size, and select a 1k, 2k, or 4k output tier through resolution.

Optional Input Moderation

Enable nsfw_check to review prompts and input images with omni-moderation-latest before submitting the generation task.

איך לקרוא ל-API של gpt-image-2 ב-4 שלבים

  1. 01

    יצירת מפתח API

    יש להתחבר ל-APISea, להוסיף יתרה החל מ-$50 וליצור מפתח sk-sea במסוף.

  2. 02

    הגדרת כתובת הבסיס

    יש להשתמש ב-https://api.apisea.ai/v1 ככתובת הבסיס ב-SDK או בלקוח HTTP.

  3. 03

    שליחת הבקשה

    יש לקרוא ל-POST /v1/images/generations עם "model": "gpt-image-2" והפרמטרים שלהלן.

  4. 04

    טיפול בתגובה

    התגובה מכילה task_id. יש לשלוח בקשות GET אל /v1/tasks/{task_id} עד שהסטטוס יהיה completed, ואז להוריד את כתובות ה-URL של התוצאות.

# model can be "gpt-image-2", or the compatible alias "gpt-image-2-ext"
curl --request POST \
  --url https://api.apisea.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2",
    "prompt": "A ginger cat sitting on a windowsill watching the sunset, watercolor style",
    "n": 1,
    "size": "16:9",
    "resolution": "2k"
  }'

פרמטרים

פרמטרסוגנדרשברירת מחדלתיאור
modelstringנדרשgpt-image-2Image generation model name
nsfw_checkbooleanאופציונליfalseWhether to run content moderation before submitting the image task.
promptstringנדרש—Text description for image generation
nintegerאופציונלי1Number of images to generate
sizestringאופציונלי1:1Image aspect ratio
resolutionstringאופציונלי1kOutput resolution tier
image_urlsarrayאופציונלי—Reference image array (OpenAI standard field). Switches to image-to-image mode when provided.
official_fallbackbooleanאופציונליfalseWhether to fall back to the official channel

מה אפשר לבנות עם gpt-image-2

Campaign Visuals

Build a prompt-based workflow for generating campaign images in landscape, portrait, and square formats.

Reference-Based Creative

Let users upload reference images alongside a description to drive image-to-image generation.

In-App Image Creation

Add image generation to an application, storing the returned task ID and querying for the completed image URL.

Multi-Format Content

Create separate image requests for banners, vertical content, and square assets using the supported aspect ratios.

טיפים לקבלת תוצאות טובות יותר

  • 01

    Describe the Intended Image

    Use detailed English or Chinese prompts to describe the image you want, rather than relying on a short label.

  • 02

    Choose the Resolution Tier

    Set resolution explicitly to 1k, 2k, or 4k. Budget by tier: 1K costs $0.00935 per image, 2K costs $0.0165 per image, and 4K costs $0.0242 per image.

  • 03

    Track Asynchronous Tasks

    Save the task ID returned by the generation request and use subsequent queries to retrieve the result. Download the image from the returned URL if your application needs a local copy.

  • 04

    Set Reference Output Shape

    For image-to-image requests, provide size to force the output to a specified ratio. Without size, the documentation states that output resolution follows the input image resolution.

מגבלות ודברים שכדאי לדעת

  • Each generation request supports n set to the number 1 only.

  • Reference inputs are limited to 15 images, 20 MB per image, and 256 MB total.

  • response_format and style are ignored; completed task results return URLs only.

שאלות נפוצות על API של gpt-image-2

How much does gpt-image-2 cost on APISea?

Default and 1K pricing is $0.00935 per image, 2K is $0.0165 per image, and 4K is $0.0242 per image. The default configuration is about 96% below the provider list price, and APISea bills only successful requests.

How do I call the gpt-image-2 API?

Send a POST request to https://api.apisea.ai/v1/images/generations with Bearer Token authentication, model set to gpt-image-2, and a required prompt. The request returns a task ID for subsequent result queries.

Which image size and resolution parameters are supported?

Use size to select one of 15 supported aspect ratios, and resolution to choose 1k, 2k, or 4k. Actual pixel dimensions depend on both settings; 4k is a tier label, not a fixed dimension for every ratio.

Can gpt-image-2 accept reference images?

Yes. Supply image_urls to enable image-to-image mode, with up to 15 references using public URLs or base64 data URIs. Each image can be up to 20 MB, with a 256 MB total limit.

What is the difference between gpt-image-2 and gpt-image-2-ext?

gpt-image-2-ext is a backward-compatible alias for gpt-image-2. The documentation states that they are interchangeable and produce identical results.

Can I use gpt-image-2 images commercially?

Commercial use is subject to the provider's terms. Check the applicable OpenAI terms and any rights associated with your prompts and reference images before using outputs commercially.

מודלים קשורים

עומק: יותר מ-250 מודלים · טעינת יתרה מינימלית $50

מתחילים לבנות עם gpt-image-2

מפתח אחד, תשלום לפי שימוש החל מ-$50, וחיוב רק על בקשות שהצליחו.