# Generate Auth Token

POST

/

generate\_auth\_token

Generate Auth Token

```
curl --request POST \
  --url https://api.perplexity.ai/generate_auth_token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "token_name": "Production API Key"
}
'
```

:::code-group
```title="200"
{
  "auth_token": "pplx-1234567890abcdef",
  "created_at_epoch_seconds": 1735689600,
  "token_name": "Production API Key"
}
```
:::

#### Authorizations

Authorization

string

header

required

Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

#### Body

application/json

token\_name

string

Optional name for the authentication token to help identify its purpose.

Example:

`"Production API Key"`

#### Response

200 - application/json

Successfully generated authentication token.

auth\_token

string

required

The newly generated authentication token. Store this securely as it cannot be retrieved again.

Example:

`"pplx-1234567890abcdef"`

created\_at\_epoch\_seconds

number

required

Unix timestamp (in seconds) of when the token was created.

Example:

`1735689600`

token\_name

string

The name associated with this token, if provided.

Example:

`"Production API Key"`

Was this page helpful?

⌘I

## Related pages

- [Admin & Management](./admin-management-index.md)
- [Agent API](./agent-api-2-index.md)
- [Agent API](./agent-api-index.md)
- [Analytics API](./analytics-api-index.md)
- [Authentication](./authentication-index.md)
- [Changelog](../changelog.md)
- [Cookbook](./cookbook-2-index.md)
- [Embeddings API](./embeddings-api-2-index.md)
- [Embeddings API](./embeddings-api-index.md)
- [Getting Started](./getting-started-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
