Mixture of Experts (MoE)

Adaptive rendering API for architecture, interiors, exteriors, and landscapes. Automatically applies expert transformations based on image and prompt.

Endpoint

HTTP Method
POST https://api.mnmlai.dev/v1/mixture-of-experts

Request

Send a POST request with multipart/form-data containing your source image and design specifications to transform architectural visualizations across different domains.

Required Parameters

ParameterTypeDescription
imageFileThe source architectural image to transform (multipart/form-data)
promptStringDescription of the desired transformation (max 500 characters)

Optional Parameters

ParameterTypeDefaultDescription
render_speedBooleantrueEnable fast processing mode for quicker results
expert_nameString"exterior"Expert model to use ("exterior", "interior", "masterplan", "landscape", "plans", "virtual_staging")
expert_strengthNumber1Strength of the expert model
seedNumberRandomRandom seed for reproducible results

Response

The Mixture of Experts (MoE) endpoint processes your architectural image asynchronously. You'll receive a request ID that you can use to check the status and retrieve the generated visualization.

Success Response (200 OK)

{
  "status": "success",
  "id": "b09ssvpzzhrj00cmzt1bykjzp1",
  "prompt": "convert to Mediterranean villa style",
  "credits": 95
}

Examples

Basic Example

curl -X POST https://api.mnmlai.dev/v1/mixture-of-experts \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/architectural-image.jpg" \
  -F "prompt=convert to Mediterranean villa style"

Advanced Example with All Parameters

curl -X POST https://api.mnmlai.dev/v1/mixture-of-experts \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/architectural-image.jpg" \
  -F "prompt=convert to Mediterranean villa style" \
  -F "render_speed=true" \
  -F "expert_name=exterior" \
  -F "expert_strength=0.8" \
  -F "seed=12345"

Node.js Example

const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');

const form = new FormData();
form.append('image', fs.createReadStream('architectural-image.jpg'));
form.append('prompt', 'convert to Mediterranean villa style');
form.append('render_speed', 'true');
form.append('expert_name', 'exterior');
form.append('expert_strength', '0.8');
form.append('seed', '12345');

const response = await axios.post(
  'https://api.mnmlai.dev/v1/mixture-of-experts',
  form,
  {
    headers: {
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY',
      ...form.getHeaders()
    }
  }
);

console.log('Request ID:', response.data.id);
console.log('Remaining credits:', response.data.credits);

Python Example

import requests

url = 'https://api.mnmlai.dev/v1/mixture-of-experts'

files = {
    'image': open('architectural-image.jpg', 'rb')
}

data = {
    'prompt': 'convert to Mediterranean villa style',
    'render_speed': 'true',
    'expert_name': 'exterior',
    'expert_strength': '0.8',
    'seed': '12345'
}

headers = {
    'Accept': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
}

response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()

print(f"Request ID: {result['id']}")
print(f"Remaining credits: {result['credits']}")

Processing Status

After submitting your request, use the Status Check endpoint with the returned ID to monitor processing progress:

Status Check Endpoint
GET https://api.mnmlai.dev/v1/status/{id}

Best Practices

Image Guidelines

  • • Use high-quality architectural images for better results
  • • Supported formats: JPEG, PNG, WebP
  • • Maximum file size: 8MB
  • • Images with clear architectural features work best

Prompt Tips

  • • Be specific about architectural styles (e.g., "Mediterranean villa", "modern minimalist")
  • • Include material preferences ("brick facade", "glass curtain wall")
  • • Mention landscape elements ("add softscape to courtyard", "rooftop garden")
  • • Keep prompts under 500 characters for optimal processing

Performance Tips

  • • Use render_speed=true for faster processing
  • • Adjust expert_strength between 0.5-1.5 for best balance
  • • Use consistent seeds for reproducible results
  • • Choose the appropriate expert_name for your content type

Error Handling

Common Error Responses

// 400 Bad Request - Missing required parameters
{
  "status": "error",
  "code": "MISSING_IMAGE",
  "message": "Image file is required"
}

// 400 Bad Request - Missing prompt
{
  "status": "error",
  "code": "MISSING_PROMPT",
  "message": "Prompt is required"
}

// 400 Bad Request - Insufficient credits
{
  "status": "error",
  "code": "NO_CREDITS",
  "message": "You do not have enough credits to use this feature",
  "details": {
    "credits": 0
  }
}

// 400 Bad Request - File too large
{
  "status": "error",
  "code": "IMAGE_TOO_LARGE",
  "message": "Image file is too large",
  "details": {
    "size": 10485760,
    "maxSize": 8388608,
    "unit": "bytes"
  }
}

// 400 Bad Request - Invalid file type
{
  "status": "error",
  "code": "INVALID_IMAGE_TYPE",
  "message": "Invalid image type",
  "details": {
    "receivedType": "image/bmp",
    "allowedTypes": ["image/jpeg", "image/png", "image/gif", "image/webp"]
  }
}

// 401 Unauthorized - Invalid API key
{
  "status": "error",
  "code": "UNAUTHORIZED",
  "message": "Invalid authentication credentials"
}

// 500 Internal Server Error
{
  "status": "error",
  "code": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {
    "error": "Processing failed",
    "timestamp": "2025-01-26T10:30:00.000Z"
  }
}

Related Endpoints

Explore other AI-powered design tools: