> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rixapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Midjourney API Overview

> Call flow, authentication, every endpoint, speed and versions, pricing and error codes

Call Midjourney through the API: generate images, keep working on them, and turn them into videos. Every endpoint except Describe is an asynchronous task: you get a task ID on submission, then fetch the result, or pass `notify_hook` and wait for us to push it.

## Basics

| Item | Value |
| - | - |
| Base URL | `https://api.ephone.ai` |
| Authentication | Header `Authorization: Bearer YOUR_API_KEY` |
| Request body | JSON, `Content-Type: application/json` |

Every endpoint page has a playground on the right: enter your API key and parameters to send a request. Playground requests are real and billed as usual.

## Call flow

**1. Submit a task**

Call an endpoint that creates a task, for example [Imagine](https://docs.rixapi.com/docs/en/api-reference/midjourney/imagine.md). It returns a `task_id`.

**2. Get the result**

Poll [Get Task](https://docs.rixapi.com/docs/en/api-reference/midjourney/task.md) every 3 to 5 seconds until `status` becomes `success` or `failure`. Or pass `notify_hook` on submission and we POST the same content as the fetch result when the task ends.

**3. Keep going**

`actions` in the result lists what you can do next. Call [Image Actions](https://docs.rixapi.com/docs/en/api-reference/midjourney/action.md) with one of them as `action`. The new task has its own `actions`, so you can keep chaining.

## Every endpoint

Submit endpoints live at `POST /midjourney/{name}` (names in the first column), and fetching is `GET /midjourney/task/{task_id}`.

| Endpoint | What it does |
| - | - |
| [Imagine](https://docs.rixapi.com/docs/en/api-reference/midjourney/imagine.md) `imagine` | Generate four images from a prompt, optionally with image prompts |
| [Blend](https://docs.rixapi.com/docs/en/api-reference/midjourney/blend.md) `blend` | Blend 2 to 5 images into new ones |
| [Describe](https://docs.rixapi.com/docs/en/api-reference/midjourney/describe.md) `describe` | Get prompts that describe an image, returned synchronously |
| [Edit](https://docs.rixapi.com/docs/en/api-reference/midjourney/edit.md) `edit` | Edit an image with a text instruction, V8.1 and later only |
| [Retexture](https://docs.rixapi.com/docs/en/api-reference/midjourney/retexture.md) `retexture` | Keep the composition and change style and materials, V7 and V6 only |
| [Image to Video](https://docs.rixapi.com/docs/en/api-reference/midjourney/video.md) `video` | Turn your own image into a video of about 5 seconds |
| [Image Actions](https://docs.rixapi.com/docs/en/api-reference/midjourney/action.md) `action` | Work on an existing task: upscale, vary, remix, reroll, zoom out, pan, inpaint, enhance, animate, extend a video |
| [Get Task](https://docs.rixapi.com/docs/en/api-reference/midjourney/task.md) `task/{task_id}` | GET. Fetch a task's status and outputs |

> [!TIP]
>
> You can also submit through the unified task endpoint `POST /v1/task/submit` with `model` set to `midjourney-` plus the action name (for example `midjourney-imagine`, `midjourney-upscale`) and the parameters inside `input`, without `action`. Task IDs work across both, and billing is identical.

## Speed and versions

* **Speed**: `speed` takes `relax` (0.4x the fast price), `fast` (default) or `turbo` (2x the fast price). Describe has no speed, and video has no relax.
* **Version**: add a parameter such as `--v 7` or `--niji 7` at the end of the prompt; without one, V8.2 (the current Midjourney default) is used. Follow-up operations keep the version of the original image.
* **Prompt**: Midjourney parameters work as usual, up to 6000 characters; for V8 models, text under 1024 characters always works and longer text may be rejected. See [Capabilities and Parameters](https://docs.rixapi.com/docs/en/guides/midjourney-workflows.md) for each version's syntax and limits.

## Pricing

Each call is billed once, and failed tasks are refunded. Each capability's price for each speed is in the price table on its model page; multipliers for drafts, HD, video resolution and count are in [Capabilities and Parameters](https://docs.rixapi.com/docs/en/guides/midjourney-workflows.md).

## Errors

Errors share one shape, and the HTTP status matches the error type:

```json theme={null}
{ "error": { "code": "invalid_request", "message": "index must be between 1 and 4" } }
```

\| HTTP | `code` | Meaning |
\| --- | --- |
\| 400 | `invalid_request` | A parameter is wrong; `message` says which |
\| 400 | `unsupported_action` | This task doesn't support the operation; see `actions` in the fetch result |
\| 400 | `content_rejected` | The prompt or image failed moderation; nothing is charged |
\| 401 | `unauthorized` | Missing or invalid API key |
\| 402 / 403 | `insufficient_quota` | Insufficient balance |
\| 404 | `task_not_found` | The task doesn't exist or belongs to another account |
\| 404 | `not_found` | Wrong endpoint name |
\| 409 | `task_not_finished` | The task to work on hasn't succeeded yet |
\| 429 | `rate_limited` / `queue_full` | Too many requests, or the generation queue is full; retry later |
\| 5xx | `upstream_error` / `internal_error` | Server-side failure; retrying is fine |

## Next steps

> [card] [Midjourney Quickstart](https://docs.rixapi.com/docs/en/guides/midjourney-quickstart.md)
>
> Generate your first images, fetch them, keep going

> [card] [Midjourney Capabilities and Parameters](https://docs.rixapi.com/docs/en/guides/midjourney-workflows.md)
>
> Prompt parameters, follow-up rules, pricing details


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.