Skip to content

OpenAI Setup

OpenAI GPT Setup

Getting Your API Key

  1. Visit OpenAI Platform
  2. Create an account or sign in
  3. Navigate to API Keys
  4. Click Create new secret key
  5. Copy the generated key

Free Tier

  • No free tier available
  • Pay-as-you-go pricing
  • $5 minimum credit purchase to start

Environment Variables

Terminal window
export OPENAI_API_KEY="your-api-key-here"

Add to your shell profile to persist:

Terminal window
echo 'export OPENAI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc

Verify Your Setup

Test your API key:

Terminal window
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"

A successful response lists available models. Verify your key and billing if you receive an error.