Skip to content

api pricing tier updates #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 9, 2025
14 changes: 7 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export default function RootLayout({
<body className="flex min-h-screen flex-col">
<Provider>
<Banner
id="hacks"
cta="Start hacking"
url="/stacks/hacks/build-with-sbtc"
startDate="2025-03-26"
endDate="2025-04-01"
mobileText="Compete for a scholarship to Bitcoin 2025 in Las Vegas."
id="api-tiers"
cta="Meet Hiro’s new account tiers"
url="https://platform.hiro.so/pricing"
startDate="2025-04-09"
endDate="2025-04-16"
mobileText="Increase your API rate limits"
>
Compete for a dev scholarship to Bitcoin 2025.
Increased API rate limits, dedicated support channels.
</Banner>
{children}
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion content/docs/bitcoin/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Rate limiting
description: Understand the rate limits for Hiro APIs and the STX Faucet.
description: Understand the rate limits for Hiro APIs and testnet faucets.
---

import RateLimitingContent from '@/snippets/rate-limiting.mdx';
Expand Down
2 changes: 1 addition & 1 deletion content/docs/stacks/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Rate limiting
description: Understand the rate limits for Hiro APIs and the STX Faucet.
description: Understand the rate limits for Hiro APIs and testnet faucets.
---

import RateLimitingContent from '@/snippets/rate-limiting.mdx';
Expand Down
24 changes: 23 additions & 1 deletion snippets/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Developers have open access to Hiro's APIs without the use of an API key, but ar
<Callout title='Where can I get an API key?'>
If you're interested in obtaining an API key, you can generate one for free in the [Hiro Platform](https://platform.hiro.so) by creating an account.

If your app needs more than 500 RPM, please [contact us](mailto:[email protected]).
All API keys are set by default to the free "starter" account tier, which comes with a 900RPM rate limit. For builders who need access to higher API rate limits, dedicated support channels, and reliability guarantees through SLAs, you can upgrade your account tier through the Hiro Platform.
</Callout>

## Usage with cURL
Expand All @@ -30,6 +30,28 @@ async function makeApiRequest(apiKey: string) {
}
```

## Usage with Stacks.js

```ts client.ts
import { createApiKeyMiddleware, createFetchFn } from "@stacks/common";
import { makeContractCall } from '@stacks/transactions';

const apiMiddleware = createApiKeyMiddleware({
apiKey: "<your-middleware>",
});

const customFetchFn = createFetchFn(apiMiddleware);

const txOptions = {
// ... standard transaction options
client: {
fetch: customFetchFn,
},
};

const transaction = await makeContractCall(txOptions);
```

<Callout title="Caution" type="warn">
The API key is passed in the header of your HTTP API request and is used only for private use, like in server-side applications.

Expand Down
34 changes: 22 additions & 12 deletions snippets/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
## API rate limits

The following rate-limits (in requests per minute, or RPM) are applicable for all Hiro APIs as of [November 2023](https://www.hiro.so/blog/updated-rate-limits-for-hiro-apis):
You can access all of Hiro's API services without an API key, but you are subject to rate limits of 25 RPM, per client IP. To build with higher rate limits, you can generate a free API key in the Hiro Platform that is set to the free "starter" plan as a default, and you can upgrade your account to a [higher tier](https://www.hiro.so/pricing) as needed:

| API key | Rate Limit |
|:--------|:----------------------------------|
| No | 50 requests per minute (RPM) per client IP, for unauthenticated traffic |
| Yes | 500 requests per minute (RPM), regardless of origin IP, with an authenticated API key |
| Tiers | API RPM | Stacks L2 requests / month | Bitcoin L1 requests / month |
|:---------------|:--------|:---------------------------|:----------------------------|
| No API key | 25 | n/a | n/a |
| Free / Starter | 900 | 150K | 50K |
| $99 / Build | 3K | 15M | 500K |
| $599 / Scale | 7K | 75M | 5M |
| Enterprise | Custom | Custom | Custom |

With a single API key, you gain access to Hiro's suite of API services that span Bitcoin and Stacks:

**Bitcoin L1 API services**

- [Ordinals API](/bitcoin/ordinals/api) (includes BRC-20 support)
- [Runes API](/bitcoin/runes/api)

**Stacks L2 API services**

These rate-limits apply to the entirety of API traffic, regardless of whether it's from one or all of these APIs:
- [Stacks Blockchain API](/stacks/api)
- [Token Metadata API](/stacks/token-metadata-api)
- [Ordinals API](/bitcoin/ordinals/api)
- [Runes API](/bitcoin/runes/api)

These new rate limits help us ensure fair usage of Hiro APIs and provide the best possible service as our community of developers and applications grow.

<Callout title='Need an API key?'>
You can create one for free in the [Hiro Platform](https://platform.hiro.so) by creating an account.
</Callout>

## STX Faucet rate limits

Note: this faucet is for Stacks testnet and provides testnet STX, which has no monetary value.
## STX / sBTC testnet faucet rate limits

Note: these faucets are for Stacks and sBTC testnet tokens, which have no monetary value.

| Type | Rate Limit |
|:-----------------------------|:-----------------------------|
| Stacking requests | 1 request per 2 days |
| Regular STX requests | 1 request per minute (RPM) |
| Regular STX / sBTC requests | 1 request per minute (RPM) |

To use the faucets, visit the [Hiro Platform Faucet](https://platform.hiro.so/faucet).