VOOZH about

URL: https://crazyrouter.com/en/blog/midjourney-api-without-discord-guide

⇱ Midjourney API Without Discord: How to Generate AI Images Programmatically - Crazyrouter


Back to Blog

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

How to Use Claude Code with Crazyrouter: Base URL Setup, Model Routing, and Cost Savings

Switch Claude Code to Crazyrouter in minutes. Set your base URL, access multiple models through one key, reduce API cost, and keep your existing coding workflow.

Apr 18

Qwen 2.5 Omni Guide 2026: Building Multimodal Chatbots with Voice and Vision

"Build multimodal chatbots with Qwen 2.5 Omni — voice input, image understanding, and text in one model. Includes architecture patterns, code examples, and cost tips."

Apr 18

Can Claude Code Build a World Cup 2026 Match Predictor? A Real Crazyrouter API Test

We built a reproducible World Cup 2026 match predictor demo with Claude Code-style workflow, Elo/Poisson probabilities, charts, and real Crazyrouter API calls through https://cn.crazyrouter.com/v1.

Jun 12

Whisper API Guide 2026: Speech-to-Text for Developers

"Complete guide to OpenAI Whisper API for speech-to-text in 2026. Learn transcription, translation, and integration with code examples in Python and Node.js."

Mar 1

Codex CLI Installation Guide 2026 for Enterprise Proxies and Devcontainers

A practical Codex CLI installation guide covering macOS, Linux, Windows, proxies, devcontainers, and team-ready setup patterns.

Mar 20

AI Content Creation Tools 2026: Complete Guide for Creators

AI has revolutionized content creation. From writing blog posts to generating images, music, and videos, creators now have powerful tools at their fingertips. This guide covers the best AI content cre...

Jan 26