Dev Docs

Developer Documentation

Integrate ImagineLab's image, video, voice, music, and infographic generation into your own apps and workflows. This reference covers authentication, the generation lifecycle, credits, and error handling.

Base URL: https://api.imagineview.art/api/v1Auth: Bearer token

Introduction

The ImagineLab API is a REST API over HTTPS. All requests go to https://api.imagineview.art/api/v1, accept and return JSON, and are authenticated with a bearer token. Generation is asynchronous: you create a job, then poll its status until the outputs are ready.

Programmatic access

Dedicated API keys ship with the Ultimate Visionary Studio and Titan Studio plans. Until your key is issued you can authenticate with the bearer token returned by the login endpoint below.

Getting Started

  1. Create an account and buy a credit package (every generation spends credits).
  2. Get a bearer token from POST /auth/login.
  3. Create a generation with POST /generations.
  4. Poll GET /generations/{id}/status until it is completed.
  5. Read the result from GET /generations/{id}.

Authentication

Exchange your email and password for an access token. The login endpoint follows the OAuth2 password flow, so the body is x-www-form-urlencoded with username (your email) and password.

POST/auth/login
cURL
curl -X POST https://api.imagineview.art/api/v1/auth/login \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=you@example.com&password=YOUR_PASSWORD"
Response
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer"
}

Send the token in the Authorization header on every protected request:

Authorization: Bearer YOUR_ACCESS_TOKEN

Other auth routes: POST /auth/signup, GET /auth/me, POST /auth/forgot-password.

Generations

A generation is an async job. Creating one immediately reserves its credit cost and returns a record with status: "pending". The job then moves through processing to completed or failed.

List available models

GET/generations/models

Create a generation

POST/generations

Request body:

JSON
{
  "generation_type": "image",        // image | video | voice | music | infographic | text
  "model_name": "seedream-5.0-lite", // from /generations/models
  "prompt": "A neon city skyline at dusk, ultra-detailed",
  "settings": { "aspect_ratio": "16:9" },  // type-specific, optional
  "project_id": null                  // optional: tag to a project
}
cURL
curl -X POST https://api.imagineview.art/api/v1/generations \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "generation_type": "image",
    "model_name": "seedream-5.0-lite",
    "prompt": "A neon city skyline at dusk"
  }'
Response
{
  "id": 1842,
  "user_id": 17,
  "generation_type": "image",
  "model_name": "seedream-5.0-lite",
  "prompt": "A neon city skyline at dusk",
  "status": "pending",
  "credit_cost": 5,
  "created_at": "2026-06-07T12:00:00Z",
  "outputs": []
}

Poll status

GET/generations/{id}/status
Response
{ "id": 1842, "status": "completed", "progress": 100 }

Fetch the result

GET/generations/{id}

Returns the full generation with an outputs array (media URLs or text). Also useful: GET /generations (history, paginated) and DELETE /generations/{id}.

End-to-end example

Python
import time, requests

BASE = "https://api.imagineview.art/api/v1"

# 1. Login
tok = requests.post(f"{BASE}/auth/login", data={
    "username": "you@example.com", "password": "YOUR_PASSWORD",
}).json()["access_token"]
H = {"Authorization": f"Bearer {tok}"}

# 2. Create
gen = requests.post(f"{BASE}/generations", headers=H, json={
    "generation_type": "image",
    "model_name": "seedream-5.0-lite",
    "prompt": "A neon city skyline at dusk",
}).json()
gid = gen["id"]

# 3. Poll
while True:
    s = requests.get(f"{BASE}/generations/{gid}/status", headers=H).json()
    if s["status"] in ("completed", "failed"):
        break
    time.sleep(2)

# 4. Result
out = requests.get(f"{BASE}/generations/{gid}", headers=H).json()
print(out["outputs"])

Credits & Wallet

Every generation spends credits from your wallet. Creating a job fails with 402 if your balance is too low.

GET/credits/wallet
GET/credits/packages
Generation typeCost (credits)
text2
voice3
image5
music8
infographic10
video15

Costs are indicative and may vary by model.

Errors & Limits

The API uses standard HTTP status codes. Error responses contain a detail message.

CodeMeaning
200 / 201Success
400Bad request — invalid or missing fields
401Missing or invalid bearer token
402Insufficient credits
404Resource not found
429Rate limited — slow down
500 / 502Server or upstream model error
Error response
{ "detail": "Insufficient credits" }

Need integration help?

For API keys, enterprise, or white-label integrations, reach out to our team.