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:
StringToSign = HTTPMethod + "\n" + URI + "\n" + QueryString + "\n" + Headers + "\n" + HashedPayload
ComponentDescription
HTTPMethodThe HTTP method (e.g. POST, GET)
URIThe request URI path
QueryStringThe URL query string, sorted by parameter name
HeadersSigned headers included in the signature
HashedPayloadSHA-256 hash of the request body
The final 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:
Authorization: Bearer YOUR_API_KEY
All requests should be sent to https://www.anyfast.ai with this header. AnyFast handles the underlying Doubao authentication on your behalf.