Nexscope

Smart Image Outpainting

Generate an expanded image around the original content using target width, height, and optional prompt. Available via REST API or MCP.

CostEst. 47–57 credits / call
Try online
POST · https://api.nexscope.ai/ai/smartImageOutpaintingMCP · nexscope_smart_image_outpainting
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.
Multimodal AI

What this API does

Generate an expanded image around the original content using target width, height, and optional prompt. The request accepts imageUrl, width, height, prompt, outputNum. Generation runs as a task: retain the task ID and retrieve the completed result before using the output.

Smart Image Outpainting API use cases

Prepare listing image assets

To prepare listing image assets, a content editor submits imageUrl and width to Smart Image Outpainting. The returned completed generation results help prepare product visuals for a listing review.

Compare a product visual treatment

A content editor uses Smart Image Outpainting with imageUrl and width to compare a product visual treatment. The returned completed generation results help compare the edited treatment with the source asset.

Review edited assets for a campaign

For this workflow, a content editor calls Smart Image Outpainting with imageUrl and width to review edited assets for a campaign. The result helps select an approved asset for the campaign.

Smart Image Outpainting API FAQ

What does the Smart Image Outpainting API return?

Generate an expanded image around the original content using target width, height, and optional prompt. It corresponds to the supplied imageUrl, width, height, prompt, outputNum. 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 Smart Image Outpainting API cost?

The current documented cost is Est. 47–57 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 Smart Image Outpainting API from my app or an MCP client?

Send a POST request to https://api.nexscope.ai/ai/smartImageOutpainting 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_smart_image_outpainting. 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/ai/smartImageOutpainting
MCP method
nexscope_smart_image_outpainting

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/ai/smartImageOutpainting

Run an API

Generate an expanded image around the original content using target width, height, and optional prompt.

Example request

Replace YOUR_API_KEY, then run this command in your terminal.

curl -X POST 'https://api.nexscope.ai/ai/smartImageOutpainting' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "height": 900,
  "imageUrl": "https://example.com/product.jpg",
  "outputNum": 1,
  "prompt": "extend the clean studio background",
  "width": 1200
}'

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
200HTTP request completed. Check JSON code; only 0 indicates business success or acceptance.
400Request JSON or required API parameters are invalid.
401API key is missing, invalid, or cannot be matched to a user.
5xxAPI execution or upstream service failed.
All categories/ Multimodal AI
POSThttps://api.nexscope.ai/ai/smartImageOutpainting

Run this API

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

Endpoint

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

Request parameters

NameTypeRequiredDescription
imageUrlstringrequired
Public URL of the image to expand. The image must be between 300 and 4096 pixels in both width and height, and its width-to-height ratio must be between 0.4 and 2.5.
Example: https://example.com/product.jpg
widthintegerrequired
Target output width in pixels.
Example: 1200
heightintegerrequired
Target output height in pixels.
Example: 900
promptstringoptional
Optional prompt describing the extended scene.
Example: extend the clean studio background
outputNumintegeroptional
Number of images to generate, from 1 to 4. Defaults to 1.
Example: 1

Code example

{
  "height": 900,
  "imageUrl": "https://example.com/product.jpg",
  "outputNum": 1,
  "prompt": "extend the clean studio background",
  "width": 1200
}

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.
data.usageobjectoptional
Actual credits charged for a completed successful task; omitted when unavailable.
data.usage.chargedCreditsintegerrequired
Charged credits value used by this API operation.
Minimum: 0

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
200HTTP request completed. Check JSON code; only 0 indicates business success or acceptance.
400Request JSON or required API parameters are invalid.
401API key is missing, invalid, or cannot be matched to a user.
5xxAPI execution or upstream service failed.

Data source, freshness, and limitations

Source, freshness, coverage, rate limits, and estimation notes are not specified in this API definition unless they appear in the request or response field documentation above. Do not assume official marketplace data or real-time freshness when it is not explicitly documented.

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_smart_image_outpainting",
    "arguments": {
      "height": 900,
      "imageUrl": "https://example.com/product.jpg",
      "outputNum": 1,
      "prompt": "extend the clean studio background",
      "width": 1200
    }
  }
}

Legacy MCP v1

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

GET / POST /mcp/legacy

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 characters
Source image*Required

Public URL of the image to expand. The image must be between 300 and 4096 pixels in both width and height, and its width-to-height ratio must be between 0.4 and 2.5.

JPG, PNG, WEBP · 1 image · 20 MB · 300–4096 px per side · width/height ≥ 0.4 · width/height ≤ 2.5

0/1

Image settings

Target output width in pixels.

Target output height in pixels.

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
/ai/smartImageOutpainting
Task result endpoint
/ai/smartImageOutpainting/tasks/{taskId}
MCP method
nexscope_smart_image_outpainting
cURL
curl -X POST \
  https://api.nexscope.ai/ai/smartImageOutpainting \
  -H "Authorization: Bearer nk-..." \
  -H "Content-Type: application/json" \
  -d '{ "height": 900, "imageUrl": "", "outputNum": 1, "prompt": "extend the clean studio background", "width": 1200 }'
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