Models → Pricing → Docs → Blog → Changelog → Contact → Status →
Get started freeLog in

Roo Code Setup: Connect an OpenAI-Compatible API

A checklist, not an essay. Work down the list, tick each item, and Roo Code is running on FreeModel with a model that can actually edit your files.

Roo Code is an AI coding agent that runs inside VS Code. It plans a task, reads and edits files, and runs terminal commands, asking for your approval along the way. It belongs to the same family of extensions as Cline and Kilo Code, and like them it can talk to any OpenAI-compatible API.

This post is a checklist. Each item is something that, if skipped, is a common reason a setup does not work.

Checklist: before you open VS Code

  • ☐ Account created at freemodel.in/register. Free tokens need a one-time Telegram verification; no card.
  • ☐ Key created at Dashboard → API Keys. It starts with fm_ and is shown once, so copy it now. Keep the default inference and models:read scopes.
  • ☐ Key tested from a terminal:
curl https://freemodel.in/v1/models \
  -H "Authorization: Bearer fm_your_key_here"
  • ☐ Model id chosen and copied exactly from that response. On the free plan, use a free model; this post uses gpt-6-luna.
  • ☐ Model has the Tools capability. Roo Code does its work through tool calls. A model without Tools can chat but cannot edit files. Check on the models page.

Checklist: Roo Code settings

Open the Roo Code panel in VS Code and go to its settings. In the provider section:

☐FieldValue
☐API ProviderOpenAI Compatible
☐Base URLhttps://freemodel.in/v1
☐API Keyyour fm_ key
☐Modelgpt-6-luna (or another id from /v1/models)

Pick OpenAI Compatible, not the plain OpenAI provider: only the compatible provider lets you set your own base URL. The base URL ends at /v1. Roo Code adds /chat/completions itself, so a URL that already contains it fails.

Depending on your Roo Code version, the provider section may also show model details such as context window size, maximum output tokens and image support. If they are there, fill them from the model's page: GPT-6 Luna, for example, lists a 1M context and the Vision capability. Do not enter a context size for models whose page does not publish one; leave Roo Code's default.

☐ Save, open a new task, and ask for something small, such as "list the files in this folder". If Roo Code asks to run a tool, the connection works.

Checklist: models per mode

Roo Code has modes (for example Code, Architect, Ask and Debug) and lets you save several provider configurations as profiles. That is useful with FreeModel because one key reaches many models:

  • ☐ A light profile with a free model for Ask-style questions.
  • ☐ A heavy profile for planning or big refactors. On a paid plan, a model such as Claude Sonnet 5 is available.
  • ☐ Same base URL and key in both. Only the model id changes.

Claude models other than Claude Haiku 5.5 need a paid plan. Plans are prepaid for 30 days with no auto-renew, and every paid plan reaches every model. Each model uses plan tokens at its own rate; Claude Sonnet 5 is 3×, so one token on it counts as three plan tokens.

Checklist: cost control

Agents are token-heavy. Every step resends the task history plus any files the agent has read.

  • ☐ Start new tasks often. A long task carries its whole history on every request.
  • ☐ Keep auto-approve narrow until you trust the model on your codebase.
  • ☐ Know the limits. The free plan has no daily cap, but a free account is limited to 400K tokens per minute. When tokens run out, the API answers 402 and nothing more is charged.
  • ☐ Use a separate key for Roo Code so its usage is easy to tell apart from other tools.

Checklist: after the first task

  • ☐ Look at the usage. Open your FreeModel dashboard and check how many tokens that first small task used. It gives you a feel for what a real task will cost on your plan.
  • ☐ Try images only on Vision models. If you paste a screenshot into a task, the selected model must have the Vision capability, or the request is refused.
  • ☐ Expect long answers to stream. Streaming connections stay open up to 15 minutes on /v1/chat/completions and /v1/responses and up to an hour on /v1/messages, with a keep-alive ping every 8 seconds, so long agent steps are not dropped as idle.

Checklist: when something fails

ErrorCheck
401Key pasted in full, not revoked
403 upgrade_requiredFree account using a paid model; switch to a free model or upgrade
403 insufficient_scopeKey is missing models:read or inference
404 model_not_foundModel id copied exactly; names like gpt-4o are not mapped to another model
402Tokens used up (tokens_exhausted)
429Plan rate limit for this key; wait for Retry-After
503Model temporarily unavailable; try again later or pick another model
Chats but never editsModel has no Tools capability
Empty repliesReasoning model used its output budget on thinking; raise max output tokens

The same values work in the sibling extensions: see the Cline guide and the coding agents docs.

FAQ

Is Roo Code set up the same way as Cline and Kilo Code?

The FreeModel values are the same for all three: the OpenAI Compatible provider, base URL https://freemodel.in/v1, your fm_ key and a model id from GET /v1/models.

Does Roo Code need a model with tool calling?

Yes. Roo Code reads and edits files and runs commands through tools, so pick a model with the Tools capability on the FreeModel models page.

Can I use a free model with Roo Code?

Yes. The free models such as gpt-6-luna have the Tools capability. The free plan has no daily cap, but a free account is limited to 400K tokens per minute, and agent tasks use tokens quickly, so watch your usage.

Is a cancelled request billed?

A request that fails is not charged. If you stop a streaming answer, tokens the model already generated are counted.

Ready to build?

Grab a free API key — 1M tokens on 8 free models after a one-time Telegram verification, no card. Every model from $1.20.