Authentication
All AIECG API requests require authentication. This document explains the API Key–based authentication flow and how to call the related APIs.
API Key Authentication
The simplest authentication method, suitable for most scenarios.
Get an API Key
- Log in to the Developer Console
- Go to the “API Keys” page
- Retrieve your API Key
How to use it
Add the following to your request Header:
Authorization: Bearer YOUR_API_KEY
Complete example
curl -X POST "https://api.heartvoice.com.cn/v1/basic/ecg/1-lead/analyze" \
-H "Authorization: Bearer sk-aiecg-xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"data": [...], "sampling_rate": 500}'
Security recommendations
Important
- Do not hard-code your API Key in client-side code.
- Store your API Key in environment variables.
// ✅ Recommended: use environment variables
const client = new AIECG(process.env.AIECG_API_KEY);
// ❌ Avoid: hard-coding
const client = new AIECG('sk-aiecg-xxxx');
Rate limiting
Limits by tier
| Tier | Limit condition / calls per second (QPS) |
|---|---|
| Basic | 5 |
| Advanced | 10 |
Check current usage
Log in to the Developer Console. In the Overview section, you can see your API usage and remaining quota.