How to Set Up API Key Authentication

Authenticate with API Keys - AUTH v1

Step 1: Obtain Your API Key

  1. Connect to OpenAI deveoper portal. [LINK]

  2. Navigate to the API Keys section in the user section.

  3. 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

  1. 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 || '',
      )
    }
    
  2. Avoid Hardcoding the API Key Do not include your API Key directly in your source code, especially in public repositories.

  3. Regenerate Keys if Compromised If you suspect your API Key has been exposed, regenerate it immediately through the developer portal.

Last updated