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
- Navigate to your CheapTokenRouter dashboard
- Goto the API Keys module [https://cheaptokenrouter.com/dashboard/keys]
- Click Create Key and give it a nickname / alias memorable to you
- Copy down this API key and store it securely until you need to use it
Step 2: Download A Copy Of crush.json
- Download a copy of the latest crush.json with all our models pre-filled in here [https://cheaptokenrouter.com/crush.json]
- 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
- 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.
- 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
- Refresh your terminal by closing it and then re-opening it again.
- Enter crush in your project folder and press ctrl + P to enter the commands menu, then go down to Switch Model.
- Search for the model you want in CheapTokenRouter and press enter.
- 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