> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elumenta.ru/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Tools

> Upscale, Face Swap, Remove BG, Style Transfer, Colorize, InPaint, OCR — all on Starter tier

All AI tools are available on the **Starter tier** (no subscription required). Cost: 1–3 tokens.

## Available Tools

| Slug             | Name           | Tokens | Description                          |
| ---------------- | -------------- | ------ | ------------------------------------ |
| `upscale`        | Upscale ESRGAN | 1      | 2×/4× image upscaling                |
| `face-swap`      | Face Swap      | 1      | Swap faces between two images        |
| `remove-bg`      | Remove BG      | 1      | Remove background from any image     |
| `style-transfer` | Style Transfer | 1      | Apply artistic style to an image     |
| `colorize`       | Colorize       | 1      | Colorize black-and-white photos      |
| `inpaint`        | InPaint Edit   | 3      | Edit a selected region by repainting |
| `text-ocr`       | Text OCR       | 1      | Extract text from images             |

## Request Format

Tools use the same `POST /api/v2/generate` endpoint. Pass the tool slug as `model` and the image URL in `params`:

```bash theme={null}
curl -X POST https://elumenta.ru/api/v2/generate \
  -H "Authorization: Bearer nb_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "remove-bg",
    "prompt": "remove background",
    "params": {
      "image_url": "https://example.com/photo.jpg"
    }
  }'
```

## Code Examples

<CodeGroup>
  ```python Remove Background theme={null}
  import requests

  res = requests.post(
      "https://elumenta.ru/api/v2/generate",
      headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
      json={
          "model": "remove-bg",
          "prompt": "remove background",
          "params": {"image_url": "https://example.com/portrait.jpg"}
      }
  )
  print(res.json()["result_url"])
  ```

  ```python Upscale 4x theme={null}
  res = requests.post(
      "https://elumenta.ru/api/v2/generate",
      headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
      json={
          "model": "upscale",
          "prompt": "upscale",
          "params": {
              "image_url": "https://example.com/photo.jpg",
              "scale": 4
          }
      }
  )
  print(res.json()["result_url"])
  ```

  ```python Face Swap theme={null}
  res = requests.post(
      "https://elumenta.ru/api/v2/generate",
      headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
      json={
          "model": "face-swap",
          "prompt": "face swap",
          "params": {
              "source_image_url": "https://example.com/source_face.jpg",
              "target_image_url": "https://example.com/target.jpg"
          }
      }
  )
  print(res.json()["result_url"])
  ```

  ```python OCR — Extract Text theme={null}
  res = requests.post(
      "https://elumenta.ru/api/v2/generate",
      headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
      json={
          "model": "text-ocr",
          "prompt": "extract text",
          "params": {"image_url": "https://example.com/document.jpg"}
      }
  )
  print(res.json()["result_text"])
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "id": 18530,
  "status": "completed",
  "model_slug": "remove-bg",
  "result_url": "https://storage.elumenta.ru/generations/18530.png",
  "tokens_spent": 1,
  "processing_ms": 2140
}
```

<Tip>
  All tools process images immediately (synchronous). No polling needed — `status` will always be `completed` in the initial response.
</Tip>
