Skip to main content

Install

Package

The SDK is server-first. Do not use it directly in browser code with a real API key.

Create a Client

Create an API key at brew.new/settings/api. A brand key resolves its brand automatically. An organization key needs a client brandId or withBrand(brandId). See API authentication for the complete scoping and permission contract.

Configuration

The client accepts these options:

Common baseUrl Values

  • https://brew.new/api
  • http://localhost:3000/api
Long-running methods raise the default timeout: generation and editing use 240 seconds, imports and GIFs 300, image generation 180. A longer client timeoutMs is kept, and a per-request timeoutMs always wins. On Node, the built-in fetch stops waiting after 300 seconds whatever timeoutMs says.

First Request

Quickstart

Generate a design and send yourself a test.

Error Handling

See how BrewApiError works.

Need Help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

Search Documentation

Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.

Ask ChatGPT or Claude

Click here to open the Copy page menu at the top of this page, then send the page to ChatGPT, Claude, or your editor.