The official Brew SDK is TypeScript-first (Documentation Index
Fetch the complete documentation index at: https://docs.brew.new/llms.txt
Use this file to discover all available pages before exploring further.
@brew.new/sdk). For every other language — Python, Go, Ruby, Java, PHP, Swift, Kotlin, .NET, Rust, Elixir — generate your own client from the canonical OpenAPI 3.1 spec. The same spec powers Brew’s TypeScript SDK and the generated API reference pages, so the contract is guaranteed in sync.
The OpenAPI spec
| URL | Use when |
|---|---|
https://brew.new/openapi/public-api-v1.yaml | Pulling from the API host (recommended — always matches the live deploy). |
https://docs.brew.new/api-reference/openapi-public-v1.yaml | Pulling from the docs site (Mintlify CDN). |
Recommended generators
The OpenAPI ecosystem has several mature generators. We don’t endorse a single one — pick what fits your stack.- openapi-generator (OSS, every language)
- Speakeasy (commercial, high polish)
- Fern (commercial, multi-language)
- Just use cURL / fetch / httpx
The reference open-source generator. Supports ~50 client targets.Every other supported language — Java, PHP, C#, Swift, Kotlin, Rust, Elixir, Dart — uses the same shape: change the
-g target.Auth + headers in generated clients
Every generator emits a configurable client. Wire the API key into theAuthorization header. Most generators have a one-call helper:
| Generator | Auth setup (Python example) |
|---|---|
| openapi-generator | configuration = brew_sdk.Configuration(access_token=os.environ['BREW_API_KEY']) |
| Speakeasy | client = Brew(security=brew.Security(bearer_auth=os.environ['BREW_API_KEY'])) |
| Fern | client = BrewClient(token=os.environ['BREW_API_KEY']) |
bearerAuth (preferred) and apiKeyAuth (the X-API-Key form). Pick whichever your generator surfaces more cleanly.
What to wire up in your generated client
Beyond the call shape, a production-ready Brew client should:- Honor
X-RateLimit-RemainingandRetry-After— see Rate limits for the cookbook. - Set
Idempotency-Keyon retriedPOSTs — see Idempotency. - Surface
x-request-idon every error so customers can include it in support tickets — see Response headers. - Branch error logic on
error.code(stable) noterror.message(human-readable) — see Errors. - Use the
BrewApiErrorenvelope — every non-2xx response carries{ error: { code, type, message, suggestion, docs, retryAfter?, param?, details? } }.
Pinning to a spec version
The OpenAPI spec is versioned via the v1 prefix on every path (/v1/...). When we break compatibility, we’ll mint /v2/... paths AND publish a new spec at public-api-v2.yaml; the v1 spec will stay at the same URL.
For a more reproducible build, pin to a copy of the spec checked into your repo:
Contributing back
If you publish a generator config / template that produces an idiomatic Brew client in $YOUR_LANGUAGE, link it from the changelog or open an issue — we’ll happily mention it as a community SDK.See also
- TypeScript SDK overview — the official
@brew.new/sdk. - TypeScript Quickstart — see the patterns to port.
- API introduction — the contract every generator targets.
- Errors, Rate limits, Idempotency, Response headers — the cross-cutting concerns every client needs.
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:- Self-Service Tools
- Talk to Our Team
Search Documentation
Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.
ChatGPT/Claude Integration
Click “Open in ChatGPT” at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.