How to Set Up API Key Authentication
Authenticate with API Keys - AUTH v1
Step 1: Obtain Your API Key
Connect to OpenAI deveoper portal. [LINK]
Navigate to the API Keys section in the user section.
Generate a new API Key.
โ ๏ธ Important: Treat your API Keys like passwords. Do not share them or expose them in public repositories. We are working on releasing an API Key with a dedicated endpoint to securely
Best Practices for API Keys Security
Use Environment Variables Store your API Keys securely by using environment variables. For example:
PRIVATE_KEY=your-token
Access it in your code:
function main() { /** * Initialize the config manager */ const configManager = new ConfigManager(); /** * Create the default config for the agent */ configManager.createDefaultConfig( process.env.PRIVATE_KEY || '', process.env.OPENAI_KEY || '', ) }
Avoid Hardcoding the API Key Do not include your API Key directly in your source code, especially in public repositories.
Regenerate Keys if Compromised If you suspect your API Key has been exposed, regenerate it immediately through the developer portal.
Last updated