appendix

appendix.  OpenAI API Key

 
  1. Create an OpenAI account. Visit https://platform.openai.com, and click Sign up. You can register using your email address or sign in with a Google or Microsoft account. After signing up, you’ll need to verify your email address.
  2. Add a payment method. Navigate to the billing section by clicking your profile icon and selecting Billing. Click Add Payment Method to register a credit or debit card. OpenAI requires a payment method on file even if you plan to use free credits.
  3. Check credits and add funds. New accounts previously received $5–$18 in free credits, but this policy has changed. Check your current balance in the Billing section. If you have no credits, click Add to Credit Balance and add at least $5 to get started. The minimum charge is $5, and credits expire after one year.
  4. Generate your API key. Go to the API Keys section (https://platform.openai.com/api-keys), and click Create New Secret Key.” Give your key a descriptive name like agent-development, and click Create Secret Key.
Figure A.1 Example of storing the OpenAI API key in a .env file