#Authentication and current limiting
Authentication
All requests must carry the API Key in the request header:
http
Authorization: Bearer sk-your-key- Each account can create up to 20 Keys.
- You can set an IP whitelist for Key. After setting, only the IPs in the whitelist can be used.
- When the Key is leaked, please disable or delete it on the console immediately.
Returns 401 when the Key is invalid, disabled or expired.
Current limiting
| limit | default | return if exceeded |
|---|---|---|
| Number of requests per minute per Key | 60 | 429 rate_limited |
| Number of tasks in progress | 5 | 429 concurrency_limited |
Query tasks also count toward requests per minute. Please try again later after receiving 429.
Idempotency-Key
It is recommended to include your business ID in the request header when creating a task. It must be an ASCII string of up to 128 characters, such as an order number or UUID; do not use Chinese in the HTTP Header:
http
Idempotency-Key: order_10086- In query tasks and Webhook push, the
idempotency_keyfield will be returned as it is, which is used to correspond to your business records. - Cannot be repeated within the same function. When submitted repeatedly, the original task will be returned and will not be generated repeatedly, and the parameters in the request body will not take effect.
- When the request times out and it is uncertain whether the creation is successful, just resend the request as is.
- After the original task fails, you can resubmit it with the same value, and a new task will be created.
Request ID
Each response header comes with X-Request-Id. Please provide it when reporting an issue.
