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>"
}
'
{
  "code": 400,
  "message": "Invalid request parameters",
  "raw_message": "Invalid request parameters",
  "detail": null
}

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": "pending",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "image_url": "",
        "image_urls": null,
        "seed": ""
    },
    "meta": {
        "created_at": "",
        "started_at": "",
        "ended_at": "",
        "usage": {
            "type": "point",
            "frozen": 120,
            "consume": 0
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}
This is the initial success response. Use the job_id to check the task status via the Get Task endpoint to retrieve the completed result with image URLs.

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

Retexture task created successfully