Proxy asset retrieval from https://cdn.midjourney.com

October 27, 2025

Table of contents

  1. Alternative: Direct CDN Access
  2. Request Headers
  3. Query Parameter
  4. Responses
  5. Examples
  6. Try It

This endpoint allows you to fetch images and videos from https://cdn.midjourney.com/ through the useapi.net proxy. Use it to retrieve imageUx and videoUx URLs returned by GET /jobs/jobid or any other assets hosted on https://cdn.midjourney.com/.

The Midjourney CDN requires standard browser headers—specifically the User-Agent header—to serve assets. Without it, Cloudflare will block the request. This proxy endpoint adds these headers automatically.

Alternative: Direct CDN Access

You can skip the proxy and fetch assets directly from https://cdn.midjourney.com/ by including the necessary headers:

  • curl "https://cdn.midjourney.com/example-image.jpg" \
         -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" \
         -H "Accept: */*" \
         -H "Accept-Encoding: gzip, deflate, br" \
         -H "Connection: keep-alive" \
         --output image.jpg
    
  • const cdnUrl = "https://cdn.midjourney.com/example-image.jpg";
    
    const headers = new Headers();
    headers.set('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36');
    headers.set('Accept', '*/*');
    headers.set('Accept-Encoding', 'gzip, deflate, br');
    headers.set('Connection', 'keep-alive');
    
    const response = await fetch(cdnUrl, { headers });
    const blob = await response.blob();
    
    // Save to file (Node.js)
    const fs = require('fs');
    const buffer = await blob.arrayBuffer();
    fs.writeFileSync('image.jpg', Buffer.from(buffer));
    
  • import requests
    
    cdnUrl = "https://cdn.midjourney.com/example-image.jpg"
    
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
        'Accept': '*/*',
        'Accept-Encoding': 'gzip, deflate, br',
        'Connection': 'keep-alive'
    }
    
    response = requests.get(cdnUrl, headers=headers)
    
    # Save image/video content
    with open('image.jpg', 'wb') as f:
        f.write(response.content)
    

Note: The User-Agent header is critical—without it, Cloudflare will block your request.


https://api.useapi.net/v1/proxy/cdn-midjourney/?cdnUrl=https://cdn.midjourney.com/…

Request Headers
Authorization: Bearer {API token}
Query Parameter
  • cdnUrl is required and must be a valid asset URL starting with https://cdn.midjourney.com/
Responses
  • 200 OK

    Returns the proxied content from the Midjourney CDN with appropriate headers.

  • 400 Bad Request

    {
        "error": "<Error message>",
        "code": 400
    }
    
  • 401 Unauthorized

    {
        "error": "Unauthorized",
        "code": 401
    }
    
  • 403 Forbidden

    Cloudflare may occasionally block requests even with proper headers. This is typically temporary and can be resolved with retry logic.

    Recommendation: Implement retry logic with exponential backoff when encountering 403 errors, or better yet, implement your own direct CDN access using the headers shown in the “Alternative: Direct CDN Access” section above for greater control and reliability.

Examples
  • curl -H "Authorization: Bearer …" \
         "https://api.useapi.net/v1/proxy/cdn-midjourney/?cdnUrl=https://cdn.midjourney.com/example-image.jpg"
    
  • const cdnUrl = "https://cdn.midjourney.com/example-image.jpg";
    const apiUrl = `https://api.useapi.net/v1/proxy/cdn-midjourney/`;
    const api_token = "API token";
    const response = await fetch(`${apiUrl}?cdnUrl=${encodeURIComponent(cdnUrl)}`, {
        method: 'GET',
        headers: {
            'Authorization': `Bearer ${api_token}`
        }
    });
    
    const result = await response.blob(); // For image/video content
    console.log("response", {response, result});
    
  • import requests
    cdnUrl = "https://cdn.midjourney.com/example-image.jpg"
    apiUrl = f"https://api.useapi.net/v1/proxy/cdn-midjourney/"
    api_token = "API token"
    headers = {
        "Authorization": f"Bearer {api_token}"
    }
    
    params = {
        "cdnUrl": cdnUrl
    }
    
    response = requests.get(apiUrl, headers=headers, params=params)
    print(response.status_code, response.headers)
    
    # Save image/video content
    with open('image.jpg', 'wb') as f:
        f.write(response.content)
    
Try It