Midjourney/MJ
Use rotas auxiliares de envio, busca, imagem e tarefa compatíveis com Midjourney quando configuradas.
POST /mj/submit/imagine
Envia uma tarefa de imagem Midjourney. O exemplo usa o exemplo de documentação do modelo mais recente selecionado mj_imagine e inclui todos os campos da solicitação Midjourney DTO.
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
Envia uma ação de aumento de escala ou variação em relação a uma tarefa MJ existente.
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 e rotas de envio relacionadas
As rotas de ação, encurtamento, modal, alteração simples, descrição, combinação, edição, vídeo e upload-discord-images compartilham o mesmo envelope de solicitação Midjourney e definem a ação do caminho ou corpo.
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"
}'
| Método | Rota | Estado |
|---|---|---|
| POST | /mj/submit/action | Planejado/implantação bloqueada |
| POST | /mj/submit/shorten | Planejado/implantação bloqueada |
| POST | /mj/submit/modal | Planejado/implantação bloqueada |
| POST | /mj/submit/change | Planejado/implantação bloqueada |
| POST | /mj/submit/simple-change | Planejado/implantação bloqueada |
| POST | /mj/submit/describe | Planejado/implantação bloqueada |
| POST | /mj/submit/blend | Planejado/implantação bloqueada |
| POST | /mj/submit/edits | Planejado/implantação bloqueada |
| POST | /mj/submit/video | Planejado/implantação bloqueada |
| POST | /mj/submit/upload-discord-images | Planejado/implantação bloqueada |
GET /mj/task/{id}/fetch
Busca uma tarefa MJ por ID de tarefa para o usuário atual da chave API.
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
-H "Authorization: Bearer $TOKEN168_API_KEY"
POST /mj/task/list-by-condition
Lista tarefas MJ por condição. Use-o para sondagem ou pesquisa no estilo de painel quando o acesso do provedor estiver configurado.
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 e GET /mj/image/{id}
As rotas auxiliares de propagação de imagem e de proxy de imagem estão disponíveis no grupo de rotas MJ. Eles usam parâmetros de caminho e a mesma autorização de chave API.
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
| Método | Rota | Estado |
|---|---|---|
| GET | /mj/task/{id}/image-seed | Planejado/implantação bloqueada |
| GET | /mj/image/{id} | Planejado/implantação bloqueada |
POST /mj/insight-face/swap
Envia uma solicitação auxiliar de troca InsightFace por meio do grupo de rotas MJ quando a implantação habilita esse recurso.
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"
}'