Reve Art Image API Documentation

Learn how to integrate Reve Art image generation into your application

Authentication

All API requests require authentication using an API key.

Add the API key to the Authorization header:

curl -X POST https://reve-art.com/v1/reve-image/generate \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "your prompt here", "aspect_ratio": "1:1"}'

How to get API Key

Please login and add your api-key in the Dashboard > API Key page.

Then use the api-key to generate images.

Generate Image

POST /v1/images/generate

Request Body

{
  "prompt": "string",           // Required: The image generation prompt
  "negative_prompt": "string",  // Optional: Things to avoid in the image
  "aspect_ratio": "string",    // Required: Image aspect ratio (default: "1:1")
  "async": boolean           // Optional: Async generation (default: false)
}

Aspect Ratio

The aspect ratio of the image. Supported ratios: "1:1", "16:9", "4:3", "3:4", "9:16", "2:3", "3:2".

Synchronous Response

{
  "id": "img_123",
  "status": "completed",
  "url": "https://cdn.reve-art.com/img_123.png",
  "metadata": {
    "prompt": "your prompt",
    "width": 1024,
    "height": 1024,
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Asynchronous Response

{
  "id": "img_123",
  "status": "pending"
  }

Example Usage

Python

import requests

api_key = "your_api_key"
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.post(
    "https://api.reve-art.com/v1/reve-image/generate",
    headers=headers,
    json={
        "prompt": "a beautiful sunset over mountains",
        "aspect_ratio": "16:9"
        }
)

if response.ok:
    result = response.json()
    print(f"Image URL: {result['url']}")
else:
    print(f"Error: {response.text}")

Node.js

async function generateImage(prompt: string) {
    const response = await fetch("https://api.reve-art.com/v1/reve-image/generate", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        prompt,
        aspect_ratio: "1:1",
        async: true,
      }),
    });

    if (!response.ok) {
      throw new Error(`Failed to generate image: ${response.statusText}`);
    }

    const result = await response.json();
    
    if (result.status === "pending") {
      // Poll for completion
      return await checkImageStatus(result.id);
    }

    return result;
  }

Check Image Status

GET /v1/reve-image/status/{image_id}

Response

{
  "id": "img_123",
  "status": "completed",
  "url": "https://cdn.reve-art.com/img_123.png",
  "metadata": {
    "prompt": "original prompt",
    "width": 1024,
    "height": 1024,
    "model": "text2image_v1",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Example Usage

async function checkImageStatus(imageId: string) {
    const response = await fetch(
      `https://reve-art.com/v1/reve-image/status/${imageId}/`,
      {
        headers: {
          "Authorization": `Bearer ${apiKey}`,
        },
      }
    );

    if (!response.ok) {
      throw new Error(`Failed to check status: ${response.statusText}`);
    }

    return await response.json();
  }

Rate Limits

API requests are limited by your subscription plan and available credits.

  • Each image generation costs 1 credit
  • Free plan: 3 credits included
  • Basic plan: 100 credits per month
  • Rate limit: 10 requests per minute
  • If you need more credits, please upgrade your plan or buy more credits.