---
title: "Generate short lived bearer token"
method: POST
path: "/authenticate"
tags: ["Authentication"]
---

# Generate short lived bearer token

`POST /authenticate`

Generates and returns a bearer token. Behavior of this API differs on the basis of the auth mechanism used to make the request.
  - For API key auth, this API generates a JWT token whcih is valid for 24 hours and returns it.
  - For JWT bearer auth, returns the same JWT token in response
For information on how to generate API token, refer [Generating New API Keys](https://docs.togai.com/api-reference/authentication#generating-new-api-keys) section of docs.

## Response `200`

OK

- TokenResponse
  - `token` string, required

## Other responses

- `401` — Error response
- `403` — Error response
- `404` — Error response
- `429` — Error response
- `default` — Error response

---

[API](https://skmtc.net/togaihq/apis/togai-apis.md) · [All operations](https://skmtc.net/togaihq/apis/togai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/togaihq/togai-apis/revisions/442f5d8f4aa0/schema)
