跳转到主要内容
POST
/
midjourney
/
shorten
Midjourney Shorten
curl --request POST \
  --url https://api.acedata.cloud/midjourney/shorten \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A cute cat playing piano"
}
'
import requests

url = "https://api.acedata.cloud/midjourney/shorten"

payload = { "prompt": "A cute cat playing piano" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({prompt: 'A cute cat playing piano'})
};

fetch('https://api.acedata.cloud/midjourney/shorten', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "prompts": [
    "a serene mountain lake at sunrise, mist rising from the water, golden hour lighting --ar 16:9",
    "mountain lake sunrise with mist, golden light --ar 16:9 --v 6",
    "tranquil alpine lake, dawn mist, warm golden tones, cinematic --ar 16:9",
    "sunrise over a misty mountain lake, rich golden hour photography --ar 16:9 --style raw",
    "misty lake at dawn, mountains in background, golden sunrise --ar 16:9"
  ]
}
{
  "error": {
    "code": "token_mismatched",
    "message": "The specified token is not matched with API."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "invalid_token",
    "message": "The specified token is invalid or wrong."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "too_many_requests",
    "message": "You have exceeded the rate limit."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "api_error",
    "message": "Internal server error."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}

授权

Authorization
string
header
必填

请求头

accept
enum<string>

Midjourney Shorten Param Accept

可用选项:
application/json

请求体

application/json
prompt
string
必填

Midjourney Shorten Prompt

响应

Midjourney Shorten Response 200

prompts
string[]

Midjourney Shorten Response 200 Prompts