AigenwayDocumentation

Getting started

Five steps from zero to your first generation.

Need text models or embeddings? See the Gemini 2.5 + text-embedding-004 guide — cURL recipes for chat, structured JSON, function calling and batch embedding.
  1. Register an account and verify your email.
  2. Create an API key in your dashboard. The plaintext is shown once — store it safely.
  3. Top up your balance via the Top-up page.
  4. Call POST /v1/estimate to preview the cost of a request.
  5. Call POST /v1/generations with an Idempotency-Key header to start a generation.

Estimate cost

curl -X POST https://api.aigenway.com/v1/estimate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google_banana",
    "model": "gemini-3.1-flash-image-preview",
    "method": "text_to_image",
    "params": { "prompt": "a cat" }
  }'

Create a generation

Image

curl -X POST https://api.aigenway.com/v1/generations \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google_banana",
    "model": "gemini-3.1-flash-image-preview",
    "method": "text_to_image",
    "params": { "prompt": "a cat" },
    "coupon": "WELCOME10",
    "callback_url": "https://your-host.example.com/webhooks/aigenway"
  }'

Text (Gemini 2.5)

curl -X POST https://api.aigenway.com/v1/generations \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google_banana",
    "model": "gemini-2.5-flash",
    "method": "text_generation",
    "params": {
      "prompt": "Объясни в одно предложение, что такое HTTP/3.",
      "temperature": 0.4,
      "max_output_tokens": 200
    }
  }'

Structured JSON, function calling and response shape — in the Gemini guide.

Embedding

curl -X POST https://api.aigenway.com/v1/generations \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google_banana",
    "model": "text-embedding-004",
    "method": "embedding",
    "params": {
      "inputs": ["первый текст", "второй текст"],
      "task_type": "RETRIEVAL_DOCUMENT"
    }
  }'

docs.gsGenerationsOptionalsBody

docs.gsMethodsListTitle

docs.gsMethodsListBody

curl https://api.aigenway.com/v1/methods?provider=google_banana \
  -H "Authorization: Bearer sk_live_..."

docs.gsBalanceTitle

docs.gsBalanceBody

curl https://api.aigenway.com/v1/balance \
  -H "Authorization: Bearer sk_live_..."

docs.gsPricesTitle

docs.gsPricesBody

curl "https://api.aigenway.com/v1/prices?provider=google_banana&pageSize=50" \
  -H "Authorization: Bearer sk_live_..."