
Use TokenRex with Aider
Use TokenRex as a custom OpenAI-compatible provider in Aider.
Provider setup checked against the official reference. Live execution inside this third-party tool has not been tested; model limits, streaming and tool behavior must be verified separately.
Before you start
- A TokenRex API key
- A version of the app that accepts a custom OpenAI-compatible base URL
Setup methods
Provider setup
- 1
Install Aider using its official guide and open a terminal in an authorized project.
- 2
Set your private key in OPENAI_API_KEY and versioned URL in OPENAI_API_BASE. The example assumes TOKENREX_API_KEY is already set privately.
- 3
Aider's openai/ routing prefix precedes the TokenRex model ID, so the example uses openai/gpt-6-astra.
- 4
Substitute your enabled model ID and run the example. An unfamiliar model may produce a metadata warning; consult Aider's guidance and supply verified model metadata separately if needed.
- 5
Start with a read-only question, check TokenRex usage and review edits before accepting them.
# TOKENREX_API_KEY must already be set privately
export OPENAI_API_BASE="https://tokenrex.ai/api/public/v1"
export OPENAI_API_KEY="$TOKENREX_API_KEY"
aider --model openai/gpt-6-astraTroubleshooting
- Authentication fails
- Check that the saved TokenRex key is active and belongs in the tool's API-key field, not its subscription sign-in. Remove accidental spaces, check your wallet balance, and never share the key in screenshots or exported settings.
- The model is missing or the request URL returns 404
- Copy an exact enabled model ID from Models & Pricing. Follow this method's URL field: some tools expect the versioned base, others the root or full completion address. Check the documented API protocol before changing the path.
- Chat works but streaming or tools fail
- Test a short plain-text conversation first. Confirm the selected model and installed tool version support the required protocol and capabilities. Enable agent actions only after separately checking streaming and tool calls.
Verify the connection
Send a short message with the selected model, read its response, then confirm the exact model appears in your TokenRex usage. Test streaming and tool use separately before larger agent tasks.