Goose logo
Coding agents

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

1

Provider setup

  1. 1.

    Install Goose CLI using the installer linked in its official repository: https://github.com/block/goose. Review any installer before running it.

  2. 2.

    Create a TokenRex API key, then copy an enabled chat model's exact ID from Models & Pricing. The examples use openai/gpt-6-astra; replace it with your selected ID.

  3. 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. 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. 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. 6.

    Start with a read-only question. Approve local tools only after reviewing the proposed action.

Configuration
bash
# TOKENREX_API_KEY must already be set privately
GOOSE_PROVIDER=litellm \
GOOSE_MODEL='openai/gpt-6-astra' \
LITELLM_HOST='https://tokenrex.ai/api/public' \
LITELLM_BASE_PATH='v1/chat/completions' \
LITELLM_API_KEY="$TOKENREX_API_KEY" \
goose session
Setup reference
2

Custom provider

  1. 1.

    Use Goose's documented custom-provider configuration as an alternative to the built-in LiteLLM adapter.

  2. 2.

    Choose the OpenAI-compatible protocol, enter https://tokenrex.ai/api/public/v1, store the key privately and register your exact model ID.

  3. 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.

Setup reference

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.