Skip to content
TutujinAPI

MidjourneyImage

mj_variation

Image generation model from Midjourney, accepting images and producing images.

  • Input and output typesimagesimages
  • 1 groups
Best success rate
Fastest first token
Top throughput

Line monitoring over the last 24 hours, refreshed about every 5 minutes

What matters most to you?

We recommend one group for your priority — pick it when you create an API key.

Pricing by group

Each group routes the same model through a different line at a different price. You choose a group for every API key you create in the console.

Availability, throughput and latency come from line monitoring over the last 24 hours, refreshed about every 5 minutes.

Line availability, last 24 hours

Line monitoring over the last 24 hours, refreshed about every 5 minutes. Success rates come from real requests; hours without traffic show as “no data” and don't count toward the rate.

API reference

OpenAI-compatible: set the base URL to https://www.tutujin.com/v1 and create an API key in the console. The examples below already use this model's ID.

The examples read the key from the TUTUJIN_API_KEY environment variable. Never put keys in front-end code or commit them to a repository.

POST

https://www.tutujin.com/mj/submit/action

Midjourney async task. The body has no model field: the route decides what is billed. A successful submit returns code 1 with the task ID in result; poll GET /mj/task/{id}/fetch until status is SUCCESS or FAILURE. A finished image lists its next steps in buttons (upscale, vary, zoom out, pan…): send the button's customId to /mj/submit/action.

Headers

Authorization:
Bearer $TUTUJIN_API_KEY
Content-Type:
application/json
curl https://www.tutujin.com/mj/submit/action \
  -H "Authorization: Bearer $TUTUJIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "1794500000000001",
    "customId": "MJ::JOB::variation::1::<hash>"
  }'

curl https://www.tutujin.com/mj/task/$TASK_ID/fetch \
  -H "Authorization: Bearer $TUTUJIN_API_KEY"

Key parameters

promptstring
Prompt, Midjourney parameters allowed (e.g. --ar 16:9); speed flags --fast / --relax / --turbo are ignored. Used by imagine, edits, video and modal
base64Arrayarray
Images as data:image/...;base64,... — reference images for imagine, the images to store for upload
taskIdstring
ID of the earlier task that action and modal continue from
customIdstring
Button ID from the earlier task's buttons; picks the operation (upscale, vary, zoom out, pan, reroll…). Used by action
maskBase64string
Mask image (base64) for vary region. Used by modal
base64string
Image (base64) to describe as prompts. Used by describe
imagestring
URL of the reference image or first frame. Used by edits and video
motionstring
Video motion: low or high. Used by video

Tokens and billing

Models meter input and output in tokens. Knowing how tokens are counted helps you predict cost more accurately.

What is a token?

A token is the smallest unit a model reads or writes. Your text is split into tokens by the model's tokenizer, and you're billed by the token count.

Tokenizers differ between vendors and model generations, so the same text can produce noticeably different counts on different models. The usage field returned by the API is the exact number.

Rough conversions for English and Chinese

These rules of thumb are for rough estimates only; actual counts depend on the model's tokenizer. Code, numbers, rare characters and emoji usually take more tokens.

ContentApprox. tokens
1 English wordabout 1.3
1,000 English charactersabout 250
1 Chinese characterabout 0.6 – 1.5, tokenizer-dependent
1,000 Chinese charactersabout 600 – 1,500

How input, output and cache are billed

For token-billed models, the cost of a request is the sum of the parts below; every price is quoted per million tokens:

  • Input (prompt tokens): system prompt, earlier messages, tool definitions and file contents all count as input, billed at the input price.
  • Output (completion tokens): what the model generates, billed at the output price — usually several times the input price.
  • Cache reads: input tokens served from the context cache are billed at the cache-read price, typically a small fraction of the input price.
  • Cache writes: some models (such as Claude) charge a cache-write price the first time content is written to the cache.
  • Per-call models (common for images and video) charge a fixed price per request, regardless of tokens.

Cost = input × input price + output × output price + cache reads × cache-read price + cache writes × cache-write price

This model is billed per call: ¥0.4 per request in the “Standard” group, regardless of input or output length.

Reasoning tokens count as output

Reasoning (thinking) models produce internal reasoning before the answer. Those tokens may not be returned to you, but they count as output (reasoning tokens in usage) and are billed at the output price.

So the same question usually costs more output tokens on a reasoning model. For tasks that don't need deep reasoning, lower the reasoning effort or use a non-reasoning model.

Images and audio are converted to tokens too

Multimodal models convert images into input tokens based on resolution — larger images and higher detail settings cost more — and audio is usually converted by duration. The exact conversion varies by model; check the usage field.

Where to see what each call cost

In the console, Usage lists every call with its model, group, input / output / cache token counts and the amount charged, with filters and export.

In code, the usage field in each response gives the token counts; for streaming requests, turn on include_usage.

Ways to spend less

  • Pick the right group: the same model costs different amounts in different groups — the Pricing tab ranks them by cost, balance or reliability.
  • Use the cache: put stable system prompts and reference documents at the start of your messages to raise cache hits.
  • Limit output: set max_tokens and ask for concise output formats.
  • Trim context: summarize long conversations instead of resending the full history every turn.
  • Mix model sizes: send simple classification or extraction to cheaper models and save flagship models for hard tasks.
  • Lower the reasoning effort on reasoning models when you can.