Перейти к основному содержанию

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/nano-banana-proСоздание задачи генерации
GET/api/v1/statusTask/nano-banana-proЗапрос статуса задачи

Authentication

Все запросы требуют API Key в заголовке:
Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "text-to-image",
    "prompt": "...",
    "aspect_ratio": "16:9",
    "resolution": "2K",
    "image_urls": ["..."],
    "output_format": "png"
  }
}

Parameters

request_type
string
по умолчанию:"async"
async (polling) или callback (webhook)
callback_url
string
Callback URL, обязателен при request_type=callback (условно)
provider
string
по умолчанию:"auto"
Стратегия маршрутизации: auto, value или official
input
object
обязательно
Параметры входа модели
Mode Options:
  • text-to-image — Генерация по текстовому описанию
  • image-to-image — Генерация с эталонными изображениями

Example

Text-to-Image
curl -X POST "https://api.apixo.ai/api/v1/generateTask/nano-banana-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "provider": "value",
    "input": {
      "mode": "text-to-image",
      "prompt": "a cozy cyberpunk cafe with neon lights, ultra detailed",
      "aspect_ratio": "3:2",
      "resolution": "2K",
      "output_format": "png"
    }
  }'
Image-to-Image (Multiple References)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/nano-banana-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/callback",
    "provider": "official",
    "input": {
      "mode": "image-to-image",
      "prompt": "combine these styles into a futuristic cityscape",
      "aspect_ratio": "16:9",
      "resolution": "4K",
      "image_urls": [
        "https://example.com/ref1.jpg",
        "https://example.com/ref2.jpg",
        "https://example.com/ref3.jpg"
      ],
      "output_format": "jpeg"
    }
  }'

Response

POST /api/v1/generateTask/nano-banana-pro

При успехе возвращает taskId для последующих запросов статуса. Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Error:
{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/nano-banana-pro

Запрос статуса выполнения задачи и результатов по taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/nano-banana-pro?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/image.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines"
  }
}

Status Response Fields

taskId
string
Уникальный идентификатор задачи.
state
string
Текущее состояние задачи: pending, processing, success или failed.
resultJson
string
JSON-строка с массивом resultUrls. Присутствует только при success. Парсите через JSON.parse().
failCode
string
Код ошибки. Присутствует только при state=failed. См. Error Codes.
failMsg
string
Читаемое сообщение об ошибке. Присутствует только при state=failed.
createTime
integer
Timestamp создания задачи (Unix миллисекунды).
completeTime
integer
Timestamp завершения задачи (Unix миллисекунды).
costTime
integer
Длительность обработки в миллисекундах.

Error Codes

CodeDescription
400Неверные параметры или ошибка запроса
401Недействительный или отсутствующий API Key
429Превышен лимит запросов
Fail CodeDescription
CONTENT_VIOLATIONКонтент нарушает правила безопасности
INVALID_IMAGE_URLНе удаётся получить доступ к URL изображения

Rate Limits

LimitValue
Requests10000 / minute
Concurrent tasks1000
При превышении возвращается ошибка 429. Подождите и повторите.

Tips

  • Generation time:
    • 1K resolution: ~20-30 seconds
    • 2K resolution: ~30-45 seconds
    • 4K resolution: ~45-60 seconds
    • Submit task, wait 20 seconds, then poll every 3 seconds
  • Pro advantages:
    • Up to 4K resolution output
    • Up to 10 reference images
    • Richer details, higher quality
  • Callback mode: For high-concurrency or high-resolution generation, use callback mode.
  • Image expiration: Result URLs are valid for 15 days. Скачивайте и сохраняйте важные результаты вовремя.
  • Content moderation: Prompts must comply with content safety guidelines. Violations return CONTENT_VIOLATION.
  • Resolution selection:
    • 1K: Fast generation, for previews and social media
    • 2K: Balanced quality and speed, for most scenarios
    • 4K: Highest quality, for printing and professional use
  • Aspect ratio selection:
    • 1:1: Square, for avatars
    • 16:9: Landscape, for desktop wallpapers
    • 9:16: Portrait, for mobile wallpapers
    • 21:9: Ultra-wide, for banner ads
  • Format selection:
    • png: Lossless, supports transparency, larger file (default)
    • jpeg: Lossy compression, smaller file; use for 4K to reduce file size
  • Multiple reference fusion:
    • Supports up to 10 reference images
    • Model intelligently combines style, composition, and color
    • More references = more complex fusion
    • 2-5 references recommended for best results
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.
  • Prompt tips: For high-resolution output, add “ultra detailed”, “high quality” to prompts for better details.

Result URLs expire after 15 days. Скачивайте и сохраняйте важные результаты вовремя. При высокой конкуренции используйте режим callback вместо частого polling.