---
title: "IMG.LY AI Gateway — One API for Every Generative Model"
description: "One API for generative image, video, text, and voice models — fully managed and built for editors on IMG.LY SDK."
url: "https://img.ly/ai-gateway/"
type: "page"
---

> This is the markdown version of [IMG.LY AI Gateway — One API for Every Generative Model](https://img.ly/ai-gateway/). For all pages in one file, see [llms-full.txt](https://img.ly/llms-full.txt). For an index of all available pages, see [llms.txt](https://img.ly/llms.txt).

---

# IMG.LY AI Gateway: Add AI models to your editor. Without another SDK, vendor or invoice.

Image, video, text, and voice — today's flagship models, kept current for you. Fully managed, ready to drop into any editor or automation built on IMG.LY SDK.

- Image, video, text & voice models
- Fully managed, failover handled
- Built for IMG.LY SDK

[Read the docs](https://img.ly/docs/cesdk/js/user-interface/ai-integration/gateway-provider-06df22.md)

[Get started](https://img.ly/dashboard)

## Trusted by teams at **600+** creative product companies

IMG.LY powers creative products at HP, Shopify, Reuters, Hootsuite, Shutterfly and hundreds more.

**Trusted by:** Digitas, Omneky, The Print Bar, Brandwatch, Planoly, HP, Shopify, Reuters, Hootsuite, Semrush, Shutterfly, one.com, Sprout Social, Constant Contact, Spread Group

## One plugin. One invoice. Zero rewrites when models change.

Three shortcuts only AI Gateway can deliver, because it ships inside IMG.LY SDK, not next to it.

**Same SDK you already use.**

```typescript
import CreativeEditorSDK from '@cesdk/cesdk-js';
import ImageGeneration from '@imgly/plugin-ai-image-generation-web';
import { GatewayProvider as ImageGatewayProvider } from '@imgly/plugin-ai-image-generation-web/gateway';

const cesdk = await CreativeEditorSDK.create('#editor', { license: 'YOUR_LICENSE' });

cesdk.actions.register('ly.img.ai.getToken', async () => {
  const res = await fetch('/api/ai/token', { method: 'POST' });
  const { token } = await res.json();
  return token;
});

await cesdk.addPlugin(
  ImageGeneration({
    providers: {
      text2image: ImageGatewayProvider('bfl/flux-2', { debug: true }),
    },
  }),
);
```

### I: Built for IMG.LY SDK.

AI Gateway plugs into the same SDK your team already uses, speaks the same scene model, and drops into the same UI flows.

A sprint of integration becomes an afternoon.

### II: SDK, AI, and billing in one dashboard.

No second vendor portal, no second invoice.

API keys, usage, and per-project cost tracking sit next to your SDK license — one source of truth for finance and engineering.

### III: We manage the model churn.

New flagship models, deprecations, and upstream outages never reach your code.

You stay on one stable API; we keep what's behind it current, compatible, and routed around trouble.

## Built for the teams already building creative products on IMG.LY.

Every use case IMG.LY SDK already powers, now backed by AI models.

### Marketing & ad generation.

Generate on-brand creatives at scale inside a template-driven editor.

### E-commerce product imagery.

Swap backgrounds, generate lifestyle shots, and keep products consistent.

### Web-to-print personalization.

Let end users generate custom visuals, then output print-ready PDFs via CE.SDK.

### Social media & short video.

Drop gen-AI effects, captions, and variants into a Reels-style editor.

### In-editor AI assist.

Add "generate", "extend", and "retouch" buttons to any editor built on IMG.LY SDK.

### Creative automation.

Batch-generate thousands of asset variants, headlessly, with models swapped per job.

## AI models for images, video, text, and voice.

A curated, always-current set of today's flagship models. Pick by quality, speed, or cost. Switch whenever you want.

### Images

Text to Image (Generate images from a text prompt.), Image to Image (Transform an existing image with a text instruction.), Inpainting (Edit specific regions of an image while keeping the rest intact.), Style Transfer (Apply the visual style of one image to another.)

### Video

Text to Video (Generate video clips from a text prompt.), Image to Video (Animate a still image into a video clip.)

### Text

Prompt Expansion (Turn short ideas into richer, detailed prompts for better generations.), Copy Variants (Generate multiple versions of the same text in one call.), Smart Editing (Rewrite text in place — shorten, lengthen, or change tone.), Translation (Translate text between languages while preserving tone.)

### Voice

Text to Speech (Synthesize spoken audio from written text.), Speech to Text (Transcribe spoken audio into written text.)

## See it running.

This is the IMG.LY editor with AI Gateway wired in. Type a prompt, pick a model, watch it land in your scene.

[IMG.LY AI Gateway live demo](https://blog.img.ly/2026/03/imgly-ai-integrate-ai-editor-app-js-svelte-react.mp4)

[Try the live AI editor](https://img.ly/demos/ai-editor.md?mode=Design)

## Minutes, not sprints.

One endpoint. Consistent request/response across every model. Works from your server, your client, or directly inside IMG.LY SDK.

#### IMG.LY SDK

Step 1: Install the generation plugin

```bash
npm install @imgly/plugin-ai-image-generation-web
```

Step 2: Register the Gateway provider

```typescript
import ImageGeneration from '@imgly/plugin-ai-image-generation-web';
import { GatewayProvider as ImageGatewayProvider } from '@imgly/plugin-ai-image-generation-web/gateway';

cesdk.actions.register('ly.img.ai.getToken', async () => {
  const res = await fetch('/api/ai/token', { method: 'POST' });
  const { token } = await res.json();
  return token;
});

await cesdk.addPlugin(
  ImageGeneration({
    providers: {
      text2image: ImageGatewayProvider('bfl/flux-2', { debug: true }),
    },
  }),
);
```

[Read API Docs](https://img.ly/docs/cesdk/js/user-interface/ai-integration/gateway-provider-06df22.md)

#### cURL

Step 1: Set your API key

```bash
export IMGLY_API_KEY="your-key-here"
```

Step 2: Mint a short-lived token

```bash
curl -X POST https://gateway.img.ly/v1/tokens \
  -H "Authorization: Bearer $IMGLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sub":"user-123"}'
```

[Read API Docs](https://img.ly/docs/cesdk/js/user-interface/ai-integration/gateway-provider-06df22.md)

#### Backend

Step 1: Install Express

```bash
npm install express
```

Step 2: Mint tokens for the editor

```typescript
app.post('/api/ai/token', async (req, res) => {
  const response = await fetch('https://gateway.img.ly/v1/tokens', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.IMGLY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ sub: req.user?.id }),
  });
  const { token } = await response.json();
  res.json({ token });
});
```

[Read API Docs](https://img.ly/docs/cesdk/js/user-interface/ai-integration/gateway-provider-06df22.md)

## Pricing that gets cheaper as we get bigger.

Pay only for what you use. Every model is priced per request, per image, or per second of output, the same units you'd see upstream. The more volume AI Gateway handles across our customer base, the better our upstream terms get, and the better your pricing gets. Live per-model pricing is public.

AI Gateway gives you one endpoint and one bill across 21 models for image, video, audio, and text generation, each priced per request from real usage over the last 30 days. Text → Text models are billed per token; the price shown is a representative per-request estimate.

| Model | Type | Price / request |
| --- | --- | --- |
| Nano Banana 2 | Text → Image | $0.137 |
| Flux 2 | Text → Image | $0.0100 |
| Nano Banana Pro | Text → Image | $0.310 |
| v4.1 Vector | Text → Image | $0.085 |
| Flux 2 Klein 9b | Text → Image | $0.0071 |
| Seedream 4.5 | Text → Image | $0.048 |
| Flux 2 Max | Text → Image | $0.100 |
| Flux 2 Edit | Image → Image | $0.025 |
| Nano Banana Pro Edit | Image → Image | $0.321 |
| Nano Banana 2 Edit | Image → Image | $0.120 |
| GPT Image 2 Edit | Image → Image | $0.220 |
| Veo 3.1 Fast | Text → Video | $1.26 |
| Veo 3.1 Fast I2V | Image → Video | $1.20 |
| Eleven v3 TTS | Text → Speech | $0.019 |
| Scribe v2 | Speech → Text | $0.0099 |
| Claude Opus 4.6 | Text → Text | $0.00210 |
| Claude Sonnet 4.6 | Text → Text | $0.00126 |
| GPT 5.4 | Text → Text | $0.00119 |
| GPT 5.4 Mini | Text → Text | $0.00036 |
| Gemini 3.1 Pro Preview | Text → Text | $0.00095 |
| Gemini 3 Flash Preview | Text → Text | $0.00024 |

Full per-capability pricing is available at [https://img.ly/ai-pricing/](https://img.ly/ai-pricing.md).

## Get in touch: Add generative AI to your editor today.

Sign up for the IMG.LY dashboard, grab an API key, and start generating with any model on the gateway.

[Get started](https://img.ly/dashboard)

[Read the docs](https://img.ly/docs/cesdk/js/user-interface/ai-integration/gateway-provider-06df22.md)

## Frequently Asked Questions

### General

**Q: Do I need to be on IMG.LY SDK to use AI Gateway?**

A: AI Gateway is built for IMG.LY SDK customers and is tightly integrated with the editor. You can call it as a standalone API, but the fit is strongest when paired with the SDK. Talk to us if you're evaluating both.

**Q: Which models are available?**

A: A curated set of image, video, text, and voice models. Today's flagships, refreshed as new ones ship. See the full live list in the dashboard.

**Q: Where does inference run? Who handles the models?**

A: We partner with best-in-class inference providers and manage the plumbing — routing, upgrades, deprecations, and failover. You call one stable API.

**Q: How does pricing work?**

A: Usage-based. Priced per request, per image, or per second of output depending on the model, with no hidden fees beyond published rates. Live pricing in the dashboard.

**Q: Is my content sent to third parties?**

A: Content is forwarded to the selected upstream provider to serve your request. We do not retain content beyond what's needed for delivery and billing. Data handling details are in our documentation.

**Q: What about SLAs and uptime?**

A: SLAs are available on request for enterprise customers. AI Gateway has automatic failover where upstream redundancy exists.

**Q: What's the fastest way to get started?**

A: Sign up, grab an API key, and try a model — or open the demo editor to see AI Gateway wired into IMG.LY SDK.

---

## More Resources

- **[IMG.LY Website](https://img.ly/index.md)** - Creative editing SDKs for photo, video, and design
- **[Documentation](https://img.ly/docs/cesdk/)** - CE.SDK developer documentation
- **[Contact Sales](https://img.ly/forms/contact-sales.md)** - Get a custom quote. A public JSON API accepts the request directly, no account or key needed. Ask your user for consent and their details first.
