跳到主要内容
FinCode

Authentication

API keys, Bearer authentication and key rotation.

本文档适用于 API V1。

Bearer authentication

All API requests require an API key in the Authorization header. Keys use the sk_ prefix followed by a random secret.

Authorization: Bearer sk_xxx

Keeping keys safe

Only the key hash is stored server-side. Never commit keys to source control; use environment variables or a secrets manager. Rotate keys from the dashboard — old keys keep working for a configurable grace period to avoid downtime.

Authentication errors

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key.
FORBIDDEN403The key does not have access to this endpoint.