Image Generation API

Generate template-based images for social media, ecommerce and more via API or AI tools

fetch('https://api.bannerbear.com/v5/images', {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${API_KEY}` },
  body: IMAGE_DATA
})

Get Started for Free

Generate Images by API

Fill a template with your own data and get back a finished image in seconds. One design, any format, rendered on demand at whatever volume you need.

Key Features

  • Full API Documentation
  • 50+ native integration, 9,000+ via Zapier
  • Custom templates
  • Render jpg, png, pdf, webp and avif
  • Batch up to 100 renders in a single call
  • Import your templates from Figma
  • Responsive templates
  • AI face and subject detection

REST API Docs

Fully documented API with OpenAPI specs. Everything you or your coding agent needs to get up and running fast.

API Reference

Node

Add template-based image and video generation capability to your Node app. Copy and paste your API key from the dashboard.

Python

Grab an API key from the dashboard and add template-based image and video generation capability to your Python app.

More Libraries

Ruby, PHP, MCP hosted and local. There are many more ways to integrate your tech stack with Bannerbear.

Libraries & SDKs →

99.9% Uptime

12 month trailing 99.9% uptime. 6 years providing image and video API services. Check our current status.

API Status

SepOctNovDecJanFebMarAprMayJunJulAug

Multiple Formats

Return jpg, png, pdf, webp and avif from a single render by asking for them together.

Resolution Scaling

Multiply output dimensions for retina and print without maintaining a second copy of the template.

Template Versioning

Pin a request to a saved template version so redesigning it never changes what production returns.

Transparent Rendering

Render without a background, with the alpha channel carried through to PNG and WebP files.

AI Face Detection

Crop around the clearest face, the largest, or the whole group instead of the centre.

Background Removal

Cut the subject out of an uploaded photo during the render, with no preprocessing step needed.

100x Batch Rendering

Submit up to one hundred image requests in a single call and collect them as one batch.

Synchronous Rendering

Swap the base host for sync.api.bannerbear.com and the request waits for the finished image, up to ten seconds.

Image API FAQ

Generating images from templates.

How do I generate an image?

POST to the images endpoint with a template UID and a modifications array. Each modification names a layer and the properties you want to change on it. Everything you do not name keeps its designed value.

Where do I find a template's UID?

On the template’s page in the dashboard, and in the API console on that page, which shows a ready-made request for that exact template.

What file formats can I get back?

jpg, png, pdf, webp and avif. Pass formats as an array to get several at once from a single render. It defaults to jpg.

Does asking for several formats cost more?

Yes. Credits are counted per format, so asking for jpg and png costs two rather than one.

Can I get a transparent background?

Yes, by enabling transparency on the template. PNG and WebP carry an alpha channel; JPG does not, so a transparent render must be requested in a format that supports it.

How do I render at a higher resolution?

Use scale to multiply the output size. A scale of 2 on a 1200x630 template returns 2400x1260. Credits are multiplied by the scale as well.

Can I set DPI for print?

Yes. dpi writes DPI metadata into the output so print software interprets the physical size correctly. It does not change the pixel dimensions — use scale for that.

Can I control compression?

Yes, quality sets the compression level for JPG and WebP output.

Can I use images from my own URLs?

Yes. Pass the URL as the image_url of an image layer. If the source is large or slow, proxy fetches and resizes it before rendering.

How does face detection work?

Turn on AI detect for an image layer and the subject is centred automatically rather than cropped from the middle. Choose whether it focuses on the clearest face, the largest, or the group.

Does AI detection cost extra?

Yes, one credit per layer that uses it, on top of the render itself.

Can I remove the background from an uploaded photo?

Yes, enable background removal on the image layer and the subject is cut out at render time. It costs one credit per layer.

Can Bannerbear generate a background image for me?

Yes. A layer with AI background generation enabled will create one from the ai_prompt you send with the request. One credit per generated background.

My template changed and older images look different. Can I pin a version?

Yes. Pass version to render against a specific saved version of the template, so a design change does not alter what an existing integration produces.

Can I attach my own reference to a render?

Yes. metadata accepts an arbitrary string that is stored with the image and returned with it — useful for carrying your own record ID through the request.

What happens when my text is longer than the space allows?

It depends on the layer’s text fitting setting: it can shrink to fit, or overflow. Set this in the editor so long values behave predictably before you send them.

How many layers can I change in one request?

As many as the template has. Send one entry per layer you want to change, and omit the rest.

If I send the same request twice, do I pay twice?

Yes. Each request is a fresh render and is billed as one. If you need the same output again, store and reuse the URL you already have.

Start a Free Trial

Start a free trial with 30 API credits, no credit card required

Resize Video
Add Intro Animation
Add Subtitles

Get Started for Free