Skip to main content

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

  1. Go to platform.openai.com
  2. Sign up or log in
  3. Navigate to API Keys
  4. Click Create new secret key
  5. Copy your API key (starts with sk-)
2

Add Credits

OpenAI requires prepaid credits:
  1. Go to BillingAdd payment method
  2. Add credit card
  3. Purchase credits ($5+ recommended)
3

Configure Forge

Edit .forge/config.json:
4

Test Connection


Available Models

GPT-4 Family

gpt-4-turbo
model
Best overall GPT-4 model
  • Context: 128K tokens
  • Speed: Fast
  • Cost: 10/MTokinput,10/MTok input, 30/MTok output
  • Best for: Complex coding tasks
gpt-4
model
Original GPT-4 (legacy)
  • Context: 8K tokens
  • Speed: Slower
  • Cost: 30/MTokinput,30/MTok input, 60/MTok output
  • Best for: Nothing (use Turbo instead)
Use gpt-4-turbo instead - faster and cheaper!

GPT-3.5 Family

gpt-3.5-turbo
model
Fast and affordable
  • Context: 16K tokens
  • Speed: Very fast
  • Cost: 0.50/MTokinput,0.50/MTok input, 1.50/MTok output
  • Best for: Simple tasks, quick fixes

Model Comparison

Recommendation: Use GPT-4 Turbo for most tasks, GPT-3.5 Turbo for simple fixes.

Configuration

Basic Setup

Advanced Configuration

organization
string
Your OpenAI organization ID (for enterprise accounts)
maxTokens
number
default:"4096"
Maximum tokens in response (1-4096)
temperature
number
default:"1.0"
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:
Result: Clear, well-structured docs with examples.

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

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:
Use appropriately:

Cost Optimization

Use GPT-3.5 for Simple Tasks

Reduce Context

Lower Max Tokens

Monitor Spending


Troubleshooting

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
Error: “Rate limit reached”Solutions:
  • Wait a few seconds
  • Reduce concurrent requests
  • Upgrade tier (Tier 1 → Tier 2)
  • Use exponential backoff
Error: “You exceeded your current quota”Solutions:
  • Add more credits: platform.openai.com/billing
  • Check billing dashboard
  • Verify payment method
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
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

RPM = Requests per minute TPM = Tokens per minute Check your tier: platform.openai.com/account/limits

Best Practices

Use GPT-3.5 for Simple Tasks

Reserve GPT-4 for complex work

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

Choose OpenAI for: Documentation, consistency, general purpose Choose Claude for: Complex reasoning, architecture Choose Gemini for: Speed, cost, large context Choose Cursor for: UI/UX, frontend

Real-World Examples

Example 1: API Documentation

Example 2: Test Generation


Next Steps

Get Started

Create your first GPT-4 task

Other Agents

Compare with other AI agents

Cost Optimization

Reduce OpenAI spending

OpenAI Platform

Manage your API keys and billing