How to Use TokenAir with Roo Code: Tool-Calling Limits
TokenAir can significantly lower Roo Code model spend when a lower-cost model completes the same native tool workflow with an acceptable result. Roo Code accepts a custom OpenAI-compatible endpoint. It also requires native tool calling, so a basic chat response does not prove compatibility.
Compatibility verdict
Limited setup
Roo Code's Base URL, key, and model fields match TokenAir's endpoint. Roo has no XML tool fallback, which leaves the integration limited until streamed native tool events pass a real task.
A custom endpoint path exists, but important features or request shapes need separate testing.
Before you start
- A current Roo Code extension with OpenAI Compatible available as a provider.
- A TokenAir API key and exact model ID.
- A model expected to support OpenAI-style function calling and one safe tool-use test.
Setup and compatibility steps
Step 1
Select OpenAI Compatible
Open Roo Code settings and choose OpenAI Compatible. This exposes the Base URL, API key, model, and advanced model fields.
Step 2
Add the TokenAir values
Enter the TokenAir Base URL, key, and exact model ID. Do not claim image, computer-use, context, or output capabilities that you have not confirmed.
Step 3
Check normal chat first
Send a short request to catch authentication and model errors before Roo begins an agent loop.
Step 4
Test the native tool stream
Ask Roo to read one file and summarize it. Confirm that the streamed tool name and arguments contain valid JSON, the result returns to the model, and the task reaches a final answer.
Roo Code provider settings to test
API Provider: OpenAI Compatible
Base URL: https://api.tokenair.ai/v1
API Key: YOUR_TOKENAIR_API_KEY
Model ID: YOUR_TOKENAIR_MODEL_IDReplace placeholders with values from your own TokenAir account. Never commit an API key to source control.
How to verify it
- Roo Code connects and returns a complete chat response.
- The model receives Roo's OpenAI-style tool definitions.
- A tool call streams a valid name and complete JSON arguments.
- Roo executes the tool, sends back its result, and receives a useful final answer.
How to lower cost without hiding quality loss
TokenAir gives the client access to premium and lower-cost model choices through one OpenAI-compatible API. Savings depend on matching each task with a model that still passes review.
- Use a small read-only tool task before any file or terminal mutation.
- Keep a stronger model for workflows where tool accuracy or recovery matters more than token price.
- Include broken tool calls and repeated agent turns in the cost comparison.
Limits to know before production
- Roo Code uses native tool calling exclusively and does not provide an XML fallback.
- Some OpenAI-compatible providers implement chat but only part of the native tools API.
- TokenAir has not yet published model-specific proof for streamed Roo Code tool calls.
FAQ
Can Roo Code use a TokenAir Base URL?
Yes for endpoint configuration. Roo Code documents an OpenAI Compatible provider with Base URL, API key, and model fields.
Why can chat work while Roo tools fail?
Chat only needs a text response. Roo also needs native tool definitions, streamed tool calls, valid arguments, and tool-result continuation.
Does Roo Code fall back to XML tools?
No. Roo Code's official documentation says native tool calling is the only supported protocol.
Official sources and related TokenAir docs
Tool settings change between releases. We checked these notes on July 17, 2026. Review the linked tool docs again before a production rollout.
Try one workflow before changing the default.
Use the cost checkup to choose a bounded test, then compare cost per accepted result with your current route.