Skip to main content

Crush Setup Tutorial

This tutorial will guide you through adding your CheapTokenRouter API key to the Crush Terminal Agent.

Prerequisites

Before you begin, make sure you have:

  • A CheapTokenRouter API key
  • Crush installed on your computer

Step 1: Get Your CheapTokenRouter API Key

  1. Navigate to your CheapTokenRouter dashboard
  2. Goto the API Keys module [https://cheaptokenrouter.com/dashboard/keys]
  3. Click Create Key and give it a nickname / alias memorable to you
  4. Copy down this API key and store it securely until you need to use it Get Your API Key

Step 2: Download A Copy Of crush.json

crush.json

  1. Download a copy of the latest crush.json with all our models pre-filled in here [https://cheaptokenrouter.com/crush.json]
  2. Move the file to your user's main profile at: ~/.config/crush/crush.json (Alternatively, use the terminal command below to download the config and copy it to your default settings in one line)
wget https://cheaptokenrouter.com/crush.json -O ~/.config/crush/crush.json

Step 3: Set Up Your Environment

Model Selection

  1. Since we don't want to store your API key in plain text in the config file, we need to configure your environment to automatically load your CheapTokenRouter API key when you start up a new terminal session.
  2. Use the corresponding command to add your CHEAP_TOKEN_ROUTER_API_KEY to your environment. You can use the command below to figure out which shell you're using:
echo $SHELL

- Bash (Linux/macOS):

`echo 'export CHEAP_TOKEN_ROUTER_API_KEY=sk-demokey' >> ~/.bashrc`

- Zsh (Linux/macOS):

`echo 'export CHEAP_TOKEN_ROUTER_API_KEY=sk-demokey' >> ~/.zshrc`

- Bash (older macOS):

`echo 'export CHEAP_TOKEN_ROUTER_API_KEY=sk-demokey' >> ~/.bash_profile`

- Fish shell:

`echo 'set -x CHEAP_TOKEN_ROUTER_API_KEY sk-demokey' >> ~/.config/fish/config.fish`

- Csh/Tcsh:

`echo 'setenv CHEAP_TOKEN_ROUTER_API_KEY sk-demokey' >> ~/.cshrc`

- PowerShell (Windows):

`Add-Content -Path $PROFILE -Value '$env:CHEAP_TOKEN_ROUTER_API_KEY = "sk-demokey"'`

Remember to substitute your ACTUAL API key from Step 1 in for sk-demokey above!

Step 4: Select Your Model

Model Selection

  1. Refresh your terminal by closing it and then re-opening it again.
  2. Enter crush in your project folder and press ctrl + P to enter the commands menu, then go down to Switch Model.
  3. Search for the model you want in CheapTokenRouter and press enter.
  4. You're ready to begin coding!

Troubleshooting

API Key Not Working

  • Double-check that you copied the entire API key and pasted it into where sk-demokey is in Step 3.
  • Ensure your API key is still active in your CheapTokenRouter account
  • Try regenerating your API key if needed