Better Gradient

(beta)
HomeGalleryGuideDevelopersResourcesBlog
Gradient background exampleCreate Gradient
Back to BlogBack to Blog

A Gradient API That Remembers

A Gradient API That Remembers
Developmentgradient generatormesh gradients
Téo Goulois

Téo Goulois


February 3, 2026

I built Better Gradient because I wanted something fast, playful, and precise—no accounts, no friction.

But one request kept coming up:

"Can I generate the same gradient again from code?"

Today I'm shipping the answer: the Better Gradient API—a single endpoint that generates deterministic mesh gradients using a seed.

Same Seed, Same Gradient

Pass the same seed, get the same output. Every time.

This unlocks some useful patterns:

  • Use a user's email as a seed to generate a unique-but-stable avatar background

  • Pick a brand seed like seed=studio and reuse it across your marketing pages

  • Build design systems with repeatable, consistent visuals

Endpoint

GET /api/gradient

Formats: svg, css, share

Quick Example

bash

curl "https://better-gradient.com/api/gradient?seed=studio&size=1200&format=svg"

Call it again with the same params—you'll get identical output.

Parameters

Param

Description

seed or email

Deterministic identity (same value = same gradient)

size

Sets both width and height

width, height

Override dimensions individually

count

Number of blended shapes

format

svg, css, or share

A sensible default: seed=your-app, size=1200, format=svg

Caching by Design

Public APIs can get expensive fast — bots, scrapers, accidental loops. So this API is built to be cache-friendly from the start:

  • Seeded requests return ETag and long-lived cache headers, so browsers and CDNs can reuse responses.

  • Random output is explicitly not cacheable — it would defeat the purpose and spike compute costs.

This is also why the public tier requires a seed: it makes the API cheaper and safer to run.

Public Tier (No Key)

Try it without signing up.

  • Rate limits: 20/min, 200/day

  • Max size: 2048px

  • Max shapes: 8

  • Requires seed or email (no random)

Strict, but open for experimentation.

Verified Tier (API Key)

Need higher limits or random output? Request a key at:

👉 better-gradient.com/developers

You'll verify your email, and the key will be shown once. Only the hashed version is stored.

  • Rate limits: 60/min, 1000/day

  • Max size: 6000px

  • Max shapes: 10

  • Random output: allowed

Usage

bash

curl "https://better-gradient.com/api/gradient?format=svg&size=1400" \
  -H "Authorization: Bearer YOUR_KEY"

Or use x-api-key: YOUR_KEY.

Rate Limit Headers

Every response includes rate limit info — and a Retry-After header when you hit the ceiling. Makes it easy to build polite integrations.

On Pricing

The API is free while usage stays reasonable.

If it scales to the point where it's expensive to run, I'll introduce paid tiers for heavy users—while keeping a free tier for small projects.

No surprise bills. No sudden shutoffs.

What's Next

This is v1. I'll iterate based on real usage.

If you build something with the API, especially if you're using seeds in creative ways (user themes, campaigns, personalized products) — I'd love to see it.

→ Try the API

Got feedback ? Missing a format ? Limits don't fit ? Let me know.

Read More Articles

Better Gradient

Free mesh gradient generator for modern web design

Product

  • Gradient Editor
  • Gallery

Resources

  • Guide
  • Developers
  • Blog
  • Resources

Connect

  • Twitter/XTwitter/X
  • GitHubGitHub
  • Share feedback

© 2025 Better Gradient. All rights reserved.