Server402 marketplace

Paid API service

Refine Mask Image Segmentation

Use this visual AI API when the task needs refining a cutout mask using the original image and mask. Send the schema keys exactly as listed (ImageURL, MaskImageURL); required parameters: ImageURL, MaskImageURL.

Invocation

Service ID
mask-refinement
Method
POST
Endpoint
/api/tools/mask-refinement
Legacy Endpoint
/api/tools/aliyun-imageseg-refine-mask
MCP Tool
mask_refinement
Price
USD 0.20

Payment

Call the endpoint without payment to receive HTTP 402 metadata. After payment is complete, retry with X-Payment-Token, an x402 payment signature, or MCP paymentToken.

Create a payment with POST /api/payments using serviceId="mask-refinement", then pass the returned token in X-Payment-Token or MCP paymentToken.

Schema And Examples

{
  "exampleRequest": {
    "ImageURL": "https://example.com/image.jpg",
    "MaskImageURL": "https://example.com/mask-or-replacement.jpg"
  },
  "exampleResponse": {
    "code": "200",
    "content": "",
    "data": {
      "Action": "RefineMask",
      "Result": "example result from Alibaba Cloud imageseg"
    },
    "message": "success",
    "requestId": "example-request-id"
  },
  "inputSchema": {
    "description": "Use Alibaba Cloud RPC parameter names exactly, for example ImageURL, ImageUrl, Url, URL, JobId, or Tasks depending on the service.",
    "properties": {
      "ImageURL": {
        "description": "Public http or https image URL accepted by the Alibaba Cloud API.",
        "format": "uri",
        "type": "string"
      },
      "MaskImageURL": {
        "description": "Public http or https auxiliary image URL accepted by the Alibaba Cloud API.",
        "format": "uri",
        "type": "string"
      }
    },
    "required": [
      "ImageURL",
      "MaskImageURL"
    ],
    "type": "object"
  },
  "outputSchema": {
    "properties": {
      "code": {
        "type": "string"
      },
      "content": {
        "type": "string"
      },
      "data": {
        "type": "object"
      },
      "message": {
        "type": "string"
      },
      "requestId": {
        "type": "string"
      }
    },
    "required": [
      "requestId",
      "data"
    ],
    "type": "object"
  }
}