Skip to Content
Nexalexica Beta 1.0.0 is released 🎉 Try it now
DocumentationAPIOpenAI API Setup Guide

OpenAI API Setup Guide

Getting Your OpenAI API Key

Step 1: Create an OpenAI Account

  1. Visit platform.openai.com 
  2. Click “Sign Up” to create an account
  3. Verify your email and complete the setup process

Step 2: Add Payment Method

  1. Navigate to your account settings
  2. Go to “Billing” section
  3. Add a payment method to enable API access

Step 3: Generate API Key

  1. Go to platform.openai.com/api-keys 
  2. Click “Create new secret key”
  3. Name your key and copy it securely (starts with sk-)

Available OpenAI Models

GPT-4.1 Family (Latest - 2025)

  • gpt-4.1 - Most advanced model with improved reasoning
  • gpt-4.1-mini - Smaller, faster, and cheaper alternative
  • gpt-4.1-nano - Ultra-efficient for simple tasks

GPT-4o Family

  • gpt-4o - Multimodal model with vision, audio, and text
  • gpt-4o-mini - Fast, affordable small model
  • gpt-4o-mini-audio-preview - Audio input capabilities

GPT-4 Family

  • gpt-4-turbo - Enhanced GPT-4 with larger context
  • gpt-4 - Original GPT-4 model

GPT-3.5 Family

  • gpt-3.5-turbo - Fast and cost-effective for many tasks
  • gpt-3.5-turbo-instruct - Instruction-following optimized

Key Features

  • Up to 1 million tokens of context (GPT-4.1 family)
  • Multimodal capabilities (text, images, audio)
  • Function calling and tool use
  • JSON mode for structured outputs
  • Improved coding and instruction following

Context Windows

  • GPT-4.1 family: Up to 1 million tokens
  • GPT-4o: 128K tokens
  • GPT-4: 8K-32K tokens
  • GPT-3.5-turbo: 16K tokens

Pricing

  • Usage-based pricing per token
  • Different rates for input/output tokens
  • Volume discounts available
  • Monitor usage in your OpenAI dashboard

Security Tips

  • Never commit keys to version control
  • Regularly rotate your API keys
  • Monitor usage for unexpected charges
Last updated on