Use TokenRex with Goose
Run Goose with TokenRex through its configurable OpenAI-compatible LiteLLM adapter.
Use a model that supports tool calling for agent tasks. Review file, terminal and connected-account permissions before allowing actions. Provider setup is documented; a live connection from this app has not been tested. This uses Goose's built-in LiteLLM adapter directly against TokenRex; no separate LiteLLM server is required. 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
- Goose CLI installed
- A TokenRex API key
- An enabled tool-capable chat model
Setup methods
Provider setup
- 1
Install Goose CLI using the installer linked in its official repository: https://github.com/block/goose. Review any installer before running it.
- 2
Create a TokenRex API key, then copy an enabled chat model's exact ID from Models & Pricing. The examples use gpt-6-astra; replace it with your selected ID.
- 3
Set TOKENREX_API_KEY privately in the shell or service environment. The configuration below reuses it without storing a literal key in a Goose config file.
- 4
Use GOOSE_PROVIDER=litellm, LITELLM_HOST=https://tokenrex.ai/api/public and LITELLM_BASE_PATH=v1/chat/completions. Goose's adapter separates the host from the full chat-completions path; do not paste https://tokenrex.ai/api/public/v1 into both settings.
- 5
Set GOOSE_MODEL to the exact TokenRex model ID, then run the shell block below from your project folder. Keep these environment settings scoped to this Goose session.
- 6
Start with a read-only question. Approve local tools only after reviewing the proposed action.
# TOKENREX_API_KEY must already be set privately
GOOSE_PROVIDER=litellm \
GOOSE_MODEL='gpt-6-astra' \
LITELLM_HOST='https://tokenrex.ai/api/public' \
LITELLM_BASE_PATH='v1/chat/completions' \
LITELLM_API_KEY="$TOKENREX_API_KEY" \
goose sessionCustom provider
- 1
Use Goose's documented custom-provider configuration as an alternative to the built-in LiteLLM adapter.
- 2
Choose the OpenAI-compatible protocol, enter https://tokenrex.ai/api/public/v1, store the key privately and register your exact model ID.
- 3
Review the fields for your installed Goose release, then start a read-only task. A separate LiteLLM proxy is not required by the primary adapter method.
Troubleshooting
- 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.