Authentication Mechanism
ChainStream uses OAuth 2.0 Client Credentials flow for API authentication. You need to exchange your API credentials (Client ID and Client Secret) for a JWT access token, then include that token in each API request.Get API Credentials
Login to Dashboard
Visit ChainStream Dashboard and login
Generate Access Token
Basic Usage (General API Access)
Scope Permissions
Certain advanced API endpoints require specific access permissions (Scope). Specify the required scope when obtaining the token:Available Scopes
| Scope | Description | Applicable Endpoints |
|---|---|---|
webhook.read | Webhook read access | Query Webhook configuration |
webhook.write | Webhook write access | Create/modify/delete Webhooks |
kyt.read | KYT read access | Query risk assessment results |
kyt.write | KYT write access | Submit transactions/addresses for risk assessment |
Token Request with Scope
If no scope is specified, the token can access all general API endpoints. Scope is only required when accessing protected Webhook or KYT endpoints.
Using the Access Token
Include the token in theAuthorization header of each API request:
Token Validity & Refresh
- Validity: Access tokens are valid for 24 hours by default
- Refresh Strategy: Get a new token before the current one expires
- Caching: Cache tokens in your application to avoid requesting new ones for each call
API Endpoints
- Mainnet API:
https://api-dex.chainstream.io/ - WebSocket:
wss://realtime-dex.chainstream.io/connection/websocket - Auth Service:
https://dex.asia.auth.chainstream.io/
FAQ
What if the token expires?
What if the token expires?
When the access token expires, simply obtain a new token using the same credentials. It’s recommended to implement an automatic refresh mechanism in your application.
Can I create multiple Apps?
Can I create multiple Apps?
Yes. You can create separate Apps (each with their own Client ID/Secret) for different applications or environments, making it easier to manage and track usage.
How do I revoke leaked credentials?
How do I revoke leaked credentials?
In the Dashboard’s Applications page, find the corresponding app and click “Delete”. The key will be invalidated immediately.

