← Back to home

API Documentation

Base URL: https://selenix.go.ro

Contents

Quick Start

Generate your first image in two steps:

1. Get your API key

Register an account to get $2.00 free credits. Then find your API key on the API Keys page. You can create additional keys and label them for different projects.

2. Generate an image

curl -X POST https://selenix.go.ro/v1/images/generations \
  -H "Authorization: Bearer sk-trial-abc123..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a cat on a windowsill at golden hour"}'
{
  "created": 1743724800,
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": [{"url": "https://selenix.go.ro/outputs/Flux2_00001_.png"}]
}

That's it. The default mode waits for completion and returns the image URL directly.

Add ?async_mode=true to any generation endpoint to return immediately with a job ID. Then poll /v1/jobs/{job_id} or use SSE streaming to track progress.

Authentication

All generation and account endpoints require an API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

API keys come in two types:

TypePrefixHow to get
Trialsk-trial-Register an account ($2.00 free credits)
Paidsk-gen-Purchase credits on the website or via Stripe

Some endpoints accept the key as a query parameter ?key=YOUR_KEY instead (noted where applicable).

Image Generation

POST /v1/images/generations

Generate images using the Flux.2-dev model. Cost: $0.02 per image.

Request

curl -X POST https://selenix.go.ro/v1/images/generations?async_mode=true \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a serene Japanese garden with cherry blossoms",
    "width": 1344,
    "height": 768,
    "steps": 20
  }'

Parameters

FieldTypeDefaultDescription
promptstringrequiredWhat to generate
modelstringflux2-devModel to use
widthint1024Image width (512–2048, multiple of 64)
heightint1024Image height (512–2048, multiple of 64)
stepsint20Sampling steps (8–50). More = higher quality, slower
cfgfloat4.0Guidance scale (1.0–10.0). Higher = more literal prompt
seedint-1Seed for reproducibility. -1 = random
input_fileslist[str]nullFilenames for img2img (upload first via /v1/uploads)

Response (sync — default)

{
  "created": 1743724800,
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "data": [{"url": "https://selenix.go.ro/outputs/Flux2_00001_.png"}]
}

Response (async — ?async_mode=true)

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued"
}
img2img: When input_files is provided, the workflow automatically switches to img2img mode. Use filenames from /v1/uploads or output files from previous generations.

Video Generation

POST /v1/video/generations

Generate video using LTX-2.3 models. Cost: $0.04 per second of video.

Request

curl -X POST https://selenix.go.ro/v1/video/generations?async_mode=true \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a cat walking across a wooden floor, cinematic lighting",
    "model": "ltx-2.3",
    "num_frames": 121,
    "width": 960,
    "height": 544
  }'

Parameters

FieldTypeDefaultDescription
promptstringrequiredWhat to generate
negative_promptstring""What to avoid in the video
modelstringltx-2.3ltx-2.3 (standard, higher quality) or ltx-2.3-fast (faster, single-stage)
widthint960See supported resolutions below
heightint544See supported resolutions below
num_framesint121Number of frames (25–241). Duration = frames / 24 fps
fpsint24Fixed at 24 (model-trained frame rate)
seedint-1Seed for reproducibility. -1 = random
input_fileslist[str]nullReference image for img2vid (max 1)

Supported resolutions

Aspect ratioInput (width x height)Output (2x upscaled)
Landscape 16:9960 x 5441920 x 1088
Portrait 9:16544 x 9601088 x 1920
Square 1:1768 x 7681536 x 1536

Sending other width/height combinations will return a validation error.

Upscaling: Video is generated at the input resolution and upscaled 2x in the output via LTX's built-in upsampler. The final video file is the upscaled resolution.

Cost calculation

cost = (num_frames / fps) * $0.04

Example: 121 frames / 24 fps = ~5.04 seconds = $0.20

File Uploads

Upload a reference image

POST /v1/uploads

Upload an image for use with img2img or img2vid. Max file size: 20 MB. Duplicate uploads are automatically deduplicated.

curl -X POST https://selenix.go.ro/v1/uploads \
  -H "Authorization: Bearer YOUR_KEY" \
  -F "file=@photo.png"

Response

{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "filename": "a1b2c3d4_photo.png",
  "original_filename": "photo.png",
  "format": "png",
  "width": 1024,
  "height": 1024,
  "frame_count": 1,
  "size_bytes": 524288,
  "deduplicated": false
}

Use the filename value in the input_files array when generating.

Animated images (GIF, WebP, APNG) are accepted but automatically converted to a static first frame for generation.

List your uploads

GET /v1/uploads/mine?limit=20&offset=0

curl https://selenix.go.ro/v1/uploads/mine \
  -H "Authorization: Bearer YOUR_KEY"

List your generations

GET /v1/generations/mine?limit=20&offset=0

curl https://selenix.go.ro/v1/generations/mine \
  -H "Authorization: Bearer YOUR_KEY"

Returns output files from your completed jobs. Use these filenames in input_files for img2img or img2vid.

Job Management

When using async_mode=true, use these endpoints to track your generation.

Get job status

GET /v1/jobs/{job_id}

curl https://selenix.go.ro/v1/jobs/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_KEY"

Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "job_type": "image",
  "model_id": "flux2-dev",
  "status": "completed",
  "progress": {"step": 20, "total_steps": 20, "stage": 1, "stage_label": "Sampling"},
  "params": {"prompt": "a cat on a windowsill", "width": 1024, "height": 1024, "steps": 20},
  "input_files": [],
  "output_files": ["Flux2_00001_.png"],
  "units": 1.0,
  "cost_usd": 0.02,
  "error_message": null,
  "queued_at": "2026-04-03T12:34:56",
  "started_at": "2026-04-03T12:35:01",
  "completed_at": "2026-04-03T12:35:30"
}

Status values: queuedloading_modelprocessingcompleted or failed

Stream job progress (SSE)

GET /v1/jobs/{job_id}/stream?key=YOUR_KEY

Server-Sent Events stream with real-time step-by-step progress updates. Connect with any SSE client:

curl -N "https://selenix.go.ro/v1/jobs/550e8400.../stream?key=YOUR_KEY"

Events: processing (with step/total), completed (with output URLs), failed, ping (keep-alive).

Stream all your jobs (SSE)

GET /v1/jobs/stream/user?key=YOUR_KEY

A global SSE stream for all your jobs. Useful for dashboards and real-time notifications across multiple generations.

List active jobs

GET /v1/jobs/active

curl https://selenix.go.ro/v1/jobs/active \
  -H "Authorization: Bearer YOUR_KEY"

Returns your jobs that are currently queued, loading_model, or processing.

Estimate wait time

GET /v1/jobs/estimate?workflow_id=flux2-dev:txt2img

curl "https://selenix.go.ro/v1/jobs/estimate?workflow_id=flux2-dev:txt2img"
{"avg_seconds": 25.3, "sample_count": 142}

Average processing time based on recent completed jobs. No auth required.

Credits & Usage

Get your API key

Register an account to receive $2.00 in free credits (~100 images or ~50 seconds of video). Your API key is available on the API Keys page.

You can create multiple API keys and label them for different projects. All keys share the same account balance.

Check your balance

GET /v1/credits

curl https://selenix.go.ro/v1/credits \
  -H "Authorization: Bearer YOUR_KEY"
{"balance_usd": 1.85, "is_trial": true, "last_used_at": "2026-04-03T12:00:00Z"}

Usage history

GET /v1/usage?limit=50

curl https://selenix.go.ro/v1/usage \
  -H "Authorization: Bearer YOUR_KEY"
{
  "usage": [
    {
      "job_type": "image",
      "model_id": "flux2-dev",
      "units": 1.0,
      "cost_usd": 0.02,
      "prompt_preview": "a cat on a windowsill at golden...",
      "ts": "2026-04-03T12:35:30Z"
    }
  ]
}

Queue & Health

Queue status

GET /v1/queue/status — No auth required

curl https://selenix.go.ro/v1/queue/status
{"status": "idle", "queue_running": 0, "queue_pending": 0, "estimated_wait_seconds": 0}

Health check

GET /health — No auth required

curl https://selenix.go.ro/health
{"status": "ok", "comfyui": "up", "lmstudio": "up", "vram_free_gb": 28.5}

Error Codes

CodeMeaningWhat to do
400Invalid parametersCheck dimensions, steps, frame count, or file count
401Missing or invalid API keyInclude Authorization: Bearer YOUR_KEY header
402Insufficient creditsTop up your balance
403File not accessibleYou can only use your own uploads/outputs as input_files
409Trial already existsUse the key from your original trial, or purchase credits
413Upload too largeMax file size is 20 MB
504Generation timed outTry again. Complex prompts or high step counts take longer
500Generation failedCredits are automatically refunded on failure
Automatic refunds: If a generation fails for any reason (timeout, GPU error, internal error), the cost is automatically refunded to your balance. No action needed.

Pricing

Per-unit costs

TypeCostNotes
Image (Flux.2)$0.02 per imageAny resolution, any step count
Video (LTX-2.3)$0.04 per secondDuration = num_frames / 24 fps

Credit tiers

TierPrice~Images~Video
Free trial$2.00~100~50 seconds
Starter$5.00~250~125 seconds
Pro$20.00~1,000~500 seconds
Max$50.00~2,500~1,250 seconds

Questions? Contact us or check /health for system status.