How to create a new public key via API?
# support
a
How to create a new public key via API?
@Vapi Support Bot
c
Hi Awezome, To create a new public key for API access, you can follow these steps using the Vapi CLI or API: 1. **Generate a JWT Token**: Refer to [JWT Authentication](https://docs.vapi.ai/customization/jwt-authentication) for guidance on generating a JWT token. Ensure you set the token scope to 'public' for access to public endpoints like
https://api.vapi.ai/call/web
. 2. **API Key Authentication**: If you'd prefer to manage via the Vapi CLI, perform the following: - Use
vapi login
for OAuth authentication which securely stores tokens. - Alternatively, use API keys via environment variables for scripts:
export VAPI_API_KEY=your-api-key
. Make sure you securely handle any generated keys or tokens. If you need further assistance, please let me know.