ApiframeApiframe Docs
Image Generation

Midjourney

High-quality image generation from text prompts using Midjourney.

Use in Apiframe Studio

POST /v2/images/generatemodel: "midjourney"

High-quality image generation from text prompts.

See Image Generation overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeDescription
midjourneyParams.aspect_ratiostringAspect ratio in "W:H" format (e.g. "16:9", "1:1")

Code examples

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a futuristic city skyline at sunset, cyberpunk style",
    "model": "midjourney",
    "midjourneyParams": {
      "aspect_ratio": "16:9"
    }
  }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a futuristic city skyline at sunset, cyberpunk style",
        "model": "midjourney",
        "midjourneyParams": {"aspect_ratio": "16:9"},
    },
)
print(response.json())
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "a futuristic city skyline at sunset, cyberpunk style",
    model: "midjourney",
    midjourneyParams: { aspect_ratio: "16:9" },
  }),
});
console.log(await response.json());
body := `{
  "prompt": "a futuristic city skyline at sunset, cyberpunk style",
  "model": "midjourney",
  "midjourneyParams": {"aspect_ratio": "16:9"}
}`
req, _ := http.NewRequest("POST", "https://api.apiframe.ai/v2/images/generate",
    strings.NewReader(body))
req.Header.Set("X-API-Key", "afk_your_api_key_here")
req.Header.Set("Content-Type", "application/json")

resp, err := http.DefaultClient.Do(req)

Try it

POST/v2/images/generateTry it

On this page