---
title: &quot;通过 RunAPI 在龙虾 (OpenClaw) 中使用 Midjourney API — AI 绘画与视频指南&quot;
url: &quot;https://runapi.ai/zh-CN/openclaw-midjourney.md&quot;
canonical: &quot;https://runapi.ai/zh-CN/openclaw-midjourney&quot;
locale: &quot;zh-CN&quot;
model: &quot;midjourney&quot;
---

# 在 OpenClaw 中使用 Midjourney。

Midjourney 擅长高质量 AI 绘画、文生图、图片编辑和把静态图转成短视频。OpenClaw agent 通过 RunAPI 直接调用标准 API，复用聊天用的同一个密钥，无需维护 Discord bot、浏览器自动化或额外媒体服务。

## API example

```bash
curl -X POST https://runapi.ai/api/v1/midjourney/text_to_image \
  -H &quot;Authorization: Bearer $RUNAPI_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;midjourney-v8.1&quot;,
    &quot;prompt&quot;: &quot;A cinematic product photo of a translucent AI compass on a black desk, dramatic lighting&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;midjourney-v8.1&quot;
}

```

## How it works

1. **Configure RunAPI** — Set RUNAPI_API_KEY in your environment. If OpenClaw already uses RunAPI for chat, the same key works for Midjourney image and video tasks.
2. **Call Midjourney** — Send a POST request to the Midjourney text_to_image endpoint with model midjourney-v8.1 and a prompt. For editing or animation, switch to edit_image or image_to_video and include a source image URL.
3. **Poll for media** — The create endpoint returns a task_id immediately. Poll the task status endpoint or use a callback_url until the generated image or video URL is ready.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | Required. Use midjourney-v8.1 for text-to-image, midjourney-edit-image for editing, or midjourney-image-to-video for animation. |
| `prompt` | `string` | Text instruction for image generation, editing, or motion guidance. |
| `source_image_url` | `string` | Source image URL. Required for edit_image, image_to_video, and image_to_prompt. |
| `image_id` | `string` | Required for get_seed. The Midjourney image id returned in a completed image response. |
| `callback_url` | `string` | Optional. Webhook URL that receives a POST when an asynchronous task completes. |

## FAQ

### Can I use Midjourney through the RunAPI API?

Yes. OpenClaw agents can call RunAPI Midjourney endpoints directly. Use /api/v1/midjourney/text_to_image for generation, /edit_image for image edits, and /image_to_video for animation tasks.

### Do I need Discord to use Midjourney from an agent?

No. RunAPI exposes Midjourney as API endpoints with task IDs, polling, callbacks, and SDK support. Your agent sends HTTP requests and receives media URLs; it does not need to drive Discord or a browser.

### Which Midjourney model should I use?

Use midjourney-v8.1 for text-to-image. Use midjourney-edit-image when you need prompt-guided edits from a source image, and midjourney-image-to-video when you want to animate a still image.

### Can Midjourney generate video?

Yes. The image_to_video endpoint animates a source image into a short video. Provide source_image_url and an optional prompt to guide motion or camera direction.

### How does Midjourney pricing work on RunAPI?

Midjourney uses pay-as-you-go task billing. Check the RunAPI model page for current rates before production use. The same RunAPI balance is shared with chat, image, video, music, and audio models.


## Links

- [OpenClaw setup guide →](https://runapi.ai/zh-CN/openclaw)
- [Midjourney on RunAPI →](https://runapi.ai/zh-CN/models/midjourney)
- [Model catalog](https://runapi.ai/zh-CN/models)
- [API docs](https://runapi.ai/zh-CN/docs)
