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

# Create JWT Token

> Generate a JSON Web Token (JWT) for API authentication

Generate a JWT token to authenticate API requests. The token contains encoded credentials and permissions that are required for accessing protected endpoints.

This endpoint uses **Basic Authentication**. You'll need to encode your API Client ID and Secret in the `Authorization` header.

The JWT token returned will be used to authenticate both Account and Liquidity endpoints

### Basic Authentication

To authenticate, combine your API Client ID and Secret in the format `{apiClientId}:{apiClientSecret}` and base64 encode it:

<CodeGroup>
  ```javascript Javascript theme={null}
  // Browser
  const credentials = btoa('{apiClientId}:{apiClientSecret}');
  const headers = {
    'Authorization': `Basic ${credentials}`
  };
  console.log(headers);

  // Node.js
  import { Buffer } from 'buffer';
  const nodeCredentials = Buffer.from('{apiClientId}:{apiClientSecret}').toString('base64');
  const nodeHeaders = {
    'Authorization': `Basic ${nodeCredentials}`
  };
  console.log(nodeHeaders);
  ```

  ```python Python theme={null}
  import base64

  credentials = f"{apiClientId}:{apiClientSecret}"
  encoded = base64.b64encode(credentials.encode()).decode()
  headers = {
      'Authorization': f'Basic {encoded}'
  }
  print(headers)
  ```

  ```bash Bash theme={null}
  # Add credentials to header
  AUTH_HEADER="Authorization: Basic $(echo -n '{apiClientId}:{apiClientSecret}' | base64)"
  echo $AUTH_HEADER
  ```
</CodeGroup>

### Example Request

```http theme={null}
POST /auth/token HTTP/1.1
Host: api.example.com
Authorization: Basic {base64EncodedCredentials}
Content-Type: application/json
```
