Skip to main content

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​

  1. Log in to the Developer Console
  2. Go to the “API Keys” page
  3. 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​

TierLimit condition / calls per second (QPS)
Basic5
Advanced10

Check current usage​

Log in to the Developer Console. In the Overview section, you can see your API usage and remaining quota.