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"
}
'{
"auth_token": "pplx-1234567890abcdef",
"created_at_epoch_seconds": 1735689600,
"token_name": "Production API Key"
}Generates a new authentication token for API access.
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"
}
'{
"auth_token": "pplx-1234567890abcdef",
"created_at_epoch_seconds": 1735689600,
"token_name": "Production API Key"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Optional name for the authentication token to help identify its purpose.
"Production API Key"
Successfully generated authentication token.
The newly generated authentication token. Store this securely as it cannot be retrieved again.
"pplx-1234567890abcdef"
Unix timestamp (in seconds) of when the token was created.
1735689600
The name associated with this token, if provided.
"Production API Key"
Was this page helpful?