Start free

Leap API

AI image generation APINano Banana Pro, GPT Image 2, Seedream 5.0 Pro and 48 more, through one request

Send a model ID and its input to one endpoint and get back an image. Every call is priced in dollars before it runs, and a call that fails costs nothing.

  • One key for every model
  • Every call quoted first
  • A failed call costs nothing
curl https://api.tryleap.ai/v1/generations \  -H "x-api-key: $LEAP_API_KEY" \  -H "content-type: application/json" \  -H "prefer: wait=60" \  -d '{    "model": "google/nano-banana",    "input": {      "prompt": "A silk scarf in the wind on a ferry deck",      "aspect_ratio": "1:1"    }  }' # Video often outlasts the wait and answers "queued" or "running".# Put its "id" in GENERATION_ID and read it again until it is done:# curl https://api.tryleap.ai/v1/generations/$GENERATION_ID -H "x-api-key: $LEAP_API_KEY"

This runs Nano Banana. To run another image model, change model to its ID below and its input to match its schema.

Models

Every image model, one request

Each one by the ID the request takes, with what a call costs from its cheapest settings to its dearest, read from today's catalog.

How it works

How the AI image generation API works

Every model takes the same request, a model ID and its input, and results, prices, failures and limits work the same way for all of them.

  • Wait for it, or hear when it ends

    prefer: wait=60 holds the request until the result is ready, for up to a minute. A longer run is read again by its ID, or a signed webhook tells your server when it ends.

    prefer: wait=60 / "webhook": "https://..."

    In the docs
  • Failed calls cost nothing

    The price is held when a call starts and charged only if it succeeds. A failed or refused call comes back with its failure_cause, and the hold is released.

    "status": "failed" / "failure_cause": "provider_refused"

    In the docs
  • The price before the call

    POST /v1/quotes takes the same body as a generation and returns its exact price, with the input checked, for free. Every result carries what it was charged.

    POST https://api.tryleap.ai/v1/quotes / "cost_usd"

    In the docs
  • Rate limits

    600 requests a minute per API key and 300 per IP address. A 429 carries Retry-After with the seconds to wait.

    RateLimit-Remaining / Retry-After

    In the docs
  • Safe retries

    Send an idempotency key and a retry after a dropped connection returns the same generation instead of starting a second one.

    idempotency-key: <uuid>

    In the docs
  • Batches

    POST /v1/batches starts up to 50 calls in one request, priced and held together, so either all start or none do.

    POST https://api.tryleap.ai/v1/batches

    In the docs

MCP

Or let your agent call it.

Leap's MCP server lets Claude Code, Claude, VS Code and other MCP clients run any image model, read its inputs and fetch the result, on your balance. Signing in happens in the browser, so there is no key to paste.

Add Leap to Claude Code
claude mcp add --transport http leap https://app.tryleap.ai/api/mcp

Claude Code signs you in through the browser the first time it calls Leap.

Teach your coding agent the Leap API
curl -fsSL https://www.tryleap.ai/install.sh | sh

Installs the Leap skill for every coding agent it finds: which endpoint to call, how to read a model's inputs, when to wait and when to poll.

Questions

AI image generation API questions

Which models does Leap's AI image generation API run?
51 image models, among them Nano Banana, Nano Banana Pro, GPT Image 2, Nano Banana 2 and Seedream 5.0 Pro. Each has its own ID and input schema, and the request is the same for all of them: change the model and its input to switch.
How much does a image cost through the API?
At each model's default settings, from $0.0033 with FLUX.1 [schnell] to $0.231 with Recraft V4.1 Pro. Prices are the provider's list price plus 10%, and POST /v1/quotes gives the exact price of any input for free.
Do I pay for generations that fail?
No. The price is held when a call starts and charged only if it succeeds. A call that fails, or that the model's safety filter refuses, is not charged.
How fast does an image come back?
Most images finish within the request: send prefer: wait=60 and the answer holds the result. A run still going after a minute comes back queued or running, and you read it again by its ID.
Is there a free trial?
Sign up with a Gmail, Outlook or work address and your workspace starts with $2 of credit, no card needed. After that you pay per call from one balance in dollars, with no subscription.
Can an AI agent use it?
Yes. Leap's MCP server lets Claude Code, Claude, VS Code and other MCP clients find a image model, read its inputs, run it and fetch the result, on your balance.

Every image model, one API.

Start with $2 of credit, no card. One key runs every model on Leap.

Get an API key