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.
Available Models
Roo Code supports all models available through OpenAI's API.
For the complete, up-to-date model list and capabilities, see OpenAI's models documentation.
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.
- (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 that cannot be changed.
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 current model costs and discounts, including prompt caching.
- Azure OpenAI Service: If you'd like to use the Azure OpenAI service, please see our section on OpenAI-compatible providers.
- Context Optimization: For GPT-5-Codex, leverage prompt caching by maintaining consistent context across requests to reduce costs significantly.