API для автоматизации

Создавайте API-ключи для работы с изображениями, генерацией, превью кадров, редактированием, избранным и рендерами.

Ваши API-ключи

Ключ даёт доступ к вашим стилям, изображениям, анимациям, превью кадров, избранному, правкам и рендерам. Полное значение показывается только один раз.

Загрузка...

Документация

Генерация, редактирование и рендер выполняются асинхронно: запустите задачу и опрашивайте её статус.

GET/api/v1/styles

Возвращает готовые стили и стили текущего пользователя. Используйте id выбранного стиля при генерации.

Request
GET /api/v1/styles HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "items": [
    {
      "id": "modern-apple-dark",
      "name": "Modern Apple Dark",
      "description": "Sleek, clean, and premium dark mode design.",
      "source": "default",
      "fonts": {
        "heading": "Inter, system-ui, sans-serif",
        "body": "Inter, system-ui, sans-serif",
        "mono": "JetBrains Mono, monospace"
      },
      "colors": {
        "background": "#000000",
        "surface": "#1C1C1E",
        "primary": "#2997FF",
        "secondary": "#E5E5EA",
        "accent": "#FF453A",
        "text": "#F5F5F7",
        "muted": "#98989D"
      },
      "style_prompt": "Emulate modern Apple keynotes in dark mode..."
    }
  ]
}
curl
curl -s "https://chertila.app/api/api/v1/styles" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
GET/api/v1/images

Возвращает постраничную медиатеку пользователя с временными подписанными URL оригиналов и превью.

Request
GET /api/v1/images?page=1&page_size=24 HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "items": [
    {
      "id": "a9a01df4-8397-4307-a198-d384eb060c7d",
      "original_filename": "diagram.png",
      "content_type": "image/png",
      "width": 1600,
      "height": 900,
      "file_size": 248120,
      "url": "https://signed-r2-url.example/original",
      "thumbnail_url": "https://signed-r2-url.example/thumbnail",
      "created_at": "2026-08-17T10:00:00Z"
    }
  ],
  "page": 1,
  "page_size": 24,
  "total": 1,
  "total_pages": 1
}
curl
curl -s "https://chertila.app/api/api/v1/images?page=1&page_size=24" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
POST/api/v1/images

Загружает PNG, JPEG, WebP или GIF в приватную медиатеку пользователя в R2.

Request
POST /api/v1/images HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: multipart/form-data

file=@./diagram.png
Response
HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "a9a01df4-8397-4307-a198-d384eb060c7d",
  "original_filename": "diagram.png",
  "content_type": "image/png",
  "width": 1600,
  "height": 900,
  "file_size": 248120,
  "url": "https://signed-r2-url.example/original",
  "thumbnail_url": "https://signed-r2-url.example/thumbnail",
  "created_at": "2026-08-17T10:00:00Z"
}
curl
curl -s -X POST "https://chertila.app/api/api/v1/images" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -F "file=@./diagram.png"
POST/api/v1/images/resolve

Обновляет метаданные и подписанные URL максимум для 10 image asset id, сохраняя порядок запроса.

Request
POST /api/v1/images/resolve HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: application/json

{
  "ids": ["a9a01df4-8397-4307-a198-d384eb060c7d"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "items": [
    {
      "id": "a9a01df4-8397-4307-a198-d384eb060c7d",
      "original_filename": "diagram.png",
      "content_type": "image/png",
      "width": 1600,
      "height": 900,
      "file_size": 248120,
      "url": "https://signed-r2-url.example/original",
      "thumbnail_url": "https://signed-r2-url.example/thumbnail",
      "created_at": "2026-08-17T10:00:00Z"
    }
  ]
}
curl
curl -s -X POST "https://chertila.app/api/api/v1/images/resolve" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids":["a9a01df4-8397-4307-a198-d384eb060c7d"]}'
POST/api/v1/animations

Запускает генерацию анимации по промпту и id стиля. Списывает кредиты как обычная генерация.

Request
POST /api/v1/animations HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: application/json

{
  "prompt": "Explain cash flow with a waterfall chart.",
  "style_id": "modern-apple-dark",
  "title": "Cash flow waterfall",
  "voiceover_script": "Optional narration text",
  "image_asset_ids": ["a9a01df4-8397-4307-a198-d384eb060c7d"]
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json

{
  "generation_id": "2f0c4e5c-8a31-44f8-9b19-1b05d9027c9b",
  "status": "queued",
  "status_url": "https://chertila.app/api/api/v1/generations/2f0c4e5c-8a31-44f8-9b19-1b05d9027c9b"
}
curl
curl -s -X POST "https://chertila.app/api/api/v1/animations" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Explain cash flow with a waterfall chart.","style_id":"modern-apple-dark","image_asset_ids":["a9a01df4-8397-4307-a198-d384eb060c7d"]}'
GET/api/v1/generations/{generation_id}

Возвращает статус генерации. Когда задача завершена, в ответе есть animation_url для просмотра в браузере.

Request
GET /api/v1/generations/{generation_id} HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "generation_id": "2f0c4e5c-8a31-44f8-9b19-1b05d9027c9b",
  "status": "completed",
  "error": null,
  "animation_id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "animation_url": "https://chertila.app/animation/7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2"
}
curl
curl -s "https://chertila.app/api/api/v1/generations/$GENERATION_ID" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
GET/api/v1/animations

Возвращает анимации пользователя. Передайте favorites_only=true, чтобы получить только избранные.

Request
GET /api/v1/animations?favorites_only=true&limit=50&offset=0 HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "items": [
    {
      "id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
      "prompt_preview": "Explain cash flow with a waterfall chart.",
      "prompt_truncated": false,
      "title": "Cash flow waterfall",
      "current_version_id": "ba9ad4d2-f88a-4ac2-ad9c-14fd6cbe47de",
      "is_favorite": true,
      "image_asset_ids": ["a9a01df4-8397-4307-a198-d384eb060c7d"],
      "animation_url": "https://chertila.app/animation/7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
      "created_at": "2026-08-17T10:05:00Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
curl
curl -s "https://chertila.app/api/api/v1/animations?favorites_only=true&limit=50&offset=0" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
GET/api/v1/animations/{animation_id}

Возвращает анимацию пользователя, флаг избранного, текущую версию и выбранные image asset id.

Request
GET /api/v1/animations/{animation_id} HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "prompt_preview": "Explain cash flow with a waterfall chart.",
  "prompt_truncated": false,
  "title": "Cash flow waterfall",
  "current_version_id": "ba9ad4d2-f88a-4ac2-ad9c-14fd6cbe47de",
  "is_favorite": true,
  "image_asset_ids": ["a9a01df4-8397-4307-a198-d384eb060c7d"],
  "animation_url": "https://chertila.app/animation/7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "created_at": "2026-08-17T10:05:00Z"
}
curl
curl -s "https://chertila.app/api/api/v1/animations/$ANIMATION_ID" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
GET/api/v1/animations/{animation_id}/frame

Синхронно рендерит точный PNG-кадр по time_ms для vision-проверки до полного рендера видео. Не передавайте version_id для текущей версии или укажите id версии из правки.

Request
GET /api/v1/animations/{animation_id}/frame?time_ms=2500&version_id={version_id}&resolution=720p HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: no-store
X-Chertila-Animation-Id: 7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2
X-Chertila-Version-Id: ba9ad4d2-f88a-4ac2-ad9c-14fd6cbe47de
X-Chertila-Time-Ms: 2500
X-Chertila-Duration-Ms: 12000
X-Chertila-Width: 1280
X-Chertila-Height: 720

(PNG binary)
curl
curl -s "https://chertila.app/api/api/v1/animations/$ANIMATION_ID/frame?time_ms=2500&version_id=$VERSION_ID&resolution=720p" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  --output frame-2500ms.png
PUT/api/v1/animations/{animation_id}/favorite

Добавляет анимацию в избранное или удаляет её оттуда.

Request
PUT /api/v1/animations/{animation_id}/favorite HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: application/json

{
  "is_favorite": true
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "is_favorite": true
}
curl
curl -s -X PUT "https://chertila.app/api/api/v1/animations/$ANIMATION_ID/favorite" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"is_favorite":true}'
POST/api/v1/animations/{animation_id}/edits

Запускает правку текущей или указанной версии. Не передавайте image_asset_ids для наследования, передайте [] для удаления всех или до 10 id для замены набора.

Request
POST /api/v1/animations/{animation_id}/edits HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: application/json

{
  "instruction": "Replace the diagram and make the labels larger.",
  "base_version_id": "ba9ad4d2-f88a-4ac2-ad9c-14fd6cbe47de",
  "image_asset_ids": ["a9a01df4-8397-4307-a198-d384eb060c7d"]
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json

{
  "edit_id": "859bf645-6793-4050-87fe-bd83dd4531e2",
  "status": "queued",
  "status_url": "https://chertila.app/api/api/v1/edits/859bf645-6793-4050-87fe-bd83dd4531e2"
}
curl
curl -s -X POST "https://chertila.app/api/api/v1/animations/$ANIMATION_ID/edits" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"instruction":"Replace the diagram and make the labels larger.","image_asset_ids":["a9a01df4-8397-4307-a198-d384eb060c7d"]}'
GET/api/v1/edits/{edit_id}

Возвращает статус правки и id новой версии после завершения.

Request
GET /api/v1/edits/{edit_id} HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "edit_id": "859bf645-6793-4050-87fe-bd83dd4531e2",
  "status": "completed",
  "error": null,
  "animation_id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "version_id": "6d864c3c-ea75-4f9c-8fbb-0be5ab079ae0",
  "animation_url": "https://chertila.app/animation/7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2"
}
curl
curl -s "https://chertila.app/api/api/v1/edits/$EDIT_ID" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"
POST/api/v1/animations/{animation_id}/renders

Запускает рендер текущей версии анимации в выбранном разрешении и формате.

Request
POST /api/v1/animations/{animation_id}/renders HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Content-Type: application/json

{
  "resolution": "1080p",
  "format": "mp4"
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json

{
  "render_id": "f16f8551-b28b-462c-9fa1-3ae528d68db1",
  "status": "queued",
  "status_url": "https://chertila.app/api/api/v1/renders/f16f8551-b28b-462c-9fa1-3ae528d68db1",
  "resolution": "1080p",
  "format": "mp4"
}
curl
curl -s -X POST "https://chertila.app/api/api/v1/animations/$ANIMATION_ID/renders" \
  -H "Authorization: Bearer $CHERTILA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resolution":"1080p","format":"mp4"}'
GET/api/v1/renders/{render_id}

Возвращает статус рендера. Когда файл готов, в ответе есть секретная file_url без авторизации.

Request
GET /api/v1/renders/{render_id} HTTP/1.1
Authorization: Bearer $CHERTILA_API_KEY
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "render_id": "f16f8551-b28b-462c-9fa1-3ae528d68db1",
  "status": "completed",
  "error": null,
  "animation_id": "7a6cb25d-4b0f-4a67-bc78-cdd0d11de9d2",
  "resolution": "1080p",
  "format": "mp4",
  "file_url": "https://chertila.app/api/api/v1/files/renders/xkx6f5HqN5Oq99fFMXlIwr2W8WZTlDcF8v6MZd5EqVY"
}
curl
curl -s "https://chertila.app/api/api/v1/renders/$RENDER_ID" \
  -H "Authorization: Bearer $CHERTILA_API_KEY"