Skip to main content
POST
cURL
Use este endpoint para iniciar o fluxo principal do Midjourney. Cada etapa posterior, incluindo upscale, variation e custom zoom, começa com uma tarefa imagine bem-sucedida.

O que a primeira resposta fornece

  • result é o id da tarefa que você consultará em seguida
  • code ainda pode ser um código de sucesso mesmo quando não for no estilo HTTP 200

Fluxo principal

1

Enviar a tarefa imagine

Envie o prompt e armazene o id da tarefa retornado.
2

Consultar até a tarefa terminar

Use Fetch Single Task até a tarefa atingir SUCCESS, MODAL ou FAILURE.
3

Continuar com o pós-processamento

Quando os botões aparecerem, use Action para upscale, variation, reroll, zoom e operações de acompanhamento semelhantes.

Padrão opcional de prompt de vídeo

Se você quiser movimento a partir de uma imagem de origem, adicione uma URL de imagem mais flags de vídeo do Midjourney no prompt, como --video e --motion.

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication. Use your CometAPI key.

Corpo

application/json
prompt
string
obrigatório

Text prompt for the generation. Supports standard Midjourney parameters such as --v, --ar, --stylize, etc.

Exemplo:

"a paper boat floating on calm water at sunrise --v 6.1"

botType
enum<string>
padrão:MID_JOURNEY

Bot type to use. MID_JOURNEY for Midjourney (default), NIJI_JOURNEY for Niji.

Opções disponíveis:
MID_JOURNEY,
NIJI_JOURNEY
accountFilter
object

Filter which Midjourney account modes may be used for this task.

base64Array
string[]

Base64-encoded reference images. Each item should be a data URI such as data:image/png;base64,xxx.

state
string

Custom state string. Returned as-is in the task result and webhook callback for your own tracking.

Resposta

200 - application/json

Task accepted.

code
integer
obrigatório

Submission status code. 1 = submitted successfully (result carries the task id). 21 = the action opened a confirmation modal; continue with /mj/submit/modal using the returned task id. 4 = parameter error; description explains the cause.

description
string
obrigatório
result
string
obrigatório

Task id returned after submission.

properties
object