Skip to main content
POST
/
v1
/
retexture
Retexture
curl --request POST \
  --url https://api.legnext.ai/api/v1/retexture \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "imgUrl": "<string>",
  "remixPrompt": "<string>",
  "callback": "<string>"
}
'
Transform the textures and materials of any image using AI-powered style transfer and material transformation.

Endpoint

POST https://api.legnext.ai/api/v1/retexture

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

ParameterTypeRequiredDescription
imgUrlstringYesURL of the source image (max length: 1024 characters)
remixPromptstringYesText description of desired texture/material transformation
callbackstringNoCallback URL for task completion notifications

Example Requests

Material Transformation

curl -X POST "https://api.legnext.ai/api/v1/retexture" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "imgUrl": "https://example.com/image.jpg",
    "remixPrompt": "Convert to oil painting style",
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "d8f6a791-4d2f-4ec4-9df2-f0abb7775143",
    "model": "midjourney",
    "task_type": "retexture",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "image_url": "https://cdn.legnext.ai/mj/d8f6a791-4d2f-4ec4-9df2-f0abb7775143_grid.png",
        "image_urls": [
            "https://cdn.legnext.ai/temp/1760683424871.png",
            "https://cdn.legnext.ai/temp/1760683424788.png",
            "https://cdn.legnext.ai/temp/1760683424773.png",
            "https://cdn.legnext.ai/temp/1760683425936.png"
        ],
        "seed": "879124166",
        "available_actions": {
            "edit": [
                0,
                1,
                2,
                3
            ],
            "inpaint": [
                0,
                1,
                2,
                3
            ],
            "outpaint": [
                0,
                1,
                2,
                3
            ],
            "pan": [
                0,
                1,
                2,
                3
            ],
            "remix": [
                0,
                1,
                2,
                3
            ],
            "reroll": true,
            "upscale": [
                0,
                1,
                2,
                3
            ],
            "variation": [
                0,
                1,
                2,
                3
            ]
        }
    },
    "meta": {
        "created_at": "2025-10-17T06:43:25Z",
        "started_at": "2025-10-17T06:43:26Z",
        "ended_at": "2025-10-17T06:43:52Z",
        "usage": {
            "type": "point",
            "frozen": 120,
            "consume": 120
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}

Supported Formats

  • Image URL: HTTPS URLs pointing to image files (max length: 1024 characters)
  • Supported Types: JPG, PNG, WebP
  • Max File Size: 10MB

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
imgUrl
string<uri>
required

URL of the source image

Maximum string length: 1024
remixPrompt
string
required

Text description of desired texture/material transformation

Required string length: 1 - 8192
callback
string<uri>

Callback URL for task completion notifications

Response

200

Retexture task created successfully