Midjourney / MJ API
計画中
設定されている場合、Midjourney 互換の送信、取得、画像、タスク補助ルートを使用します。
POST /mj/submit/imagine
Midjourney の imagine タスクを送信します。例では、選択された最新モデルのドキュメント例 mj_imagine を使用し、Midjourney リクエスト DTO の全フィールドを含めています。
MJ imagine 生成
curl https://www.token168.cc/mj/submit/imagine \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "A clean product render --v 8 --ar 16:9",
"customId": "",
"botType": "MID_JOURNEY",
"notifyHook": "",
"action": "IMAGINE",
"index": 1,
"state": "client-trace-123",
"taskId": "",
"base64Array": [],
"content": "",
"maskBase64": ""
}'
POST /mj/submit/change
既存の MJ タスクに対してアップスケールまたはバリエーション操作を送信します。
MJ 変更
curl https://www.token168.cc/mj/submit/change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "UPSCALE",
"index": 1,
"customId": "MJ::JOB::upsample::1",
"state": "client-trace-123",
"content": ""
}'
POST /mj/submit/action と関連する送信ルート
Action、shorten、modal、simple-change、describe、blend、edits、video、upload-discord-images の各ルートは同じ Midjourney リクエスト形式を共有し、パスまたはボディから action を設定します。
MJ 送信ルートの例
curl https://www.token168.cc/mj/submit/action \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "VARIATION",
"index": 1,
"customId": "MJ::JOB::variation::1",
"state": "client-trace-123",
"content": ""
}'
curl https://www.token168.cc/mj/submit/shorten \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "A long Midjourney prompt to shorten --v 8",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/modal \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"customId": "MJ::JOB::modal",
"prompt": "Adjust the modal prompt",
"maskBase64": "",
"state": "client-trace-123"
}'
curl https://www.token168.cc/mj/submit/simple-change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "UPSCALE",
"index": 2,
"state": "client-trace-123"
}'
curl https://www.token168.cc/mj/submit/describe \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,..."],
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/blend \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,...", "data:image/png;base64,..."],
"dimensions": "SQUARE",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/edits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "Replace the background with a clean studio wall",
"taskId": "mj_task_123",
"maskBase64": "data:image/png;base64,...",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"prompt": "Animate this frame with a slow camera move",
"image": "https://example.com/frame.png",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/upload-discord-images \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,..."],
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
| メソッド | パス | ステータス |
|---|---|---|
| POST | /mj/submit/action | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/shorten | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/modal | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/change | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/simple-change | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/describe | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/blend | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/edits | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/video | 計画中 / デプロイ設定による制限 |
| POST | /mj/submit/upload-discord-images | 計画中 / デプロイ設定による制限 |
GET /mj/task/{id}/fetch
現在の API Key ユーザーについて、タスク ID で 1 件の MJ タスクを取得します。
MJ 取得
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
-H "Authorization: Bearer $TOKEN168_API_KEY"
POST /mj/task/list-by-condition
条件に基づいて MJ タスクを一覧表示します。プロバイダーへのアクセスが設定されている場合、ダッシュボード形式のポーリングや検索に使用できます。
条件別 MJ 一覧
curl https://www.token168.cc/mj/task/list-by-condition \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"mj_id": "mj_task_123",
"action": "IMAGINE",
"status": "SUCCESS"
}'
GET /mj/task/{id}/image-seed と GET /mj/image/{id}
MJ ルートグループでは、画像 seed と画像プロキシの補助ルートを利用できます。パスパラメーターと同じ API Key 認証を使用します。
MJ 画像ヘルパー
curl https://www.token168.cc/mj/task/mj_task_123/image-seed \
-H "Authorization: Bearer $TOKEN168_API_KEY"
curl https://www.token168.cc/mj/image/image_123 \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
--output mj-image.png
| メソッド | パス | ステータス |
|---|---|---|
| GET | /mj/task/{id}/image-seed | 計画中 / デプロイ設定による制限 |
| GET | /mj/image/{id} | 計画中 / デプロイ設定による制限 |
POST /mj/insight-face/swap
デプロイでこの機能が有効な場合、MJ ルートグループを通じて InsightFace の顔交換補助リクエストを送信します。
MJ InsightFace 顔交換
curl https://www.token168.cc/mj/insight-face/swap \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,...",
"state": "client-trace-123"
}'