Skip to content

Midjourney Proxy

The Midjourney Proxy API submits MJ image jobs and polls them through the task retrieve endpoint. It currently supports text-to-image, variation, upscale, and reroll.

The retrieve endpoint returns generated image results. Read image URLs from images[].image_url.

Endpoints

CapabilityMethodPath
Text-to-imagePOST/mj/submit/imagine
Variation / Upscale / RerollPOST/mj/submit/change
Short action syntaxPOST/mj/submit/simple-change
Retrieve taskGET/mj/task/{id}/fetch

Text-to-Image

http
POST /mj/submit/imagine

Parameters

ParameterRequiredDescription
promptYesImage prompt

Example

bash
curl -X POST https://cubicspaces.cloud/mj/submit/imagine \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "prompt": "A simple red ceramic mug on a clean white studio background"
  }'

Response

json
{
  "code": 1,
  "description": "submit success",
  "result": "mj-task-id"
}

Save result and poll the retrieve endpoint.

Retrieve Task

http
GET /mj/task/{id}/fetch
bash
curl https://cubicspaces.cloud/mj/task/mj-task-id/fetch \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "extra": {
    "has_nsfw_contents": []
  },
  "task": {
    "task_id": "mj-task-id",
    "task_type": "MIDJOURNEY_TEXT_TO_IMAGE_FAST_MODE",
    "status": "TASK_STATUS_SUCCEED",
    "reason": "",
    "eta": 0,
    "progress_percent": 0
  },
  "images": [
    {
      "image_url": "https://example.com/generated-1.png",
      "image_url_ttl": "0",
      "image_type": "png",
      "nsfw_detection_result": null
    },
    {
      "image_url": "https://example.com/generated-2.png",
      "image_url_ttl": "0",
      "image_type": "png",
      "nsfw_detection_result": null
    }
  ],
  "videos": [],
  "audios": []
}

Statuses

StatusMeaning
TASK_STATUS_QUEUEDQueued
TASK_STATUS_PROCESSINGProcessing
TASK_STATUS_SUCCEEDCompleted; read images[].image_url
TASK_STATUS_FAILEDFailed; inspect task.reason

Poll every 5 seconds until the task succeeds or fails.

Variation

Variation creates a new image batch based on one image from the original task.

http
POST /mj/submit/change
ParameterRequiredDescription
taskIdYesOriginal task ID
actionYesUse VARIATION
indexYesImage index, from 1 to 4
bash
curl -X POST https://cubicspaces.cloud/mj/submit/change \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "taskId": "mj-task-id",
    "action": "VARIATION",
    "index": 1
  }'

Upscale

Upscale enhances one image from the original task.

http
POST /mj/submit/change
ParameterRequiredDescription
taskIdYesOriginal task ID
actionYesUse UPSCALE
indexYesImage index, from 1 to 4
bash
curl -X POST https://cubicspaces.cloud/mj/submit/change \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "taskId": "mj-task-id",
    "action": "UPSCALE",
    "index": 1
  }'

Reroll

Reroll regenerates a new batch from the original task.

http
POST /mj/submit/change
ParameterRequiredDescription
taskIdYesOriginal task ID
actionYesUse REROLL
bash
curl -X POST https://cubicspaces.cloud/mj/submit/change \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "taskId": "mj-task-id",
    "action": "REROLL"
  }'

Short Action Syntax

You can also call /mj/submit/simple-change with a compact command:

bash
curl -X POST https://cubicspaces.cloud/mj/submit/simple-change \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "content": "mj-task-id U1"
  }'

Common commands:

CommandEquivalent action
mj-task-id U1Upscale image 1
mj-task-id V1Vary image 1
mj-task-id RReroll

Notes

  • index uses the MJ-style range from 1 to 4.
  • Action endpoints return a new task ID; poll /mj/task/{id}/fetch for the result.
  • Variation, upscale, and reroll must reference an original task accessible to the same account.
  • The API currently supports mj_imagine, mj_variation, mj_upscale, and mj_reroll.