Overview
OpenAI’s GPT-4 and GPT-3.5 models are reliable, well-documented AI coding assistants. Known for consistency, strong general-purpose capabilities, and excellent documentation generation.GPT-4 Turbo offers the best balance of performance and cost for most coding tasks.
Quick Start
1
Get API Key
- Go to platform.openai.com
- Sign up or log in
- Navigate to API Keys
- Click Create new secret key
- Copy your API key (starts with
sk-)
2
Add Credits
OpenAI requires prepaid credits:
- Go to Billing → Add payment method
- Add credit card
- Purchase credits ($5+ recommended)
3
Configure Forge
Edit
.forge/config.json:4
Test Connection
Available Models
GPT-4 Family
Best overall GPT-4 model
- Context: 128K tokens
- Speed: Fast
- Cost: 30/MTok output
- Best for: Complex coding tasks
Original GPT-4 (legacy)
- Context: 8K tokens
- Speed: Slower
- Cost: 60/MTok output
- Best for: Nothing (use Turbo instead)
Use
gpt-4-turbo instead - faster and cheaper!GPT-3.5 Family
Fast and affordable
- Context: 16K tokens
- Speed: Very fast
- Cost: 1.50/MTok output
- Best for: Simple tasks, quick fixes
Model Comparison
| Model | Context | Speed | Cost | Quality |
|---|---|---|---|---|
| GPT-4 Turbo | 128K | ⭐⭐⭐⭐ | $$$ | ⭐⭐⭐⭐ |
| GPT-4 | 8K | ⭐⭐ | $$$$ | ⭐⭐⭐⭐ |
| GPT-3.5 Turbo | 16K | ⭐⭐⭐⭐⭐ | $ | ⭐⭐⭐ |
Recommendation: Use GPT-4 Turbo for most tasks, GPT-3.5 Turbo for simple fixes.
Configuration
Basic Setup
Advanced Configuration
Your OpenAI organization ID (for enterprise accounts)
Maximum tokens in response (1-4096)
Randomness (0-2)
- 0 = Deterministic
- 1 = Balanced
- 2 = Creative
OpenAI’s Strengths
Consistency
GPT-4 produces reliable, consistent results:General Purpose
Good at everything, great at nothing:Documentation
Excellent at writing clear documentation:Large Ecosystem
Most tools integrate with OpenAI:- Extensive docs
- Large community
- Many examples
- Well-tested
OpenAI’s Weaknesses
Expensive
GPT-4 is one of the most expensive options:Not Exceptional
Jack of all trades, master of none:- Claude better at reasoning
- Gemini faster and cheaper
- Cursor better at UI
Requires Prepaid Credits
Can’t pay-as-you-go:- Must purchase credits upfront
- Minimum $5
- Credits expire (usually 1 year)
Pricing
Per-Token Costs
| Model | Input | Output | Example |
|---|---|---|---|
| GPT-4 Turbo | $10/MTok | $30/MTok | 10K in + 2K out = $0.16 |
| GPT-4 | $30/MTok | $60/MTok | 10K in + 2K out = $0.48 |
| GPT-3.5 Turbo | $0.50/MTok | $1.50/MTok | 10K in + 2K out = $0.008 |
Prepaid Credits
Best Use Cases
Documentation
General Coding
Testing
Consistency-Critical Tasks
When you need predictable results:Integration with Forge
Using in Tasks
Multiple OpenAI Configs
Configure both GPT-4 and GPT-3.5:Cost Optimization
Use GPT-3.5 for Simple Tasks
Reduce Context
Lower Max Tokens
Monitor Spending
Troubleshooting
401 Invalid API Key
401 Invalid API Key
Error: “Incorrect API key provided”Solutions:
- Verify API key from platform.openai.com
- Check for extra spaces
- Ensure key hasn’t been deleted
- Generate new key
429 Rate Limit
429 Rate Limit
Error: “Rate limit reached”Solutions:
- Wait a few seconds
- Reduce concurrent requests
- Upgrade tier (Tier 1 → Tier 2)
- Use exponential backoff
Insufficient Credits
Insufficient Credits
Error: “You exceeded your current quota”Solutions:
- Add more credits: platform.openai.com/billing
- Check billing dashboard
- Verify payment method
Slow responses
Slow responses
Issue: GPT-4 taking too longSolutions:
- Use GPT-4 Turbo (not regular GPT-4)
- Use GPT-3.5 for simple tasks
- Reduce maxTokens
- Check OpenAI status page
Context length error
Context length error
Error: “This model’s maximum context length is…”Solutions:
- Use GPT-4 Turbo (128K context)
- Reduce input context
- Split task into smaller pieces
Rate Limits
By Tier
| Tier | RPM | TPM | How to Reach |
|---|---|---|---|
| Free | 3 | 40K | New account |
| Tier 1 | 500 | 30K | $5+ paid |
| Tier 2 | 5000 | 450K | $50+ paid + 7 days |
| Tier 3 | 10000 | 1M | $1000+ paid + 7 days |
Best Practices
Use GPT-3.5 for Simple Tasks
Monitor Usage
Set Budget Alerts
On OpenAI dashboard:
- Set hard limit ($50/month)
- Email alerts at 75%, 90%
Use for Documentation
GPT-4 excels at docs:
OpenAI vs Other Agents
| Feature | OpenAI | Claude | Gemini | Cursor |
|---|---|---|---|---|
| Quality | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Cost | $$$$ | $$$ | $ | Subscription |
| Speed | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Context | 128K | 200K | 2M | Variable |
| Consistency | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ |

