OpenAI-Compatible
AI API Documentation

Comprehensive API for image generation, LLM chat, voice cloning, segmentation, upscaling, and background removal. OpenAI-compatible with powerful additional features.

Lightning Fast
LLM Chat
Voice Cloning
Quick Start
curl -X POST "https://api.univence.com/v1/images/generations" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"model": "z-image-turbo",
"prompt": "a beautiful sunset"
}'

Overview

Everything you need to know about the API

Base URL

https://api.univence.com

Authentication

All endpoints require authentication via:

  • API Key: Include X-API-Key: your-api-key in headers
  • User Session: Or authenticate with your user account

Getting Started

1. Sign up at univence.com

2. Visit univence.com/account to generate your API key

3. Start making requests!

API Endpoints

Complete documentation for all endpoints

POST
/v1/images/generations

1. Generate Single Image

Generate a single image from a text prompt using OpenAI-compatible format.

Request

curl -X POST https://api.univence.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A beautiful sunset over mountains",
    "negative_prompt": "blurry, distorted, low quality",
    "image_size": "1024x1024",
    "seed": 12345
  }'

Request Parameters

Parameter Type Required Description Default
model string No Model to use for generation "z-image-turbo"
prompt string Yes Text description for image generation -
negative_prompt string No Things to avoid in the image "blurry, distorted, low quality, bad anatomy, text, watermark, signature"
image_size string No Output image dimensions "1024x1024"
seed integer No Random seed for reproducible results null
batch_size integer No Number of images to generate 1
num_inference_steps integer No Number of inference steps null
guidance_scale float No Guidance scale for generation null
cfg float No CFG scale null
image string No Base64 encoded image for img2img null

Supported Image Sizes

  • 256x256
  • 512x512
  • 1024x1024
  • 1024x1792
  • 1792x1024

Supported Models

Model Description Max Width Max Height Text-to-Image
z-image-turbo Default model, fast generation 1792 1792 Yes
longcat-image-edit Wide aspect ratio, editing 1792 1024 Yes

Model Mapping

The following OpenAI/SiliconFlow model names are automatically mapped to internal models:

  • flux-schnellz-image-turbo
  • qwen/qwen-imagez-image-turbo
  • pixart-sigmaz-image-turbo
  • dall-e-3z-image-turbo
  • dall-e-2z-image-turbo

Response

{
  "created": 1703123456,
  "data": [
    {
 "url": "https://api.univence.com/v1/media/abc123",
 "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
 "revised_prompt": null
    }
  ]
}

Credit Cost

Non-premium users: Variable cost based on model, dimensions, and user pricing tier

Premium users: Free (0 credits)

POST
/v1/images/generations/batch

2. Generate Batch Images

Generate multiple images in a single request (max 5 requests).

Request

curl -X POST https://api.univence.com/v1/images/generations/batch \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "requests": [
 {
 "model": "z-image-turbo",
 "prompt": "A red sports car",
 "image_size": "512x512"
 },
 {
 "model": "z-image-turbo", 
 "prompt": "A blue ocean wave",
 "image_size": "1024x1024"
 }
    ]
  }'

Request Parameters

Parameter Type Required Description
requests array Yes Array of image generation requests (max 5)
requests[].model string No Model for this request
requests[].prompt string Yes Text description for this image
requests[].negative_prompt string No Things to avoid
requests[].image_size string No Image dimensions
requests[].seed integer No Random seed

Response

{
  "data": [
    {
 "created": 1703123456,
 "data": [
 {
 "url": "https://api.univence.com/v1/media/abc123",
 "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
 "revised_prompt": null
 }
 ]
    },
    {
 "created": 1703123457,
 "data": [
 {
 "url": "https://api.univence.com/v1/media/def456",
 "b64_json": "iVBORw0KGgoAAAANSUhEUgBB...",
 "revised_prompt": null
 }
 ]
    }
  ]
}

Credit Cost

Non-premium users: Sum of costs for all images in batch

Premium users: Free (0 credits)

GET
/v1/media/{mediaFileId}

3. Get Media File by ID

Retrieve media files including original and transcoded files. This endpoint is publicly accessible (no authentication required) and supports caching.

Request

curl -X GET https://api.univence.com/v1/media/xyz789

Path Parameters

Parameter Type Required Description
mediaFileId string Yes The media file ID

Response

Returns media file directly with appropriate MIME type headers.

Supported MIME Types:

  • image/jpeg
  • image/png
  • image/gif
  • image/webp

Caching

  • Cache duration: 60 minutes sliding expiration
  • Varies by User-Agent header
POST
/v1/images/segmentations

4. Image Segmentation

Segment objects from an image using AI-powered SAM3 segmentation.

Request

curl -X POST https://api.univence.com/v1/images/segmentations \
  -H "X-API-Key: your-api-key" \
  -F "file=@image.jpg" \
  -F "prompt=segment person in image"

Form Parameters

Parameter Type Required Description
file file Yes Image file to segment
prompt string Yes Description of what to segment

Response

Returns segmented image as PNG:

  • Content-Type: image/png
  • Content-Disposition: inline; filename="segmented_image.png"

Credit Cost

Non-premium users: 0.25 credits per image

Premium users: Free (0 credits)

POST
/v1/images/upscale

5. Image Upscaling

Upscale an existing image using various AI-powered upscaling methods.

Request

curl -X POST https://api.univence.com/v1/images/upscale \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "image": "iVBORw0KGgoAAAANSUhEUgAA...",
    "method": "realesrgan_4x",
    "scale": 4,
    "face_enhance": false
  }'

Request Parameters

Parameter Type Required Description Default
image string Yes Base64 encoded image data -
method string Yes Upscaling method to use -
scale integer No Scale factor for backward compatibility 2
face_enhance boolean No Enable face enhancement false

Supported Upscaling Methods

Method Scale Factor Description Best For
realesrgan_2x 2x Real-ESRGAN 2x upscaling General purpose, fast
realesrgan_4x 4x Real-ESRGAN 4x upscaling High quality, general purpose
realesrgan_4x_anime 4x Real-ESRGAN 4x with anime optimization Anime, cartoon images
swin2sr 2x-4x Swin2SR transformer-based upscaling High quality, research
lanczos 2x-8x Traditional Lanczos resampling Simple upscaling, small files

Response

{
  "created": 1703123456,
  "data": [
    {
 "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
 "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

Credit Cost

Non-premium users: Variable cost based on method and target resolution

Premium users: Free (0 credits)

POST
/v1/images/remove-background

6. Background Removal (Image)

Remove background from an image using AI-powered segmentation. The system segments specified object(s) and makes the background transparent.

Request

curl -X POST https://api.univence.com/v1/images/remove-background \
  -H "X-API-Key: your-api-key" \
  -F "file=@photo.jpg" \
  -F "prompt=person"

Form Parameters

Parameter Type Required Description
file file Yes Image file to process
prompt string Yes Description of object to keep (background will be removed)

Response

Returns processed image with transparent background as PNG:

  • Content-Type: image/png
  • Content-Disposition: inline; filename="background_removed.png"

How It Works

  1. The API uses SAM3 segmentation to create a mask based on your prompt
  2. The mask is applied to the original image
  3. Black pixels in the mask become transparent in the output
  4. The result is a PNG with alpha channel (transparency)

Credit Cost

Non-premium users: 0.25 credits per image

Premium users: Free (0 credits)

POST
/v1/videos/remove-background

7. Background Removal (Video)

Remove background from a video frame-by-frame using AI-powered segmentation. The system processes each frame, applies segmentation masks, and returns a WebM video with transparency.

Request

curl -X POST https://api.univence.com/v1/videos/remove-background \
  -H "X-API-Key: your-api-key" \
  -F "file=@video.mp4" \
  -F "prompt=person walking"

Form Parameters

Parameter Type Required Description
file file Yes Video file to process
prompt string Yes Description of object to keep (background will be removed)

Supported Video Formats

  • MP4 (H.264 codec recommended)
  • Other formats will be normalized to MP4 using FFmpeg

Response

Returns a WebM video with transparent background:

  • Content-Type: video/webm
  • Content-Disposition: inline; filename="background_removed_video.webm"
  • Codec: VP9 (supports alpha channel/transparency)
  • Pixel Format: yuva420p (includes alpha channel)

How It Works

  1. Video Normalization: The input video is normalized to MP4 format with H.264 codec for compatibility
  2. Credit Pre-check: For non-premium users, the system estimates cost based on video duration and frame rate
  3. Frame Extraction: Frames are extracted from the normalized video
  4. Segmentation: Each frame is segmented using SAM3 based on your prompt, returning a ZIP of per-frame masks
  5. Mask Application: Each mask is applied to its corresponding frame, making black pixels transparent
  6. Video Composition: Processed frames are composed into a WebM video using VP9 codec with alpha channel
  7. Credit Deduction: Actual credits are deducted based on the number of processed frames

Credit Cost

Non-premium users: 0.25 credits per processed frame

Premium users: Free (0 credits)

Cost Estimation Example

  • 10-second video @ 30 fps = ~300 frames = 75 credits
  • 5-second video @ 24 fps = ~120 frames = 30 credits

Note: Frames where no object is detected (mask is all black) are skipped and not charged.

POST
/v1/chat/completions

8. LLM Chat Completions

Generate LLM responses with optional vision support. This endpoint supports both text-only and multimodal (text + image) inputs. Users can choose between two models: mistralai/Ministral-3-3B-Reasoning-2512 (vision model with image understanding capabilities) and Nanbeige/Nanbeige4.1-3B (text-only model). Premium Only - requires an active premium subscription.

Request (Text-only)

curl -X POST https://api.univence.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "messages": [
 {
 "role": "system",
 "content": "You are a helpful assistant."
 },
 {
 "role": "user",
 "content": "Hello, how are you?"
 }
    ],
    "temperature": 0.7,
    "max_tokens": 1000
  }'

Request (Vision Support)

curl -X POST https://api.univence.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "messages": [
 {
 "role": "user",
 "content": [
 {
 "type": "text",
 "text": "What do you see in this image?"
 },
 {
 "type": "image_url",
 "image_url": {
 "url": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
 }
 }
 ]
 }
    ],
    "max_tokens": 500
  }'

Request Parameters

Parameter Type Required Description Default
model string No Model to use: mistralai/Ministral-3-3B-Reasoning-2512 or Nanbeige/Nanbeige4.1-3B mistralai/Ministral-3-3B-Reasoning-2512
messages array Yes Array of message objects -
messages[].role string Yes Message role: "system", "user", "assistant" -
messages[].content object Yes Message content (string or array for vision) -
temperature number No Sampling temperature (0.0-2.0) null
top_p number No Nucleus sampling (0.0-1.0) null
max_tokens integer No Maximum tokens to generate null
stream boolean No Enable streaming responses false

Message Content Formats

Text-only:

{
  "role": "user",
  "content": "Hello, how are you?"
}

Multimodal (text + images):

{
  "role": "user",
  "content": [
    {
 "type": "text",
 "text": "Describe this image"
    },
    {
 "type": "image_url",
 "image_url": {
 "url": "data:image/jpeg;base64,iVBORw0KGgo..."
 }
    }
  ]
}

Image URL Formats:

  • Base64 encoded: "url": "data:image/jpeg;base64,..."
  • HTTP URL: "url": "https://example.com/image.jpg"

Model Information

Model Type Capabilities Vision Support
mistralai/Ministral-3-3B-Reasoning-2512 Vision-Language Model (VLM) Text generation, image understanding, multimodal reasoning, step-by-step reasoning Yes - Use this model to send images
Nanbeige/Nanbeige4.1-3B Text-Only Model Text generation, reasoning, conversational AI No - Text input only

Access: All models require Premium subscription

Default Model: If no model parameter is specified, mistralai/Ministral-3-3B-Reasoning-2512 is used by default.

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1703123456,
  "model": "mistralai/Ministral-3-3B-Reasoning-2512",
  "choices": [
    {
 "index": 0,
 "message": {
 "role": "assistant",
 "content": "Hello! I'm doing well, thank you for asking. How can I help you today?"
 },
 "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 15,
    "total_tokens": 35
  }
}

Finish Reasons

Reason Description
stop Model completed generation normally
length Generation stopped due to max_tokens limit
content_filter Content was filtered by safety filters

Credit Cost

Non-premium users: Not available (premium required)

Premium users: Free (0 credits) for both models

POST
/v1/audio/clone

9. Voice Cloning

Clone a voice using Qwen3 TTS by providing reference audio and text. The system analyzes the reference audio to capture voice characteristics and generates new audio with the same voice style.

Request

curl -X POST https://api.univence.com/v1/audio/clone \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "text": "Hello, this is a test of voice cloning system.",
    "ref_audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",
    "ref_text": "This is reference audio that defines the voice style.",
    "language": "English",
    "stream": false
  }'

Request Parameters

Parameter Type Required Description Default
text string Yes The text to synthesize using cloned voice -
ref_audio string Yes Base64 encoded reference audio file (WAV format recommended) -
ref_text string Yes The text spoken in the reference audio -
language string No Language for the synthesized speech "English"
stream boolean No Enable streaming audio response false

Reference Audio Requirements

  • Format: WAV format recommended
  • Length: 3-10 seconds of clear speech recommended
  • Quality: Clear, noise-free audio with consistent voice
  • Content: The reference text should match exactly what is spoken in audio

Supported Languages

Common languages supported include:

  • English
  • Chinese (Simplified/Traditional)
  • Japanese
  • Korean
  • Spanish
  • French
  • German
  • And many more

Non-Streaming Response

When stream is false or omitted:

  • Content-Type: audio/wav
  • Content-Disposition: attachment; filename="cloned_voice.wav"

Response: Binary WAV audio file

Streaming Response

When stream is true:

  • Content-Type: audio/wav
  • Content-Range: Supports range requests for progressive loading

Response: Streaming WAV audio data

Credit Cost

Non-premium users: 1 credit per request

Premium users: Free (0 credits)

Use Cases

  • Voice Assistant: Create personalized voice assistants with user's voice
  • Content Creation: Generate voiceovers for videos with consistent voice
  • Accessibility: Create custom text-to-speech with familiar voices
  • Localization: Generate content in multiple languages with the same voice
  • Audiobooks: Produce audiobook content with consistent narration

Best Practices

  1. Use high-quality reference audio - Clear, noise-free audio produces better clones
  2. Match reference text exactly - The ref_text must match what's spoken in ref_audio
  3. Keep reference audio short - 3-10 seconds is optimal for voice extraction
  4. Consistent recording conditions - Same microphone, environment, and speaking style
  5. Test with short texts first - Verify voice quality before generating longer content
  6. Use streaming for long texts - Streaming provides faster feedback and better UX

Error Handling

Understanding and handling API errors effectively

Error Response Format

All endpoints return consistent error responses:

{
  "error": {
    "message": "Error description",
    "type": "error_type"
  }
}

Common Error Types

Error Type Description
invalid_request_error Invalid request parameters, invalid model, or model doesn't support vision
authentication_error Authentication failed
insufficient_credits Not enough credits for the request
processing_error Error during image/video processing
maintenance_mode API is under maintenance
premium_required Premium subscription required for endpoint

Specific Error Messages

Maintenance Mode

{
  "error": {
    "message": "We're in maintenance mode now. Please try again later",
    "type": "maintenance_mode"
  }
}

Dimensions Exceed Maximum

{
  "error": {
    "message": "The dimensions 2048x2048 exceed the maximum allowed for the z-image-turbo model (1792x1792)",
    "type": "invalid_request_error"
  }
}

Insufficient Credits

{
  "error": {
    "message": "You do not have enough credits. Required: 10, Available: 5",
    "type": "insufficient_credits"
  }
}

Authentication Failed

{
  "error": {
    "message": "Authentication failed. Provide a valid API Key in the 'X-API-Key' header or log in.",
    "type": "authentication_error"
  }
}

Premium Required

{
  "error": {
    "message": "This endpoint requires a premium subscription. Please upgrade to access LLM generation with vision support.",
    "type": "premium_required"
  }
}

Invalid Model

{
  "error": {
    "message": "Invalid model ID 'invalid-model'. Supported models: mistralai/Ministral-3-3B-Reasoning-2512, Nanbeige/Nanbeige4.1-3B",
    "type": "invalid_request_error"
  }
}

Vision Not Supported

{
  "error": {
    "message": "Model 'Nanbeige/Nanbeige4.1-3B' does not support vision. Use 'mistralai/Ministral-3-3B-Reasoning-2512' for image inputs.",
    "type": "invalid_request_error"
  }
}

Credit System & Pricing

Understanding costs and credit usage

Credit Value

1 Credit = $0.01 USD

Credits are the universal currency for all API operations. Purchase credits in bulk for discounts.

Pricing Overview

Service Non-Premium Cost Premium Cost
Image Generation Variable (model & dimensions) Free
Batch Image Generation Variable (sum of individual costs) Free
Image Segmentation 0.25 credits per image Free
Image Upscaling Variable (method & resolution) Free
Background Removal (Image) 0.25 credits per image Free
Background Removal (Video) 0.25 credits per frame Free
Voice Cloning 1 credit per request Free
LLM Chat Completions Not Available (Premium Required) Free (both models)

Premium Users: Get free access to all features including image generation, segmentation, upscaling, background removal, voice cloning, and LLM chat completions!

Bulk Discounts: Purchase 1000+ credits for 10% discount, 10000+ credits for 20% discount!

Rate Limiting

Understanding API rate limits and best practices

Rate Limiting Overview

  • Image generation requests are subject to rate limiting
  • Batch requests limited to 5 images per request
  • Video processing may have longer processing times
  • Rate limits may vary based on user tier and premium status

Caching & Performance

Optimize your API usage with effective caching strategies

Caching Overview

  • Generated images are cached for popular content
  • Cache duration: 60 minutes sliding expiration
  • Media files are cached to improve performance
  • Cache key format: media_file_{mediaFileId}
  • Cache varies by User-Agent header for media files

Authentication Examples

Code examples for authenticating API requests

Using API Key Header

curl -X POST https://api.univence.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk-your-api-key-here" \
  -d '{"prompt": "A beautiful landscape"}'

Using Session Authentication

curl -X POST https://api.univence.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-jwt-token" \
  -d '{"prompt": "A beautiful landscape"}'

Complete Usage Examples

End-to-end examples for common use cases

Basic Image Generation

curl -X POST https://api.univence.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A serene Japanese garden with cherry blossoms",
    "image_size": "1024x1024",
    "negative_prompt": "people, cars, buildings"
  }'

Batch Generation with Different Models

curl -X POST https://api.univence.com/v1/images/generations/batch \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "requests": [
 {
 "model": "z-image-turbo",
 "prompt": "A futuristic cityscape at night",
 "image_size": "1792x1024"
 },
 {
 "model": "z-image-turbo",
 "prompt": "A peaceful mountain lake at sunrise",
 "image_size": "1024x1792"
 }
    ]
  }'

Image Segmentation Workflow

curl -X POST https://api.univence.com/v1/images/segmentations \
  -H "X-API-Key: your-api-key" \
  -F "file=@photo.jpg" \
  -F "prompt=isolate the main subject"

Image Upscaling Workflow

curl -X POST https://api.univence.com/v1/images/upscale \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "image": "iVBORw0KGgoAAAANSUhEUgAA...",
    "method": "realesrgan_4x",
    "scale": 4,
    "face_enhance": false
  }'

Background Removal for Image

curl -X POST https://api.univence.com/v1/images/remove-background \
  -H "X-API-Key: your-api-key" \
  -F "file=@portrait.jpg" \
  -F "prompt=person"

Background Removal for Video

curl -X POST https://api.univence.com/v1/videos/remove-background \
  -H "X-API-Key: your-api-key" \
  -F "file=@walking.mp4" \
  -F "prompt=person"

Expected Output: A WebM video with transparent background showing the person walking.

LLM Chat Completions (Text-only)

curl -X POST https://api.univence.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "messages": [
 {
 "role": "system",
 "content": "You are a helpful coding assistant."
 },
 {
 "role": "user",
 "content": "Write a Python function to reverse a string."
 }
    ],
    "temperature": 0.7,
    "max_tokens": 500
  }'

LLM Chat Completions (Vision)

curl -X POST https://api.univence.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "model": "mistralai/Ministral-3-3B-Reasoning-2512",
    "messages": [
 {
 "role": "user",
 "content": [
 {
 "type": "text",
 "text": "What objects do you see in this image?"
 },
 {
 "type": "image_url",
 "image_url": {
 "url": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAA..."
 }
 }
 ]
 }
    ],
    "max_tokens": 300
  }'

Voice Cloning

curl -X POST https://api.univence.com/v1/audio/clone \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "text": "This is a test of voice cloning.",
    "ref_audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",
    "ref_text": "Reference text here",
    "language": "English",
    "stream": false
  }' \
  --output cloned_voice.wav

Retrieve Generated Image

curl -X GET https://api.univence.com/v1/media/abc123 \
  --output image.png

Model Specifications

Available AI models and their capabilities

Z-Image-Turbo

Text-to-Image
Max Resolution: 1792×1792
Best For: General text-to-image generation

Delivers strong photorealistic image generation while maintaining excellent aesthetic quality.

Perfect for: Landscapes, portraits, abstract art, product images

LongCat-Image-Edit

Image-to-Image
Max Resolution: 1792×1024
Parameters: ~20B

Large-scale image editing model for advanced image manipulation and style transfer.

Perfect for: Image editing, style transfer, inpainting, photo enhancement

Best Practices

Guidelines for optimal API usage

Prompt Engineering

  • Be specific and descriptive in your prompts
  • Use artistic style references (e.g., "in the style of oil painting")
  • Include lighting and atmosphere details
  • Specify composition and framing preferences
  • Use negative prompts to avoid unwanted elements

Performance Optimization

  • Use batch generation for multiple images
  • Implement client-side caching to avoid duplicate requests
  • Choose appropriate image sizes for your use case
  • Monitor rate limit headers to avoid throttling
  • Use smaller inference steps for faster generation when quality isn't critical

Security Best Practices

  • Never expose API keys in client-side code
  • Use environment variables for API key storage
  • Implement proper error handling and logging
  • Validate user input before sending to API
  • Use HTTPS for all API communications

Cost Optimization

  • Use image_size parameter appropriately - larger images cost more credits
  • Batch requests are more cost-effective than individual requests
  • Cache generated images to avoid regeneration
  • Monitor credit usage regularly
  • Consider Premium plan for high-volume usage

Troubleshooting

Solutions to common issues

Issue: "Invalid API Key" Error

Solution: Verify your API key is correct and properly formatted. Generate a new key from your account dashboard if needed.

Issue: "Insufficient credits"

Solution: Check user credit balance, consider upgrading to premium, or reduce image dimensions/batch size.

Issue: "Invalid model ID"

Solution: Verify model name spelling. Check supported models list: mistralai/Ministral-3-3B-Reasoning-2512, Nanbeige/Nanbeige4.1-3B. Use default mistralai/Ministral-3-3B-Reasoning-2512 if unsure.

Issue: "Dimensions exceed maximum"

Solution: Check model specifications and reduce image size.

Issue: "Authentication failed"

Solution: Verify API key is valid and check header format: X-API-Key: your-key.

Issue: "We're in maintenance mode"

Solution: Wait and try again later. Check status page for updates.

Issue: "Video segmentation returned no frames"

Solution: Ensure prompt describes objects visible in video. Try a different, more specific prompt.

Issue: "Background removal failed or returned no mask"

Solution: Verify prompt matches objects in image/video. Try more specific or different prompts. Ensure image/video quality is sufficient for detection.

Ready to Get Started?

Join thousands of developers creating amazing content with our AI API