ClickCease

Slash Commands

API Endpoint: https://api.thenextleg.io/api

Slash Commands reflect the slash commands that can be sent in Midjourney.

Request

cmd

The current slash commands we support are:
  • imagine - Imagine
  • relax - Do not consume fast hours (standard/pro tier only)
  • fast - Consume fast hours (standard/pro tier only)
  • private - Set stealth mode (pro tier only)
  • stealth - Set stealth mode (pro tier only)

msg

Your prompt. This can include an image URL as well. You can also include flags such as the --v 5 parameter

img2img Requests

In order to perform img2img requests, you can follow the following syntax in your imagine prompt:"cmd":"<your-image-url> <your-prompt>"

Full Example:
"cmd":"https://cdn.midjourney.com/ab739450-7a9a-4c91-857e-60892adf60e7/0_1.webp Transformational anime"

ref (optional)

You can optionally pass ref in your command, that will be returned in the webhook response.

webhookOverride (optional)

You can optionally pass webhookOverride that will route your request to a different webhook.

Please note that if this is not configured correctly, you will not receive any response. If an image creation cannot be mapped back to it's original request, the webhook body will be routed to the default webhook.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 var axios = require('axios'); var data = JSON.stringify({ "cmd": "imagine", "msg": "<your-prompt-here>", "ref": "", "webhookOverride": "" }); var config = { method: 'post', url: 'https://api.thenextleg.io/api', headers: { 'Authorization': 'Bearer <your-token>', 'Content-Type': 'application/json' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });

HTTP Response

Your response will return an initial messageId. The main purpose is to let you know your message has been received.

The response to the actual request (imagine or other) will be returned in your Webhook URL.

πŸ“˜This is not an actual response to your original request. Your webhook URL will receive a message with a response to the original prompt.
0 1 2 3 4 { "success": true, "messageId": "your-message-id", "createdAt": "2023-04-04T13:07:01.927Z" }

Webhook URL Response

Your webhook URL will receive a response with the following:

  • buttons - Which can be used in your next request invoke. If your slash command has produced an output that produces buttons/interactions, they will appear here
  • buttonRequestId - Which can be used in a Button Command in conjunction with a button
  • imageUrl - The URL for your image
  • originatingMessageId - The request ID from your original request
  • content - A string containing a response from the Midjourney bot

🚧 Note: You should be aware that content will also return messages from Midjourney including:

  • Banned Prompt - You can't use this prompt
  • You've run out of fast hours... - Your tier doesn't have any fast GPU time
  • Job queued- You've made too many concurrent requests
  • Your current membership plan doesn't include Private mode!
  • Internal Server Error- Some Midjourney error
  • Invalid Parameter- An invalid flag command
  • You've ran out of fast hours
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "createdAt": { "_nanoseconds": 215000000, "_seconds": 1678840347 }, "buttons": [ "U1", "U2", "U3", "U4", "πŸ”„", "V1", "V2", "V3", "V4" ], "imageUrl": "your-image-url", "buttonMessageId": "OtfxNzfMIKBPVE1aP4u4", "originatingMessageId": "your-message-id", "content": "your-original-prompt", "ref": "", "responseAt": "2023-04-04T13:06:01.927Z" }
Multi - dimensional paper kirigami craft, paper illustration, Chinese illustration on white background, Night, starry sky, Milky Way, above super wide agle, Thomas Kinkade, dreamy, 4K, romantic, trending on Artstation colorful vanilla oil, 3d relief
Multi - dimensional paper kirigami craft, paper illustration, Chinese illustration on white background, Night, starry sky, Milky Way, above super wide agle, Thomas Kinkade, dreamy, 4K, romantic, trending on Artstation colorful vanilla oil, 3d relief