canonical: https://jentic.com/apis/bunny.net/bunny

# Bunny CDN API

The Bunny CDN API manages bunny.net's content delivery infrastructure: pull zones for caching origin content, storage zones for object hosting, video libraries for video streaming, cache purge operations, and per-zone statistics and billing data. It is used by teams running bunny.net's edge network to provision new zones programmatically, push cache invalidations on deploy, and pull traffic and bandwidth numbers into internal dashboards. Authentication is a single AccessKey header keyed to the bunny.net account.

## For AI agents

Provision and manage bunny.net pull zones, storage zones, and video libraries, purge CDN cache, and pull traffic and billing statistics.

## Scope

Does not handle DNS records, WAF rules, or edge compute functions - use for bunny.net pull zones, storage zones, video libraries, and cache purges only.

## Capabilities

- Create, update, and delete pull zones that cache origin content at the edge
- Provision and remove storage zones for object hosting
- Create and list video libraries for video streaming
- Purge a single URL from the bunny.net edge cache
- Purge a pull zone's full cache via /pullzone/{id}/purgeCache
- Pull traffic and bandwidth statistics for the account
- Retrieve account billing summary and the list of edge regions

## Use cases

### Cache invalidation on deploy

Trigger CDN cache purges as part of a CI/CD pipeline so users see fresh content immediately after a deploy. The /purge endpoint targets a single URL, while /pullzone/{id}/purgeCache wipes a full pull zone. Typical usage runs a single API call per deploy and completes in under a few seconds at the edge.

Example prompt: After a deploy, POST /purge with the changed URL or POST /pullzone/{id}/purgeCache to wipe the entire pull zone's edge cache.

### Programmatic zone provisioning

Spin up pull zones and storage zones for new tenants or staging environments without using the bunny.net dashboard. Create the pull zone pointing at the origin, optionally pair it with a storage zone for static assets, and enrol the result into your infrastructure-as-code workflow. Provisioning a new zone typically takes a single POST call.

Example prompt: POST /pullzone with the origin URL and zone name, then POST /storagezone if static asset hosting is also needed, capturing the returned IDs for later configuration.

### Traffic and billing visibility

Pull bandwidth and traffic statistics from /statistics and the current account billing summary from /billing into internal dashboards or cost-monitoring systems. This avoids manual logins to the bunny.net portal and supports per-team or per-project chargeback when zones are tagged consistently.

Example prompt: GET /statistics for the current period and GET /billing to assemble a usage and cost snapshot for the account.

### AI agent infra automation via Jentic

An AI agent can create a pull zone, attach a storage zone, and purge cache after a deploy as part of an end-to-end release flow. Jentic securely stores the bunny.net AccessKey and issues scoped, short-lived access for each operation so the agent never holds the raw account key.

Example prompt: Search Jentic for 'purge bunny.net cache', load the purge schema, and execute it for the specific URL after a deploy completes.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /pullzone | Create a pull zone |
| GET | /pullzone | List pull zones |
| POST | /pullzone/{id}/purgeCache | Purge a pull zone cache |
| POST | /purge | Purge a URL from the edge cache |
| POST | /storagezone | Create a storage zone |
| POST | /videolibrary | Create a video library |
| GET | /statistics | Get traffic and bandwidth statistics |
| GET | /billing | Get the account billing summary |

## Key resources

- **Pull Zones** — Provision and manage pull zones that cache origin content at the edge.
- **Storage Zones** — Create and remove object storage zones.
- **Video Streaming** — Create and list video libraries for streaming.
- **Purge** — Invalidate a single URL or a full pull zone cache.
- **Statistics** — Pull traffic and bandwidth metrics for the account.
- **Billing** — Retrieve the account billing summary.
- **Regions** — List edge regions where bunny.net serves traffic.

## Why Jentic

- **Setup:** Wiring the bunny.net API by hand means learning its AccessKey header auth against api.bunny.net and threading the pull zone id through cache-purge calls yourself. Through Jentic you install once, import the Bunny CDN API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** bunny.net puts the pull zone id in the URL path (/pullzone/{id}/purgeCache), so a rule can pin your agent to one pull zone for that call, and more broadly you scope it by the operations it needs, such as listing pull zones or purging by URL. Because you choose the allowed operations, it can purge cache without being able to create storage zones or video libraries unless you add those.
- **Credential handling:** Your bunny.net AccessKey is stored once, encrypted, by your own Jentic One instance and injected as the header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'purge bunny.net cache' or 'create a pull zone', and Jentic returns the matching bunny.net operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloudflare API** — Cloudflare's API covers CDN, DNS, security, and edge workers across a much larger surface.
- **Akamai API** — Akamai's enterprise CDN and edge security APIs.
- **cdnjs API** — Public CDN for open-source JavaScript libraries, useful as a complementary asset source.
- **AWS API** — AWS APIs for the origin infrastructure (S3, EC2, Lambda) that bunny.net pulls from.

## FAQ

### What authentication does the Bunny CDN API use?

The API uses an AccessKey header - the account API key generated in the bunny.net dashboard. Through Jentic, the AccessKey is stored encrypted in the vault and a scoped, short-lived token is issued per operation so the raw account key never enters the agent's context.

### How do I purge a single URL from the bunny.net edge cache?

POST /purge with the URL you want to invalidate. For a full pull zone purge, POST /pullzone/{id}/purgeCache. Both calls return immediately and propagate through the edge network within seconds.

### Can I create a pull zone programmatically?

Yes - POST /pullzone with the zone name and origin URL. The response includes the zone ID, which you then reference for subsequent updates, deletions, or cache purges.

### Does the Bunny CDN API expose video streaming?

Yes. The /videolibrary endpoints create and list video libraries used by bunny.net Stream. Use POST /videolibrary to provision a new library and GET /videolibrary/{id} to retrieve its configuration.

### What are the rate limits for the Bunny CDN API?

The OpenAPI spec does not declare explicit limits. bunny.net documents account-level throttles in their dashboard - implement 429 retry-with-backoff for batch operations such as bulk pull zone provisioning.

### How do I purge bunny.net cache through Jentic?

Run `pip install jentic` and search for 'purge bunny.net cache'. Jentic returns the /purge operation, you load its schema, and execute the call with the URL - the AccessKey is supplied from your Jentic One instance automatically.

### Can I limit what my agent is allowed to do with the Bunny CDN API?

Yes. Because Jentic One is self-hosted, you write the rules that decide which Bunny CDN operations your agent may call, so you can allow it to purge a URL with POST /purge or list pull zones while denying it the ability to create storage zones or video libraries. Since the pull zone id sits in the path of POST /pullzone/{id}/purgeCache, a rule can pin the agent to one specific pull zone for that call. Your bunny.net AccessKey stays stored in your own instance and is injected only for the operations you have allowed.
