Steve
07/03/2025, 9:39 PMChiranjeet Mishra
07/04/2025, 6:54 AMSteve
07/04/2025, 7:47 AMJacques
07/05/2025, 3:48 PMChiranjeet Mishra
07/07/2025, 7:21 AMorgId and setting the tag to "private".
- Retrieve your private key from the environment variables.
- Use a JWT library to create the token with the payload and private key.
For generating the JWT, here's an example in Node.js:
javascript
// Define the payload
const payload = {
orgId: process.env.ORG_ID,
token: {
tag: "private",
},
};
// Get the private key from environment variables
const key = process.env.PRIVATE_KEY;
// Define token options
const options = {
expiresIn: "1h",
};
// Generate the token using a JWT library
const token = generateJWT(payload, key, options);
If you're unable to find the private key, check your user permissions or contact your account administrator to confirm it's available in your organizational setup. For more details, refer to the [JWT Authentication Guide](https://docs.vapi.ai/customization/jwt-authentication).
By following these steps, you should be able to generate the necessary JWT token to authenticate your API requests successfully.