enAPI Reference

API Reference

This page provides documentation for ImagineoAI’s REST API, allowing developers to programmatically generate images, manage models, and integrate ImagineoAI into their applications.

Authentication

All API requests require authentication using API keys. To obtain an API key:

  1. Log in to your ImagineoAI account
  2. Navigate to Settings > API Keys
  3. Click “Create New API Key”
  4. Store your API key securely - it won’t be shown again

Include your API key in all requests by setting the X-API-Key header:

X-API-Key: your-api-key

Base URL

All API endpoints are relative to:

https://api.imagineoai.com/v1

Endpoints

Generate Image

Generate a new image using your custom LoRA models.

Endpoint: POST /generate

Request Body:

{
  "positive_prompt": "A blue ceramic coffee mug on a wooden table",
  "negative_prompt": "blurry, low quality",
  "model_id": "your-model-id",
  "lora_weight": 0.8,
  "guidance": 7.5,
  "width": 1024,
  "height": 1024
}

Response:

{
  "run_id": "gen_123456789",
  "status": "queued",
  "estimated_time": 20
}

Get Generation Status

Check the status of an image generation request.

Endpoint: GET /generations/{run_id}

Response:

{
  "run_id": "gen_123456789",
  "status": "completed",
  "progress": 100,
  "image_url": "https://imagineoai.com/images/gen_123456789.png"
}

List Models

Retrieve all models available to your account.

Endpoint: GET /models

Response:

{
  "models": [
    {
      "id": "model_123",
      "name": "Coffee Machine LoRA",
      "description": "Custom LoRA for coffee machines",
      "created_at": "2023-09-15T14:22:31Z"
    },
    {
      "id": "model_456",
      "name": "Office Chair LoRA",
      "description": "Custom LoRA for ergonomic office chairs",
      "created_at": "2023-10-02T09:15:43Z"
    }
  ]
}

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Not Found
  • 429: Too Many Requests
  • 500: Server Error

Error responses include a message field with details:

{
  "error": {
    "code": "invalid_parameter",
    "message": "Invalid value for parameter 'guidance'. Must be between 1 and 20."
  }
}

Rate Limits

API requests are subject to rate limiting based on your subscription plan. Current limits are:

  • Free tier: 10 requests per minute
  • Basic tier: 30 requests per minute
  • Premium tier: 100 requests per minute

Rate limit information is included in response headers:

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 25
X-RateLimit-Reset: 1623834827

SDK Libraries

We provide official SDK libraries for popular programming languages:

Coming Soon

We’re actively working on additional API endpoints for:

  • Upscaling generated images
  • Creating image variations
  • Managing user access and permissions
  • Bulk operations

Stay tuned for updates to our API documentation.