---
title: Midjourney プロンプト短縮 | RunAPI
description: プロンプト短縮エンドポイントを使用して、同じレスポンスで結果を受け取ります。
url: https://runapi.ai/ja/docs/api/midjourney/shorten-prompt.md
canonical: https://runapi.ai/ja/docs/api/midjourney/shorten-prompt
locale: ja
---

> HTML 版: https://runapi.ai/ja/docs/api/midjourney/shorten-prompt
> エージェント向けサイトインデックス: https://runapi.ai/llms.txt

# Midjourney プロンプト短縮

## 概要

プロンプト短縮エンドポイントを使用し、同じレスポンスから結果を読み取ります。

### クイックスタート

1. APIキーを作成し、RUNAPI_API_KEYとして設定します。
2. 本文がリクエストスキーマと一致するPOSTリクエストを送信します。
3. 成功レスポンスのボディから結果を読み取る。

## エンドポイント

POST /api/v1/midjourney/shorten_prompt

ベースURL: https://runapi.ai

API バージョン: v1

認証: Authorization: Bearer YOUR_API_TOKEN

## サポートされているモデル

現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。

- [Midjourney](https://runapi.ai/ja/models/midjourney)

## リクエストスキーマ

このエンドポイントで宣言されたフィールドのみを送信してください。

### リクエストボディ

```json
{
  "prompt": {
    "required": true,
    "type": "string"
  }
}
```

## 成功レスポンス

HTTP 200 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "prompts": {
      "items": {
        "type": "string"
      },
      "maxItems": 5,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "prompts",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "prompts": [
    "Cinematic mountain landscape at sunrise.",
    "Mountain vista in warm morning light."
  ]
}
```

## エラー

HTTP 401 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Authentication required"
}
```

## エラー

HTTP 400 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "人が読めるエラーメッセージ。",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "人間が読める形式のバリデーションサマリー。",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "公開リクエストフィールドをキーとするバリデーションメッセージ。各フィールドに対して人間が読める文字列の配列が含まれます。",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### レスポンス例

```json
{
  "error": "prompt is required"
}
```

## エラー

HTTP 402 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Insufficient balance"
}
```

## エラー

HTTP 429 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "API key credit limit exceeded"
}
```

## エラー

HTTP 409 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## エラー

HTTP 429 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## エラー

HTTP 503 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## エラー

HTTP 504 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "The request timed out"
}
```

## エラー

HTTP 400 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Bad Request"
}
```

## エラー

HTTP 429 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Too Many Requests"
}
```

## エラー

HTTP 500 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Internal Server Error"
}
```

## エラー

HTTP 502 - POST /api/v1/midjourney/shorten_prompt

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Bad Gateway"
}
```

## 生成されたコードサンプル

cURLを直接使用するか、お使いの言語向けのSDKをインストールしてください。各サンプルは、このリファレンスに示されたバリデーション済みリクエストを送信します。

### curl

```curl
curl -X POST https://runapi.ai/api/v1/midjourney/shorten_prompt \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"A detailed cinematic mountain landscape at sunrise."}'
```

### javascript

#### インストール

```bash
npm install @runapi.ai/midjourney
```

```javascript
import { MidjourneyClient } from "@runapi.ai/midjourney";

const client = new MidjourneyClient({ apiKey: process.env.RUNAPI_API_KEY });
const result = await client.shortenPrompt.run({
  "prompt": "A detailed cinematic mountain landscape at sunrise."
});
```

### python

#### インストール

```bash
pip install runapi-midjourney
```

```python
import os
from runapi.midjourney import MidjourneyClient

client = MidjourneyClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.shorten_prompt.run(
  prompt="A detailed cinematic mountain landscape at sunrise."
)
```

### go

#### インストール

```bash
go get github.com/runapi-ai/midjourney-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  midjourney "github.com/runapi-ai/midjourney-sdk/go/midjourney"
)

func main() {
  client, err := midjourney.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  result, err := client.ShortenPrompt.Run(context.Background(), midjourney.ShortenPromptParams{
    Prompt: "A detailed cinematic mountain landscape at sunrise.",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
```

### ruby

#### インストール

```bash
gem install runapi-midjourney
```

```ruby
require "runapi/midjourney"

client = RunApi::Midjourney::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
result = client.shorten_prompt.run(
  prompt: "A detailed cinematic mountain landscape at sunrise."
)
```

### java

#### インストール

```kotlin
implementation("ai.runapi:runapi-midjourney")
```

```java
import ai.runapi.midjourney.MidjourneyClient;
import ai.runapi.midjourney.types.ShortenPromptParams;
import ai.runapi.midjourney.types.ShortenPromptResponse;

public final class Example {
  public static void main(String[] args) {
    MidjourneyClient client = MidjourneyClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    ShortenPromptResponse result = client.shortenPrompt().run(
        ShortenPromptParams.builder()
        .prompt("A detailed cinematic mountain landscape at sunrise.")
            .build()
    );
  }
}
```

### php

#### インストール

```bash
composer require runapi-ai/midjourney
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Midjourney\MidjourneyClient;

$client = new MidjourneyClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$result = $client->shortenPrompt->run([
  "prompt" => "A detailed cinematic mountain landscape at sunrise."
]);
```

## 関連ガイド

- [認証](https://runapi.ai/ja/docs/guides/authentication.md)
- [クイックスタート](https://runapi.ai/ja/docs/guides/task-api/quickstart.md)

---

## RunAPI のその他の情報

- [ホーム](https://runapi.ai/ja/.md)
- [モデルカタログ](https://runapi.ai/ja/models.md)
- [料金](https://runapi.ai/ja/pricing.md)
- [プロバイダー](https://runapi.ai/ja/models)
- [ドキュメント](https://runapi.ai/ja/docs/guides)
- [SDK](https://runapi.ai/ja/sdk.md)
- [CLI](https://runapi.ai/ja/cli.md)
- [MCP Server](https://runapi.ai/ja/mcp.md)
- [Claude Code と Cursor](https://runapi.ai/ja/claude-code-vs-cursor.md)
- [Cursor API セットアップ](https://runapi.ai/ja/cursor-api-setup.md)
- [RunAPI と OpenRouter の比較](https://runapi.ai/ja/openrouter-alternative.md)
- [エンタープライズ](https://runapi.ai/ja/contact.md)
- [お問い合わせ](https://runapi.ai/ja/contact.md)
- [利用規約](https://runapi.ai/ja/terms.md)
- [プライバシー](https://runapi.ai/ja/privacy.md)
- [エージェント向けサイトインデックス](https://runapi.ai/llms.txt)

お問い合わせ: contact@runapi.ai

## 構造化データ

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ja/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/jaicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "TechArticle",
    "headline": "Midjourney プロンプト短縮",
    "description": "プロンプト短縮エンドポイントを使用して、同じレスポンスで結果を受け取ります。",
    "url": "https://runapi.ai/ja/docs/api/midjourney/shorten-prompt",
    "mainEntityOfPage": "https://runapi.ai/ja/docs/api/midjourney/shorten-prompt"
  }
]
```
