HMAC-SHA256 Signature Authentication
The Doubao native API uses HMAC-SHA256 signature authentication. You need an API Key and a Secret Key to generate the request signature.Signature Calculation
The signature is calculated from the following string:| Component | Description |
|---|---|
| HTTPMethod | The HTTP method (e.g. POST, GET) |
| URI | The request URI path |
| QueryString | The URL query string, sorted by parameter name |
| Headers | Signed headers included in the signature |
| HashedPayload | SHA-256 hash of the request body |
Authorization header includes the algorithm, credential scope, signed headers, and the computed signature.
Using AnyFast Proxy
When using AnyFast as a proxy, you do not need to perform HMAC-SHA256 signature calculation. Standard Bearer token authentication is used instead. Simply include your AnyFast key in the request header:https://www.anyfast.ai with this header. AnyFast handles the underlying Doubao authentication on your behalf.