Endpoint
Copy
POST https://api.legnext.ai/api/v1/shorten
Headers
Header | Type | Required | Description |
---|---|---|---|
x-api-key | string | Yes | Your API key |
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
prompt | string | Yes | The prompt to analyze and shorten (1-8192 characters) |
callback | string | No | Callback URL for task completion notifications |
Example Request
Copy
curl -X POST "https://api.legnext.ai/api/v1/shorten" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cyberpunk hacker workspace filled with holographic screens, glowing code streams, mechanical keyboards, neon reflections, cables and circuit boards everywhere, volumetric lighting, ultra-detailed sci-fi aesthetic, cinematic atmosphere, inspired by Ghost in the Shell and Blade Runner, rendered in octane, 8k resolution --ar 21:9 --v 7 --style raw --q 2",
"callback": "https://webhook.site/your-webhook-id"
}'
Response
Returns a task object containing the task information.Copy
{
"job_id": "efb91be1-5d8d-43e4-9f0c-e2944730b2e2",
"model": "midjourney",
"task_type": "shorten",
"status": "completed",
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
"secret": ""
}
},
"input": null,
"output": {
"promptEn": "A cyberpunk hacker workspace filled with holographic screens, glowing code streams, mechanical keyboards, neon reflections, cables and circuit boards everywhere, volumetric lighting, ultra-detailed sci-fi aesthetic, cinematic atmosphere, inspired by Ghost in the Shell and Blade Runner, rendered in octane, 8k resolution --ar 21:9 --v 7 --style raw --q 2",
"description": "/shorten A cyberpunk hacker workspace filled with holographic screens, glowing code streams, mechanical keyboards, neon reflections, cables and circuit boards everywhere, volumetric lighting, ultra-detailed sci-fi aesthetic, cinematic atmosphere, inspired by Ghost in the Shell and Blade Runner, rendered in octane, 8k resolution --ar 21:9 --v 7 --style raw --q 2",
"finalPrompt": "## Important tokens\nA **cyberpunk** **hacker** **workspace** **filled** with **holographic** **screens**, glowing ~~code~~ streams, mechanical keyboards, **neon** ~~reflections~~, ~~cables~~ and circuit ~~boards~~ everywhere, volumetric ~~lighting~~, ~~ultra~~-detailed sci-fi aesthetic, ~~cinematic~~ ~~atmosphere~~, inspired by **Ghost in the Shell** and **Blade Runner**, rendered in ~~octane~~, **8k** resolution\n## Shortened prompts\n1️⃣ cyberpunk hacker workspace filled with holographic screens, mechanical keyboards, neon, detailed sci, aesthetic, inspired by Ghost in the Shell and Blade Runner, rendered, 8k\n\n2️⃣ cyberpunk hacker workspace filled with holographic screens, mechanical, neon, sci, inspired by Ghost in the Shell and Blade Runner, 8k\n\n3️⃣ cyberpunk hacker workspace filled with holographic screens, neon, Ghost in the Shell and Blade Runner, 8k\n\n4️⃣ cyberpunk hacker workspace, holographic, neon, Ghost in the Shell and Blade Runner\n\n5️⃣ cyberpunk, workspace, Ghost in the Shell and Blade Runner",
"prompts": [
"cyberpunk hacker workspace filled with holographic screens, mechanical keyboards, neon, detailed sci, aesthetic, inspired by Ghost in the Shell and Blade Runner, rendered, 8k",
"cyberpunk hacker workspace filled with holographic screens, mechanical, neon, sci, inspired by Ghost in the Shell and Blade Runner, 8k",
"cyberpunk hacker workspace filled with holographic screens, neon, Ghost in the Shell and Blade Runner, 8k",
"cyberpunk hacker workspace, holographic, neon, Ghost in the Shell and Blade Runner",
"cyberpunk, workspace, Ghost in the Shell and Blade Runner"
]
},
"meta": {
"created_at": "2025-10-09T18:47:11Z",
"started_at": "2025-10-09T18:47:12Z",
"ended_at": "2025-10-09T18:47:29Z",
"usage": {
"type": "point",
"frozen": 80,
"consume": 80
}
},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
}