Documentation

API Documentation

Qubico/flux1-dev API Reference

Complete API documentation for the Flux.1 Dev model supporting text-to-image and image-to-image generation.

Quick Start
Get started with Flux.1 Dev model in minutes

Base URL

https://api.qubico.ai/v1/inference

Header Params

x-api-key: YOUR_API_KEY

Model ID

Qubico/flux1-dev
Text-to-Image Generation
Generate high-quality images from text prompts

Request Example

POST https://api.qubico.ai/v1/inference
Content-Type: application/json
x-api-key: YOUR_API_KEY

{
  "model": "Qubico/flux1-dev",
  "task_type": "txt2img",
  "input": {
    "prompt": "A beautiful sunset over a mountain range with vibrant colors.",
    "negative_prompt": "No clouds in the sky.",
    "guidance_scale": 4.0,
    "width": 512,
    "height": 512
  },
  "config": {
    "webhook_config": {
      "endpoint": "https://your-webhook.com/callback",
      "secret": "your_webhook_secret"
    }
  }
}

Response Example

{
  "task_id": "task_12345678",
  "status": "pending",
  "model": "Qubico/flux1-dev",
  "task_type": "txt2img",
  "created_at": "2024-01-15T10:30:00Z",
  "estimated_time": 15
}
Parameters Reference
Complete list of available parameters for Flux.1 Dev model

Required Parameters

model
string
required

Model identifier. Must be "Qubico/flux1-dev"

task_type
string
required

Task type. Options: "txt2img", "img2img"

input.prompt
string
required

Text description of the desired image. Maximum 1000 characters. Required for both txt2img and img2img tasks.

Optional Parameters

input.negative_prompt
string
optional

Text description of what to avoid in the image. Maximum 500 characters.

input.guidance_scale
float
optional

Controls how closely the image follows the prompt. Range: 1.5-5.0, Default: 4.0

input.width
integer
txt2img only

Output image width. Range: 256-1024, Default: 512. Must be divisible by 8. Can be used in txt2img ONLY. width×height cannot exceed 1,048,576.

input.height
integer
txt2img only

Output image height. Range: 256-1024, Default: 512. Must be divisible by 8. Can be used in txt2img ONLY. width×height cannot exceed 1,048,576.

input.denoise
float
img2img only

Denoising strength for img2img. Range: 0.0-1.0, Default: 0.7

input.image
string
img2img required

URL of the input image for img2img tasks. Supports JPEG, PNG, WebP formats.

Configuration Parameters

config.webhook_config
object
optional

Webhook configuration for async notifications

endpoint - Webhook URL
secret - Webhook secret for verification
Response Format
Understanding API responses and status codes

Initial Response (202 Accepted)

{
  "task_id": "task_12345678",
  "status": "pending",
  "model": "Qubico/flux1-dev",
  "task_type": "txt2img",
  "created_at": "2024-01-15T10:30:00Z",
  "estimated_time": 15
}

Completed Response (GET /v1/tasks/task_id)

{
  "task_id": "task_12345678",
  "status": "completed",
  "model": "Qubico/flux1-dev",
  "task_type": "txt2img",
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:45Z",
  "results": [
    {
      "url": "https://cdn.qubico.ai/results/image_1.png",
      "width": 512,
      "height": 512,
      "format": "png"
    }
  ],
  "usage": {
    "credits_used": 1
  }
}

Status Values

pending
Task is queued
processing
Task is being processed
completed
Task completed successfully
failed
Task failed with error
Error Handling
Common error codes and how to handle them

Error Response Format

{
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "The parameter 'width' must be between 256 and 1024",
    "details": {
      "parameter": "width",
      "value": 2048,
      "allowed_range": "256-1024"
    }
  }
}
Code Examples
Ready-to-use code snippets in popular languages
curl -X POST https://api.qubico.ai/v1/inference \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "model": "Qubico/flux1-dev",
    "task_type": "txt2img",
    "input": {
      "prompt": "A beautiful sunset over a mountain range",
      "width": 512,
      "height": 512
    },
    "config": {
      "webhook_config": {
        "endpoint": "https://your-webhook.com/callback",
        "secret": "your_webhook_secret"
      }
    }
  }'
Rate Limits & Pricing
Usage limits and cost information

Rate Limits

Requests per minute:
60
Concurrent tasks:
10
Daily requests:
1,000

Pricing

Per image:
$0.015
Free trial credits:
100 images
Minimum purchase:
$10