Documentation
Roo Code Integration Guide
Connect the Roo Code AI development environment to A4F for access to a diverse range of models.
Introduction
Roo Code is an advanced AI development environment designed to enhance coding workflows. By integrating it with A4F, you can power Roo Code's features with a wider selection of AI models, ensuring you always have the best tool for the job. This guide will walk you through the setup process.
Prerequisites
Before you start, make sure you have the following:
- The Roo Code extension (v3.22.6 or later) installed in your IDE.
- An active A4F account.
- Your A4F API Key, which you can get from the API Keys dashboard.
Configuration Guide
- Create a Configuration Profile
Open the Roo Code settings and navigate to the "Providers" tab. Click the `+` button next to "Configuration Profile" to create a new profile. Name it something memorable, like "A4F Web".
Image Placeholder: Creating a Roo Code Profile
A vertical screenshot showing the "Configuration Profile" section with the `+` button highlighted. - Set API Provider and Credentials
Configure the main API settings as follows:
- API Provider: Select "OpenAI Compatible".
- Base URL: Enter
https://api.a4f.co/v1
. - API Key: Paste your A4F API key.
- Model: Enter the A4F model ID (e.g.,
provider-5/claude-sonnet-4
). Roo Code will attempt to auto-fetch available models from the A4F endpoint.
Verify Model Access
Ensure the model you select is available in your A4F plan (Free, Basic, or Pro). If you choose a model not included in your tier, you will receive an error. Check the Models page first.Image Placeholder: API Provider Settings
A vertical screenshot showing the API Provider, Base URL, API Key, and Model fields configured for A4F. - Configure Model Parameters & Capabilities
Scroll down to configure the model's behavior. Most settings can be left at their default, but pay attention to these:
- Enable streaming: It is highly recommended to keep this checked for real-time responses. If you are an advanced user troubleshooting an issue, you can uncheck it to test non-streamed output.
- Max Output Tokens / Context Window Size: Adjust these values to match the specifications of your chosen model, as listed on our Models page.
- Image Support / Computer Use: Only check these if your selected model has `vision` capabilities. "Computer Use" is dependent on "Image Support" and works best with top-tier vision models.
- Prompt Caching: Leave this unchecked.
- Input / Output Price: These can be set for your own reference but are not required.
Image Placeholder: Model Parameters & Capabilities
A vertical screenshot showing the Context Window, Image Support, and Pricing fields. - Enable Advanced Editing
This is one of the most powerful features for coding.
Enable Editing Through Diffs (Recommended)
You should strictly enable this option. It allows the AI to apply targeted changes (diffs) to your code instead of rewriting entire files, which is much more efficient. This feature works best with powerful models that excel at agentic coding tasks. For model recommendations, consult leaderboards like the one at Aider Chat Leaderboards.Image Placeholder: Advanced Editing and Final Settings
A vertical screenshot showing the "Enable editing through diffs" checkbox and the temperature/rate limit sliders.
Final Checklist
- Leave "Enable Reasoning Effort", "Use Legacy OpenAI API format", and other advanced toggles at their default values unless you are an expert user.
- Set the "Rate limit" slider to `0s`.
- "Use custom temperature" is optional.
- Click the **Save** button at the top of the settings panel to apply your changes.
Activating Your Profile
After saving, you will be returned to the main Roo Code screen. At the bottom of the interface, select "Code" mode and choose your newly created profile (e.g., "A4F Web") from the dropdown. You are now ready to code with A4F!
Image Placeholder: Activating the A4F Profile
A vertical screenshot of the main Roo Code UI, highlighting the profile selection dropdown at the bottom.
Version Information
Was this page helpful?