---
title: "Generate User Token"
method: POST
path: "/api/tokens/generate"
tags: ["Server Management"]
---

# Generate User Token

`POST /api/tokens/generate`

Generate a JWT token for the authenticated user.

Request body should contain:
{
    "requested_scopes": ["scope1", "scope2"],  // Optional, defaults to user's current scopes
    "expires_in_hours": 8,                     // Optional, defaults to 8 hours
    "description": "Token for automation"      // Optional description
}

Returns:
    Generated JWT token with expiration info

Raises:
    HTTPException: If request fails or user lacks permissions

## Cookies

- `mcp_gateway_session` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/ascending-llc/apis/mcp-gateway-registry.md) · [All operations](https://skmtc.net/ascending-llc/apis/mcp-gateway-registry/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ascending-llc/mcp-gateway-registry/versions/31381943e2e7/schema)
