IMPORTANT ASYNCHRONOUS TASK WORKFLOW
- Call this MCP generation tool once and read taskId from structuredContent.
- Do not call the generation tool again while the task is PENDING or RUNNING.
- Wait at least 5 seconds, then call nexscope_media_task_result with skillSlug set to ai-model-swap-api, the exact taskId, and the same bearer API key. While the task remains PENDING or RUNNING, use 5, 10, 20, and 30-second progressive backoff. Never query more often than once every 5 seconds.
- Stop querying when the task succeeds or fails. On success, return the final Nexscope resource URLs and the returned count as the actual charged credits.
- Never invent a taskId and never expose internal provider names or provider resource URLs.
Multimodal AI
AI Model Swap API MCP Tool
Generate model images by combining a source product image with a model head image, optional masks, scene references, and prompt guidance.
MCP tool name
nexscope_ai_model_swap_apiEquivalent REST API path
https://claw-callback.nexscope.ai/api/skill-api/v1/skills/ai-model-swap-api/runJSON-RPC method
tools/callAuthentication
Send the user API key as a bearer token on every MCP JSON-RPC request.
Authorization: Bearer nk_xxxxxxxxxxxxxxxxxIf authentication is missing or invalid, ask the user to open API Access and copy a valid key before calling this tool.
Call this MCP tool
Use tools/call with the MCP tool name below. The arguments object should match the table on this page.
{
"jsonrpc": "2.0",
"id": "ai-model-swap-api-1",
"method": "tools/call",
"params": {
"name": "nexscope_ai_model_swap_api",
"arguments": {
"imageUrl": "https://example.com/source-image.jpg",
"modelHeadImageUrl": "https://example.com/model-reference.jpg",
"imageSegUrl": "https://example.com/mask.png",
"sceneImgUrl": "https://example.com/scene.jpg",
"sceneStrength": 0.6,
"modelPrompt": "natural studio model",
"customPrompt": "clean ecommerce catalog photo",
"customNegPrompt": "blur, distorted hands",
"genOriRes": true,
"realModel": true,
"outputNum": 1
}
}
}REST API equivalent
POST https://claw-callback.nexscope.ai/api/skill-api/v1/skills/ai-model-swap-api/runCanonical detail URL
https://www.nexscope.ai/mcp-map/ai-model-swap-apiAsynchronous task workflow
This capability uses a create-and-query flow. Creating the task and retrieving its final generated resources are two connected requests.
- 1. Create onceCall the MCP tool once and keep the returned
taskId. - 2. Query with backoffCall
nexscope_media_task_resultwith this skill slug and task ID. Wait at least 5 seconds first; while pending or running, back off at 5, 10, 20, then 30-second intervals. - 3. Use final resultStop at a terminal status. Successful results contain Nexscope resource URLs and the actual charged-credit count.
MCP task result call
{
"jsonrpc": "2.0",
"id": "ai-model-swap-api-result-1",
"method": "tools/call",
"params": {
"name": "nexscope_media_task_result",
"arguments": {
"skillSlug": "ai-model-swap-api",
"taskId": "TASK_ID_FROM_THE_GENERATION_RESULT"
}
}
}REST fallback
GET https://claw-callback.nexscope.ai/api/skill-api/v1/skills/ai-model-swap-api/tasks/{taskId}Arguments
| Name | Type | Required | Meaning |
|---|---|---|---|
imageUrl | string | required | Public URL of the source product or outfit image. Example: https://example.com/source-image.jpg |
modelHeadImageUrl | string | required | Public URL of the target model head image. Example: https://example.com/model-reference.jpg |
imageSegUrl | string | optional | Optional segmentation mask URL for the source image. Example: https://example.com/mask.png |
sceneImgUrl | string | optional | Optional scene reference image URL. Example: https://example.com/scene.jpg |
sceneStrength | number | optional | Scene reference strength. Example: 0.6 |
modelPrompt | string | optional | Model appearance prompt. Example: natural studio model |
customPrompt | string | optional | Positive generation prompt. Example: clean ecommerce catalog photo |
customNegPrompt | string | optional | Negative prompt to avoid unwanted artifacts. Example: blur, distorted hands |
genOriRes | boolean | optional | Whether to generate the original resolution. Example: true |
realModel | boolean | optional | Whether to prefer a realistic model style. Example: true |
outputNum | integer | optional | Number of images to generate. Example: 1 |
Response fields
Treat structuredContent as the programmatic API response payload.
| Name | Type | Required | Meaning |
|---|---|---|---|
taskId | string | required | Nexscope asynchronous task id used to query the generation result. Example: 6b3f1c61-1b7d-4a59-8a7d-3b23e4b0c9e2 |
status | string | required | Task status. Initial run returns PENDING; the query endpoint may return PENDING, RUNNING, SUCCESS, FAILED, or TIMEOUT. Example: PENDING |
message | string | optional | User-facing task state message. Example: The task has been created. Use taskId to query the result. |
errcode | integer | optional | Upstream status code returned by the provider. Example: {} |
errmsg | string | optional | Upstream status message returned by the provider. Example: {} |
code | string | optional | Provider-specific status code. Example: {} |
msg | string | optional | Provider-specific status message. Example: {} |
type | string | optional | Provider-specific render or payload type. Example: {} |
title | string | optional | Provider-specific response title. Example: {} |
sourceType | string | optional | Provider-specific source platform type. Example: {} |
sourceTool | string | optional | Provider-specific source tool name. Example: {} |
costToken | integer | optional | Token cost reported by the upstream provider. Example: {} |
costTime | integer | optional | Execution time reported by the upstream provider. Example: {} |
page | integer | optional | Current page returned by the upstream provider. Example: {} |
pageSize | integer | optional | Page size returned by the upstream provider. Example: {} |
pageItemCount | integer | optional | Item count on the current page returned by the upstream provider. Example: {} |
totalPage | integer | optional | Total page count returned by the upstream provider. Example: {} |
dataSnapshotMonth | string | optional | Data snapshot month returned by the upstream provider. Example: {} |
Examples
Example arguments
{
"imageUrl": "https://example.com/source-image.jpg",
"modelHeadImageUrl": "https://example.com/model-reference.jpg",
"imageSegUrl": "https://example.com/mask.png",
"sceneImgUrl": "https://example.com/scene.jpg",
"sceneStrength": 0.6,
"modelPrompt": "natural studio model",
"customPrompt": "clean ecommerce catalog photo",
"customNegPrompt": "blur, distorted hands",
"genOriRes": true,
"realModel": true,
"outputNum": 1
}Example structuredContent
{
"taskId": "6b3f1c61-1b7d-4a59-8a7d-3b23e4b0c9e2",
"status": "PENDING",
"message": "The task has been created. Use taskId to query the result."
}