---
updatedAt: 2026-03-05T09:17:38.000Z
agentTools:
  projectIndex: https://neutronpay.readme.io/llms.txt
---

# Get access token

Exchange API credentials for a JWT access token.

This endpoint exchanges your API credentials for a **JWT access token**. The token is required as a Bearer token for all subsequent API calls.

### How It Works

1. Compute an HMAC-SHA256 signature using your API key and secret (see [Signature Generation](/reference/signature-generation))
2. Send the signature along with your API key and a timestamp
3. Receive a JWT `accessToken` with an expiry time

### Headers

| Header            | Description                    | Example           |
| ----------------- | ------------------------------ | ----------------- |
| `X-Api-Key`       | Your API key                   | `nk_live_abc123`  |
| `X-Api-Signature` | HMAC-SHA256 signature (hex)    | `a1b2c3d4e5f6...` |
| `X-Timestamp`     | Unix timestamp in milliseconds | `1770342000000`   |

### Example Request

```bash
curl -X POST https://api.neutron.me/api/v2/authentication/token-signature \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "X-Api-Signature: YOUR_SIGNATURE" \
  -H "X-Timestamp: 1770342000000" \
  -d '{"test":"auth"}'
```

### Example Response

```json
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiredAt": "2026-02-09T12:00:00.000Z",
  "accountId": "ne01-abc123def456"
}
```

### Using the Token

Include the token as a Bearer token in all subsequent requests:

```bash
curl https://api.neutron.me/api/v2/account/YOUR_ACCOUNT_ID \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

### Token Lifecycle

* Tokens have a **limited validity period** (returned in `expiredAt`)
* Using an expired token returns **401 Unauthorized**
* Request a new token when the current one expires or is close to expiry
* There is no refresh token flow — simply re-authenticate

> 📘 For signature computation details and code samples in Node.js, Python, Go, C#, and Java, see [Signature Generation](/reference/signature-generation).

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Neutron API",
    "description": "Neutron API for Bitcoin Lightning, on-chain, and stablecoin operations.\n\n**Base URLs:**\n- Production: `https://api.neutron.me`\n",
    "version": "2.2.6",
    "contact": {
      "email": "support@neutron.me",
      "url": "https://neutron.me"
    }
  },
  "servers": [
    {
      "url": "https://api.neutron.me",
      "description": "Production"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "API authentication endpoints"
    }
  ],
  "paths": {
    "/api/v2/authentication/token-signature": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get access token",
        "description": "Exchange API credentials for a JWT access token.",
        "operationId": "getAccessToken",
        "security": [],
        "parameters": [
          {
            "name": "X-Api-Key",
            "in": "header",
            "required": true,
            "description": "Your API key",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Api-Signature",
            "in": "header",
            "required": true,
            "description": "HMAC-SHA256 signature",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Timestamp",
            "in": "header",
            "required": true,
            "description": "Unix timestamp in milliseconds",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string",
                      "description": "JWT access token"
                    },
                    "expiredAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Token expiration timestamp"
                    },
                    "accountId": {
                      "type": "string",
                      "description": "Your Neutron account ID"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT access token from /api/v2/authentication/token-signature"
      }
    }
  }
}
```