API Tokens for HyperSync
Overview
API tokens provide authenticated access to HyperSync services, enabling enhanced capabilities and usage tracking.
HyperSync implements rate limits for requests without API tokens. API tokens will be required from 3 November 2025. Indexers deployed to our hosted service will have special access to HyperSync that does not require a custom API token.
Table of Contents
Generating API Tokens
You can generate API tokens through the Envio Dashboard:
- Visit https://envio.dev/app/api-tokens
- Sign in to your account (or create one if you don't have one)
- Follow the prompts to create a new token
- Copy and securely store your token
Implementation Guide
To use an API token, pass it as a bearer_token when creating a HyperSync client:
- TypeScript/JavaScript
- Python
- Rust
const client = HypersyncClient.new({
url: "https://eth.hypersync.xyz",
bearerToken: process.env.HYPERSYNC_BEARER_TOKEN,
});
client = hypersync.HypersyncClient(hypersync.ClientConfig(
url="https://eth.hypersync.xyz",
bearer_token=os.environ.get("HYPERSYNC_BEARER_TOKEN")
))
let client = Client::new(ClientConfig {
bearer_token: Some(std::env::var("HYPERSYNC_BEARER_TOKEN").unwrap_or_default()),
..Default::default()
})
.unwrap();
Understanding Usage
To understand your current month's usage, visit https://envio.dev/app/api-tokens. Usage is composed of two main components:
- Number of Requests: The total count of API requests made.
- Credits: A comprehensive calculation that takes into account multiple factors including data bandwidth, disk read operations, and other resource utilization metrics. This provides the most accurate representation of actual service usage. We're happy to provide more detailed breakdowns of the credit calculation upon request.
Security Best Practices
When working with API tokens:
- Never commit tokens to git repositories
- Use environment variables to store tokens instead of hardcoding
- Add token files like
.envto your `.gitignore - Rotate tokens periodically for enhanced security
- Limit token sharing to only those who require access
# Example .env file
HYPERSYNC_BEARER_TOKEN=your_secret_token_here
This approach keeps your tokens secure while making them available to your application at runtime.