> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How to authenticate REST API requests

All REST API endpoints require authentication via Bearer token.

### Getting Credentials

See the [TypeScript Starter Kit](https://docs.decibel.trade/quickstart/typescript-starter-kit.md) for step-by-step instructions on:

1. [Creating an API Wallet](https://docs.decibel.trade/quickstart/typescript-starter-kit.md#create-api-wallet), a separate wallet for signing API transactions (not your main login wallet).
2. Getting a Bearer Token from [Geomi](https://geomi.dev/docs/start).

### Using Authentication

Include two headers with every authenticated request: Origin (your application's origin URL) and Authorization (Bearer token from Geomi, see above)

```bash theme={null}
curl -H "Origin: https://testnet-app.decibel.trade/trade" \
     -H "Authorization: Bearer <KEY>" \
     https://api.testnet.aptoslabs.com/decibel/
```

Replace `<KEY>` with your Bearer token from Geomi.

## Security Best Practices

* Never commit tokens to version control
* Use environment variables in your code
* Rotate tokens periodically

## Related

> [card] [TypeScript Starter Kit](https://docs.decibel.trade/quickstart/typescript-starter-kit.md)
>
> Step-by-step guide to creating API credentials

> [card] [Error Handling](https://docs.decibel.trade/api-reference/rest/errors.md)
>
> How to handle authentication errors


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.