Login
Back to Blog
EnglishTutorial

Midjourney API Without Discord: How to Generate AI Images Programmatically

"Learn how to use Midjourney's image generation through an API without Discord. Complete guide with Python code examples, pricing, and alternatives."

C
Crazyrouter Team
February 21, 2026 / 497 views
Share:
Midjourney API Without Discord: How to Generate AI Images Programmatically

Why Midjourney API Without Discord?#

Midjourney remains one of the most popular AI image generators, known for its distinctive artistic style and high-quality outputs. But for developers, the Discord-only interface has always been a pain point. You can't build a product on top of Discord slash commands.

The good news: in 2026, there are reliable ways to access Midjourney's image generation through a proper REST API — no Discord bot, no slash commands, no channel management.

This guide covers how to integrate Midjourney into your applications programmatically.

How to Access Midjourney via API#

Using Crazyrouter's Midjourney API#

Crazyrouter provides a REST API endpoint for Midjourney that handles all the Discord complexity behind the scenes. You get a clean, standard API interface.

python
import requests
import time

API_KEY = "your-crazyrouter-key"
BASE_URL = "https://api.crazyrouter.com"

# Step 1: Submit an image generation request
response = requests.post(
    f"{BASE_URL}/mj/submit/imagine",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a futuristic Tokyo street at night, neon signs reflecting in rain puddles, cyberpunk aesthetic, cinematic lighting --ar 16:9 --v 6.1"
    }
)

task_id = response.json()["data"]["task_id"]
print(f"Task submitted: {task_id}")

# Step 2: Poll for the result
while True:
    result = requests.get(
        f"{BASE_URL}/mj/fetch/{task_id}",
        headers={"Authorization": f"Bearer {API_KEY}"}
    ).json()

    status = result["data"]["status"]
    if status == "completed":
        print(f"Image URL: {result['data']['image_url']}")
        break
    elif status == "failed":
        print(f"Error: {result['data']['error']}")
        break
    else:
        print(f"Status: {status} ({result['data'].get('progress', 'processing')})")
        time.sleep(5)

Upscale a Specific Image#

After getting the initial 4-image grid, upscale your preferred image:

python
# Upscale image #2 from the grid
upscale_response = requests.post(
    f"{BASE_URL}/mj/submit/action",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "task_id": task_id,
        "action": "UPSCALE",
        "index": 2  # 1-4 for each quadrant
    }
)

upscale_task_id = upscale_response.json()["data"]["task_id"]

Variations#

Generate variations of a specific image:

python
# Create variations of image #3
variation_response = requests.post(
    f"{BASE_URL}/mj/submit/action",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "task_id": task_id,
        "action": "VARIATION",
        "index": 3
    }
)

Image-to-Image (Describe + Blend)#

python
# Describe an existing image
describe_response = requests.post(
    f"{BASE_URL}/mj/submit/describe",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "image_url": "https://example.com/reference-image.jpg"
    }
)

# Blend multiple images
blend_response = requests.post(
    f"{BASE_URL}/mj/submit/blend",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "image_urls": [
            "https://example.com/image1.jpg",
            "https://example.com/image2.jpg"
        ]
    }
)

cURL Example#

bash
# Submit imagine request
curl -X POST https://api.crazyrouter.com/mj/submit/imagine \
  -H "Authorization: Bearer your-crazyrouter-key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "minimalist logo design for a tech startup, clean lines, blue and white --v 6.1"
  }'

# Fetch result
curl https://api.crazyrouter.com/mj/fetch/TASK_ID \
  -H "Authorization: Bearer your-crazyrouter-key"

Midjourney Prompt Tips for API Users#

Aspect Ratios#

code
--ar 1:1    # Square (default)
--ar 16:9   # Widescreen
--ar 9:16   # Portrait/mobile
--ar 3:2    # Classic photo
--ar 4:3    # Standard

Quality and Style Parameters#

code
--v 6.1     # Latest Midjourney version
--q 2       # Higher quality (slower)
--s 750     # Stylize level (0-1000)
--c 50      # Chaos level for variety (0-100)
--no text   # Negative prompt (exclude elements)

Effective Prompt Structure#

code
[Subject] + [Environment] + [Style] + [Lighting] + [Parameters]

Example:
"a samurai warrior standing on a cliff, overlooking a misty valley,
 traditional Japanese ink painting style, dramatic side lighting,
 highly detailed --ar 16:9 --v 6.1 --s 800"

Pricing Comparison#

ProviderCost per ImageGrid (4 images)Upscale
Midjourney Basic ($10/mo)~$0.04~$0.04Included
Midjourney Standard ($30/mo)~$0.02~$0.02Included
Crazyrouter API~$0.03~$0.03~$0.03
DALL-E 3 (1024x1024)$0.04N/AN/A
Stable Diffusion API$0.002-0.01N/AN/A

Crazyrouter advantage: Pay-as-you-go with no monthly subscription. You only pay for what you generate, making it ideal for variable workloads.

Midjourney vs Other Image APIs#

FeatureMidjourneyDALL-E 3Stable DiffusionIdeogram
Art Quality⭐ BestVery GoodGoodVery Good
Text in ImagesGood⭐ BestPoor⭐ Best
Photorealism⭐ ExcellentGoodGoodGood
API AccessVia proxy⭐ Native⭐ Native⭐ Native
Speed30-60s10-20s5-15s10-20s
CustomizationModerateLimited⭐ Full controlModerate
Price$$$$$$$

Building a Production Image Pipeline#

Here's a complete example of a production-ready image generation service:

python
import requests
import time
from typing import Optional

class MidjourneyClient:
    def __init__(self, api_key: str, base_url: str = "https://api.crazyrouter.com"):
        self.api_key = api_key
        self.base_url = base_url
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }

    def imagine(self, prompt: str, timeout: int = 300) -> dict:
        """Generate images from a text prompt."""
        response = requests.post(
            f"{self.base_url}/mj/submit/imagine",
            headers=self.headers,
            json={"prompt": prompt}
        )
        response.raise_for_status()
        task_id = response.json()["data"]["task_id"]
        return self._wait_for_result(task_id, timeout)

    def upscale(self, task_id: str, index: int, timeout: int = 120) -> dict:
        """Upscale a specific image from the grid."""
        response = requests.post(
            f"{self.base_url}/mj/submit/action",
            headers=self.headers,
            json={"task_id": task_id, "action": "UPSCALE", "index": index}
        )
        response.raise_for_status()
        new_task_id = response.json()["data"]["task_id"]
        return self._wait_for_result(new_task_id, timeout)

    def _wait_for_result(self, task_id: str, timeout: int) -> dict:
        """Poll until task completes or times out."""
        start = time.time()
        while time.time() - start < timeout:
            result = requests.get(
                f"{self.base_url}/mj/fetch/{task_id}",
                headers=self.headers
            ).json()

            status = result["data"]["status"]
            if status == "completed":
                return result["data"]
            elif status == "failed":
                raise Exception(f"Generation failed: {result['data'].get('error')}")

            time.sleep(5)
        raise TimeoutError(f"Task {task_id} timed out after {timeout}s")


# Usage
mj = MidjourneyClient("your-crazyrouter-key")

# Generate
result = mj.imagine("a cozy coffee shop interior, warm lighting, watercolor style --ar 3:2 --v 6.1")
print(f"Grid image: {result['image_url']}")

# Upscale the best one
upscaled = mj.upscale(result["task_id"], index=1)
print(f"Upscaled image: {upscaled['image_url']}")

FAQ#

Can I use Midjourney API without a Discord account?#

Yes. Through API providers like Crazyrouter, the Discord interaction is handled server-side. You interact with a standard REST API — no Discord account needed on your end.

Is using a Midjourney API proxy against their terms of service?#

Midjourney's terms are evolving. API proxy services operate in a gray area. For production use, consider also integrating DALL-E 3 or Stable Diffusion as alternatives. Crazyrouter supports all of these through the same API.

How fast is Midjourney via API?#

Typical generation time is 30-90 seconds for a 4-image grid, plus 15-30 seconds for upscaling. This is comparable to using Midjourney directly through Discord.

What Midjourney version does the API support?#

The API supports the latest Midjourney versions including V6.1. You can specify the version using the --v parameter in your prompt.

Can I use Midjourney API for batch generation?#

Yes. Submit multiple requests concurrently and poll for results. The API handles queuing automatically. For high-volume use cases, consider implementing a job queue on your side.

Summary#

Accessing Midjourney through a proper API removes the Discord bottleneck and opens up programmatic image generation for production applications. Through Crazyrouter, you get Midjourney alongside DALL-E, Stable Diffusion, Ideogram, and 300+ other AI models — all through one API key with pay-as-you-go pricing.

Start building with Midjourney API today at crazyrouter.com.

Implementation Guides

Related Posts

Suno Music API Tutorial: Generate AI Music Programmatically in 2026Tutorial

Suno Music API Tutorial: Generate AI Music Programmatically in 2026

"Learn how to use the Suno Music API to generate songs, lyrics, and instrumentals with code. Includes Python examples, pricing, and integration tips."

Feb 21
AI Video Generation APIs Guide 2026 - Sora 2, Veo3, Kling, Luma, and Runway ComparedTutorial

AI Video Generation APIs Guide 2026 - Sora 2, Veo3, Kling, Luma, and Runway Compared

Complete guide to AI video generation APIs including OpenAI Sora 2, Google Veo3, Kling 2.5, Luma Dream Machine, and Runway Gen-4. Code examples and pricing included.

Jan 22
AI Palm Reading with GPT-image-2 — Generate Professional Palmistry Analysis from a Single PhotoTutorial

AI Palm Reading with GPT-image-2 — Generate Professional Palmistry Analysis from a Single Photo

Use GPT-image-2 via Crazyrouter API to generate stunning palm reading infographics. Complete code in Python, curl, and Node.js.

May 1
Seedream 4.0 API Tutorial: ByteDance's Image Generation Model for DevelopersTutorial

Seedream 4.0 API Tutorial: ByteDance's Image Generation Model for Developers

"Step-by-step tutorial for using Seedream 4.0 API — ByteDance's advanced image generation model. Includes setup, code examples, pricing, and comparison with DALL-E 3 and Midjourney."

Feb 19
Qwen2.5 Omni API Guide 2026: Multimodal Development TutorialTutorial

Qwen2.5 Omni API Guide 2026: Multimodal Development Tutorial

A developer guide to Qwen2.5 Omni in 2026, covering what it is, how it compares with multimodal alternatives, code examples, pricing considerations, and production tips.

Mar 17
GTutorial

Google Veo3 API Guide 2026: Production Video Pipelines, Prompts, Pricing, and Fallbacks

If you searched for **Google Veo3 API**, you probably do not need another shallow feature list. You need to know what Google Veo3 API is, how it compares with alternatives, how to use it in a develope...

May 26