Skip to content

Image Generation Task: Text-to-Image / Text+Image-to-Image (Imagine)

Overview

  • API: POST /mj/submit/imagine
  • Description: Generate a single image with four style variations at once (for subsequent upscale, local repaint, etc.).
  • Content-Type: application/json

Authentication

  • Use HTTP Bearer Token, Example: Authorization: Bearer sk-xxxxx

Request Parameters

ParameterTypeRequiredDescription
notifyHookstringNoCallback URL; if empty, uses global notifyHook
statestringNoCustom parameter passed through callback or task status
base64Arrayarray[string]NoBase64 image array for reference images
promptstringYesDrawing prompt, supports extra parameters such as --s 50 --v 7 --ar 3:4
botTypestringNoBot type, MID_JOURNEY (default) or NIJI_JOURNEY

Default field order: botType, prompt, base64Array, notifyHook, state.


Request Example

json
{
  "botType": "MID_JOURNEY",
  "prompt": "A beach scene with sunshine, kites, a long-haired girl, and a sweet smile",
  "base64Array": [],
  "notifyHook": "",
  "state": ""
}

curl

bash
curl -X POST "https://api.gpt.ge/mj/submit/imagine" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxx" \
  -d '{"botType":"MID_JOURNEY","prompt":"A beach, sunshine, kite, long-haired girl, sweet smile","base64Array":[],"notifyHook":"","state":""}'

JavaScript (fetch)

javascript
fetch('https://api.gpt.ge/mj/submit/imagine', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-xxxx' },
  body: JSON.stringify({ botType: 'MID_JOURNEY', prompt: 'A beach, sunshine, kite, long-haired girl, sweet smile', base64Array: [], notifyHook: '', state: '' })
}).then(r => r.json()).then(console.log)

Python (requests)

python
import requests

payload = {
  'botType': 'MID_JOURNEY',
  'prompt': 'A beach scene with sunshine, kites, a long-haired girl, and a sweet smile',
  'base64Array': [],
  'notifyHook': '',
  'state': ''
}

resp = requests.post('https://api.gpt.ge/mj/submit/imagine', headers={'Content-Type':'application/json','Authorization':'Bearer sk-xxxx'}, json=payload)
print(resp.json())

Response Example (200)

json
{
  "code": 1,
  "description": "Submit success",
  "result": "1725017986212425",
  "properties": {
    "discordChannelId": "1278917486263402612",
    "discordInstanceId": "1550466896007176192"
  }
}