API 레퍼런스
Midjourney 프롬프트 단축
프롬프트 단축 엔드포인트를 사용하여 동일한 응답에서 결과를 받으세요.
01
개요
프롬프트 단축 엔드포인트를 사용하고, 동일한 응답에서 결과를 읽으세요.
빠른 시작
- API 키를 만들고 RUNAPI_API_KEY로 설정합니다.
- 요청 스키마와 일치하는 본문으로 POST 요청을 전송하세요.
- 성공 응답 본문에서 결과를 읽습니다.
엔드포인트
- Base URL
https://runapi.ai- API 버전
v1- 인증
Authorization: Bearer YOUR_API_TOKEN
02
지원 모델
현재 가격, 속도 제한 및 상업적 이용 세부 정보는 모델 페이지를 여십시오.
03
JSON 본문요청 스키마
이 엔드포인트에 선언된 필드만 전송하세요.
요청 본문필드 1개
promptstring
필수
04
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."
]
}
05
HTTP 401오류
POST /api/v1/midjourney/shorten_prompt
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Authentication required"
}
06
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"
}
07
HTTP 402오류
POST /api/v1/midjourney/shorten_prompt
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Insufficient balance"
}
08
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"
}
09
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"
}
10
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."
}
11
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"
}
12
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"
}
13
HTTP 400오류
POST /api/v1/midjourney/shorten_prompt
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Bad Request"
}
14
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"
}
15
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"
}
16
HTTP 502오류
POST /api/v1/midjourney/shorten_prompt
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Bad Gateway"
}
17
생성된 코드 샘플
cURL을 직접 사용하거나 해당 언어의 SDK를 설치하세요. 각 샘플은 이 레퍼런스에 표시된 유효성 검사된 요청을 제출합니다.
설치
Shell
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."
)