Using OpenAI With Roo Code
Roo Code supports accessing models directly through the official OpenAI API, including the latest GPT-5 family with advanced features like reasoning effort control and verbosity settings.
Website: https://openai.com/
Getting an API Key
- Sign Up/Sign In: Go to the OpenAI Platform. Create an account or sign in.
- Navigate to API Keys: Go to the API keys page.
- Create a Key: Click "Create new secret key". Give your key a descriptive name (e.g., "Roo Code").
- Copy the Key: Important: Copy the API key immediately. You will not be able to see it again. Store it securely.
Supported Models
GPT-5 Family (Latest)
The GPT-5 models are OpenAI's most advanced, offering superior coding capabilities and agentic task performance:
gpt-5-2025-08-07
(default) - Best model for coding and agentic tasksgpt-5-mini-2025-08-07
- Faster, cost-efficient for well-defined tasksgpt-5-nano-2025-08-07
- Fastest, most cost-efficient option
GPT-4.1 Family
Advanced multimodal models with balanced capabilities:
gpt-4.1
- Advanced multimodal modelgpt-4.1-mini
- Balanced performancegpt-4.1-nano
- Lightweight option
o3 Reasoning Models
Models with configurable reasoning effort for complex problem-solving:
o3
,o3-high
,o3-low
- Different reasoning effort presetso3-mini
(medium reasoning effort)o3-mini-high
(high reasoning effort)o3-mini-low
(low reasoning effort)
o4 Models
Latest mini reasoning models:
o4-mini
,o4-mini-high
,o4-mini-low
o1 Family
Original reasoning models:
o1
- Original reasoning modelo1-preview
- Preview versiono1-mini
- Smaller variant
GPT-4o Family
Optimized GPT-4 models:
gpt-4.5-preview
gpt-4o
- Optimized GPT-4gpt-4o-mini
- Smaller optimized variant
Refer to the OpenAI Models documentation for the most up-to-date list of models and capabilities.
Configuration in Roo Code
Setup
- Open Roo Code Settings: Click the gear icon () in the Roo Code panel.
- Select Provider: Choose "OpenAI" from the "API Provider" dropdown.
- Enter API Key: Paste your OpenAI API key into the "OpenAI API Key" field.
- Select Model: Choose your desired model from the "Model" dropdown (defaults to
gpt-5-2025-08-07
). - (Optional) Base URL: If you need to use a custom base URL, enter the URL. Most people won't need to adjust this.
Advanced Features
Reasoning Effort Control
For models that support reasoning (GPT-5, o1, o3, o4 families), you can control how deeply the model thinks:
GPT-5 Models:
minimal
- Fastest responses with basic reasoninglow
- Quick responses with light reasoningmedium
(default) - Balanced reasoning and response timehigh
- Deep reasoning for complex problems
o1/o3/o4 Models:
low
- Minimal thinking timemedium
- Balanced approachhigh
- Maximum thinking for complex problems
Some models have preset reasoning levels (e.g., o3-high
always uses high reasoning).
Verbosity Control
Available for GPT-5 models and select others, verbosity controls the detail level of responses:
low
- Concise, direct responsesmedium
(default) - Balanced detailhigh
- Comprehensive, detailed responses
Temperature Settings
Temperature controls output randomness (0.0 to 2.0):
- GPT-5 models: Default 1.0 for balanced creativity
- Other models: Default 0.0 for deterministic output
- Note: Not available for o1/o3 reasoning models
Conversation Continuity (GPT-5)
GPT-5 models maintain conversation context efficiently through response IDs, reducing token usage while preserving context. This happens automatically - no configuration needed.
Tips and Notes
- Pricing: Refer to the OpenAI Pricing page for details on model costs.
- Azure OpenAI Service: If you'd like to use the Azure OpenAI service, please see our section on OpenAI-compatible providers.