Before you start
- Create a key on the API Keys page and add funds to your API balance.
- Choose a text model with Function calling and streaming on the Models page. Copy its exact model ID.
- Use the connection values below. Replace key placeholders locally; keep secrets out of project files and source control.
Replace
your-model-id throughout the examples with the exact ID of a text model that supports function calling and streaming. Check the Models page for current availability and limits.Install and configure
1. Install Command Code
Install Node.js 22 or newer, then run:command-code command works on Windows, macOS and Linux. Its Windows shortcut is cmdc; cmd on Windows opens the system shell.
2. Set your API key
Run this in the terminal you will use to launch the app. Replace the placeholder with your key.- macOS / Linux / WSL
- Windows PowerShell
3. Add the connection
Create~/.commandcode/providers.json in your home directory. On Windows, use %USERPROFILE%\.commandcode\providers.json. Merge this entry if the file already exists.
openai-completions selects Chat Completions. Keep the base URL as shown; do not append /chat/completions.
BYOK support is currently in beta. The key stays in the environment;
apiKey must contain the variable reference, not a pasted key.Launch and test
Open your project and launch with--local-only to use the configured connection without a Command Code account.
- Enter
/modeland selectyour-model-idunder NoMask. - Ask:
Reply with exactly NOMASK_OK. Do not edit files. - Then ask it to create
nomask-test.txtcontainingNOMASK_OK. Review the proposed file action to check that tool calls work.
If the model is missing, reopen
/model after saving the JSON. Check for a configuration warning and confirm NOMASK_API_KEY is set in the same terminal.Troubleshooting
- 401: check that your key is active and available to the process running the tool. Restart the tool after changing environment variables.
- 402: add funds to your API balance or reduce the requested output.
- 404: check the exact model ID and base URL. Direct connections use Chat Completions, not Responses or Anthropic Messages.
- 429: wait for
Retry-After. API keys share account limits; creating another key does not reset usage. Check the key’s monthly spending cap too. - Context or tool errors: start a shorter task, lower the output limit and confirm the model supports function calling. A plain text reply alone does not confirm file-editing tools work.