Аутентификация
RouteAPI использует аутентификацию Bearer Token. Каждый API-запрос должен содержать действительный Token в заголовке Authorization.
Request header format
Section titled “Request header format”Authorization: Bearer sk-your-routeapi-tokenПример:
curl https://www.routeapi.ai/v1/models \ -H "Authorization: Bearer $ROUTEAPI_KEY"API Token
Section titled “API Token”- RouteAPI console.
- API Keys.
- Create token.
- Set name, quota, permissions, and expiration.
- Store it only on the server side or in a secure environment.
| Configuration | Описание |
|---|---|
| User balance | 402 may be returned when balance is insufficient |
| Token quota | A Token can have independent quota or expiration |
| Rate limit | 429 is returned after triggering |
Рекомендации
Section titled “Рекомендации”- Do not expose Tokens in frontend code or public repositories.
- Prefer environment variables for server-side calls.
- Disable leaked Tokens immediately.
Common authentication errors
Section titled “Common authentication errors”| Status code | Cause | Handling |
|---|---|---|
| 401 | Missing or invalid Token | Check Authorization |
| 402 | Insufficient balance or quota | Recharge or adjust quota |
| 429 | Rate limit | Reduce concurrency |