Nexscope

GPT Image 2 Generation

Generate ecommerce images with the GPT Image 2 model and optional quality control. Call it via REST API or MCP, or try it in the online playground.

CostEst. 70–84 credits / call
Try online
POST · https://api.nexscope.ai/image/gptImage2GenerationMCP · nexscope_gpt_image_2_generation
Subscription required. Creative AI APIs are available only to users with an active subscription. Trial credits do not enable API key access. View subscription plans.

What this API does

Generate ecommerce images with the GPT Image 2 model and optional quality control. The request accepts imageUrls, prompt, outputNum, resolution, aspectRatio. Generation runs as a task: retain the task ID and retrieve the completed result before using the output.

GPT Image 2 Generation API use cases

Create a product hero image

To create a product hero image, a content editor submits imageUrls and prompt to GPT Image 2 Generation. The returned completed generation results help select a composition for the product hero placement.

Explore campaign image concepts

A content editor uses GPT Image 2 Generation with imageUrls and prompt to explore campaign image concepts. The returned completed generation results help compare concepts against the campaign creative brief.

Adapt reference images for a listing

For this workflow, a content editor calls GPT Image 2 Generation with imageUrls and prompt to adapt reference images for a listing. The result helps check reference product consistency in the generated image.

GPT Image 2 Generation API FAQ

What does the GPT Image 2 Generation API return?

Generate ecommerce images with the GPT Image 2 model and optional quality control. It corresponds to the supplied imageUrls, prompt, outputNum, resolution, aspectRatio. The initial response can contain a task ID and status; the completed task result contains the generated output. Example values illustrate the response shape, rather than live account results.

How many credits does the GPT Image 2 Generation API cost?

The current documented cost is Est. 70–84 credits / call. This is the same cost shown at the top of this page. If a range or estimate is displayed, the final charge depends on the request. Review your available credits and the pricing page before calling the API, and check API usage records for the actual charge.

How do I call the GPT Image 2 Generation API from my app or an MCP client?

Send a POST request to https://api.nexscope.ai/image/gptImage2Generation with your API key as a Bearer token and the JSON inputs shown in API integration. In a compatible MCP client such as Claude or Cursor, connect Nexscope and call nexscope_gpt_image_2_generation. Use the MCP arguments shown in the MCP guide, or switch Online test to MCP to review its request before adding it to your app.

View plans and creditsConnect this API with MCP

Try this API
Endpoint
https://api.nexscope.ai/image/gptImage2Generation
MCP method
nexscope_gpt_image_2_generation

Step 1 of 3 · Authenticate

Authentication

All run endpoints require a user API key. Send it as a bearer token in the Authorization header.

Authorization: Bearer nk-xxxxxxxxxxxxxxxxx
Missing or invalid API keys return an authentication error. Manage keys from .

Step 2 of 3 · Send a request

POSThttps://api.nexscope.ai/image/gptImage2Generation

Run an API

Generate ecommerce images with the GPT Image 2 model and optional quality control.

Example request

Replace YOUR_API_KEY, then run this command in your terminal.

curl -X POST 'https://api.nexscope.ai/image/gptImage2Generation' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "aspectRatio": "1:1",
  "imageUrls": [],
  "outputNum": 1,
  "prompt": "Keep the product consistent and generate a clean white-background ecommerce hero image.",
  "quality": "medium",
  "resolution": "1K"
}'

Code example

{
  "aspectRatio": "1:1",
  "imageUrls": [],
  "outputNum": 1,
  "prompt": "Keep the product consistent and generate a clean white-background ecommerce hero image.",
  "quality": "medium",
  "resolution": "1K"
}

Step 3 of 3 · Inspect the result

Check the response

Read code for the request status and data for the result. Open the parameter and response reference for the full field definitions.

HTTP status codes

CodeDescription
200Default HTTP response for both success and many business errors. Only outer JSON code 0 indicates success or asynchronous acceptance; inspect data for the result.
429Execution admission rate limit; honor Retry-After when present.
503Execution admission is temporarily unavailable; honor Retry-After when present.
Opt-inX-Nexscope-Http-Status: semantic maps controller-handled business errors to HTTP status on run and task routes. Pre-authentication failures, such as a missing API key (code 11209), may still return HTTP 200 before this mapping. Always check the outer JSON code; malformed requests and infrastructure failures may also return non-200 HTTP responses.
All categories/ Image Generation Models
POSThttps://api.nexscope.ai/image/gptImage2Generation

Run this API

Send a JSON request to execute this API and receive the documented response payload.

Endpoint

MethodPOST
Pathhttps://api.nexscope.ai/image/gptImage2Generation
AuthBearer API key
Content-Typeapplication/json

Request parameters

NameTypeRequiredDescription
imageUrlsarrayoptional
Optional public reference image URLs. Omit this field for text-to-image generation, or provide references for image-to-image generation. When supplied, provide 1 to 10 JPG, PNG, or WEBP images; each image must not exceed 20 MB.
Example: []
promptstringrequired
Generation prompt describing the target image, scene, composition, style, and constraints. Maximum 5000 characters.
Example: Keep the product consistent and generate a clean white-background ecommerce hero image.
outputNumintegeroptional
Number of images to generate. Valid range: 1 to 10; defaults to 1.
Example: 1
resolutionstringoptional
Output resolution.
Available options
  • 1K
  • 2K
  • 4K; defaults to 1K
Example: 1K
aspectRatiostringoptional
Output aspect ratio.
Available options
  • 1:1
  • 16:9
  • 9:16
  • 3:4
  • 4:3
  • 3:2
  • 2:3
  • 4:5
  • 5:4
  • 21:9
  • 9:21
Example: 1:1
qualitystringoptional
GPT Image quality. Defaults to medium.
Available options
  • low
  • medium
  • high
Example: medium

Response example

Platform response envelope. code 0 indicates success or acceptance; data contains the business result.

{
  "code": 0,
  "cost": "-1",
  "data": {
    "result": null,
    "status": "PENDING",
    "taskId": "example-task"
  },
  "msg": null,
  "time": "2026-01-01 00:00:00",
  "traceId": null,
  "ts": "0"
}

Response fields

NameTypeRequiredDescription
codeintegerrequired
0 means accepted or successful; nonzero is a platform error.
coststringrequired
Elapsed milliseconds, never credits; -1 outside web requests.
dataanyrequired
Data value used by this API operation.
msgstring | nullrequired
Msg value used by this API operation.
timestringrequired
Server local time: yyyy-MM-dd HH:mm:ss.
traceIdstring | nullrequired
Trace id value used by this API operation.
tsstringrequired
Epoch milliseconds.

Any of option 1 — requires taskId, status, result

NameTypeRequiredDescription
dataobjectrequired
Data value used by this API operation.
data.resultanyrequired
Result value used by this API operation.
data.statusstringrequired
Status value used by this API operation.
Allowed: PENDING, RUNNING, SUCCEEDED, FAILED, TIMEOUT
data.taskIdstringrequired
Task id value used by this API operation.

Any of option 1

NameTypeRequiredDescription
data.resultobjectrequired
Completed generation output retained from the task result. Fields vary by capability; generated resources use Nexscope-hosted URLs and any count represents charged Nexscope credits. This is the business output, not a task creation receipt.

Any of option 2

NameTypeRequiredDescription
data.resultnullrequired
Result value used by this API operation.

Any of option 2

NameTypeRequiredDescription
datanullrequired
Data value used by this API operation.

Responses

CodeDescription
200Default HTTP response for both success and many business errors. Only outer JSON code 0 indicates success or asynchronous acceptance; inspect data for the result.
429Execution admission rate limit; honor Retry-After when present.
503Execution admission is temporarily unavailable; honor Retry-After when present.
Opt-inX-Nexscope-Http-Status: semantic maps controller-handled business errors to HTTP status on run and task routes. Pre-authentication failures, such as a missing API key (code 11209), may still return HTTP 200 before this mapping. Always check the outer JSON code; malformed requests and infrastructure failures may also return non-200 HTTP responses.

Step 1 of 2 · Connect your MCP client

MCP

V2 recommended

Connect remote agents through the standard MCP 2025-11-25 Streamable HTTP endpoint. Use OAuth 2.1 Authorization Code with PKCE, or an API key for compatibility.

POST https://api.nexscope.ai/mcp
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
Authentication

OAuth clients request the mcp:tools scope. The endpoint's 401 response advertises protected-resource metadata for authorization discovery.

Step 2 of 2 · Call the tool

Call a tool

{
  "jsonrpc": "2.0",
  "id": "tool-call-1",
  "method": "tools/call",
  "params": {
    "name": "nexscope_gpt_image_2_generation",
    "arguments": {
      "aspectRatio": "1:1",
      "imageUrls": [],
      "outputNum": 1,
      "prompt": "Keep the product consistent and generate a clean white-background ecommerce hero image.",
      "quality": "medium",
      "resolution": "1K"
    }
  }
}

Legacy MCP v1

Existing API-key clients can continue using the compatibility endpoint. New integrations should use MCP v2.

GET / POST /mcp/legacy

What can you do with this API?

Data explained and practical use cases

AI Guide

Question

What can GPT Image 2 Generation produce, and how might I use the result?

AI answer

GPT Image 2 Generation starts an image task from a prompt, optionally using reference images. You can request the number, size or resolution, aspect ratio, and supported quality level. The documented immediate response is a pending task, not an image; the completed media fields and delivery format are not documented in the supplied record.

Data categoryDocumented fieldsWhat the values mean
Generation taskdata.taskIdIdentifier shown for the submitted image task.
Task statedata.statusPENDING in the example, so generation is still underway.
Output availabilitydata.resultnull in the example; no image is available in that response.
  • Generate a product lifestyle scene from a prompt and review the completed image for a product page.
    • Prompt example: “I am preparing product creative for an online listing. Could you generate a product lifestyle scene from a prompt and review the completed image for a product page? Show the relevant returned evidence and tell me what input you need from me.”
  • Use a reference image to request a different presentation of the same product.
    • Prompt example: “I am preparing product creative for an online listing. Could you use a reference image to request a different presentation of the same product? Show the relevant returned evidence and tell me what input you need from me.”
  • Ask for multiple image candidates and choose a completed result for an advertisement.
    • Prompt example: “I am preparing product creative for an online listing. Could you ask for multiple image candidates and choose a completed result for an advertisement? Show the relevant returned evidence and tell me what input you need from me.”
  • Select a portrait aspect ratio for a mobile creative and check the finished image before use.
    • Prompt example: “I am preparing product creative for an online listing. Could you select a portrait aspect ratio for a mobile creative and check the finished image before use? Show the relevant returned evidence and tell me what input you need from me.”

Online test

Execute the current API with your API key and JSON payload. Online tests use this site's configured API environment; the Endpoint and copyable examples use the public integration address.

Create an image

0/5,000
Reference imagesOptional

JPG, PNG, WEBP · Up to 10 images · 20 MB each

0/10

Image settings

Up to 10
Resolution
Aspect ratio
Quality

GPT Image quality. Supported values: low, medium, high. Defaults to medium.

API keys require an active subscription. Trial credits don't include API access. View plans.

Usage estimate unavailable

Final credits are shown with your result.

Preview

Your image will appear here

Recent generations

Saved in this browser for 24 hours

Your generations will appear here.

Test with an API key or MCP

Try it

Send a real request with the same contract shown in the reference.

Endpoint
/image/gptImage2Generation
Task result endpoint
/image/gptImage2Generation/tasks/{taskId}
MCP method
nexscope_gpt_image_2_generation
cURL
curl -X POST \
  https://api.nexscope.ai/image/gptImage2Generation \
  -H "Authorization: Bearer nk-..." \
  -H "Content-Type: application/json" \
  -d '{ "aspectRatio": "1:1", "imageUrls": [], "outputNum": 1, "prompt": "Keep the product consistent and generate a clean white-background ecommerce hero image.", "quality": "medium", "resolution": "1K" }'
Response
No response yet. Run the request to see the response here.
Task result

Results are checked automatically after Run request. You can also enter a task ID and check it manually; completed resources use Nexscope URLs and show actual charged credits.

Result response
No task result yet. Query the task to see the generated output here.

Related APIs