How to Get Your OpenAI API Key (Updated July 2025)

How to Get Your OpenAI API Key (Updated July 2025)

This guide walks you through setting up your OpenAI API key, connecting it to your tool, and protecting yourself from unexpected charges.

  1. Go to the OpenAI Platform
    Visit https://platform.openai.com and sign in or create a free account. You’ll need to verify your email and phone number.
  2. Access Your API Keys
    Click your profile icon in the top-right → select API Keys or go directly to: platform.openai.com/account/api-keys
  3. Create a New Secret Key
    Click + Create new secret key. Name it something like “Bio Generator Key”, then click Create. Copy the key right away — it won’t be shown again.
  4. Paste It Into Your Code
    In your code (e.g. generate-bio.php), replace:
    $api_key = 'YOUR_OPENAI_API_KEY_HERE';
    with your actual key:
    $api_key = 'sk-abc123...';
  5. Add Your Billing Info
    Go to Billing Overview and add a payment method. Even free credits require this.
  6. Set Usage Limits (Recommended)
    Go to Usage & Limits → scroll to the bottom. Set:
    • Soft limit — Sends warning emails (e.g. $10/month)
    • Hard limit — Blocks usage past a certain spend (e.g. $20/month)
  7. Check Free Trial Credits
    On the same page, you may see “Promotional Credits” if your account is new (usually $5–$18).

✅ You’re Ready to Build

Your API key is live, your billing is set, and usage limits are in place. You’re now ready to plug your key into the Smart Bio Generator or any other AI tool you’re building.

Need help integrating the key into your tool? Head back to the main tutorial or check out the full video walkthrough.