Skip to content

Connecting Factory Droid CLI

Difficulty ⌨️ Intermediate | API format OpenAI-compatible | base_url https://byesu.com/v1

Setup · fill these in
API addresshttps://byesu.com/v1
API keysk-xxxxxxxxCreate in console →
Modelgpt-5.5
API format OpenAI-compatible · model names follow the console

Factory Droid CLI (droid) is a terminal-based AI coding agent from Factory AI. Right from the command line it can read your code, fix bugs, refactor, and write new features. It supports custom model endpoints, so you can point its reasoning backend at byesu — an AI API gateway with OpenAI-compatible and Anthropic-native endpoints — and use one key for Claude, GPT-5.6, Grok and Gemini, pay-as-you-go with no subscription.

Before you start

First go to Console → Tokens and create an API token (something like sk-xxxx), then pick the right group for the token — the group determines which models you can call and which route they go through. See Choosing a Group for details.

Step 1: Install the Droid CLI

powershell
irm https://app.factory.ai/cli/windows | iex
bash
curl -fsSL https://app.factory.ai/cli | sh

After installation, update your PATH as prompted. You'll also need to sign in once with a free official Factory account (this is only for authenticating the client itself and does not affect models being routed through byesu).

Windows note

If you run into a permissions or execution-policy error: run PowerShell as Administrator and execute Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.

Step 2: Configure the connection to byesu

There are two ways to do this; we recommend the one-click script.

Option 1 (fastest): one-click script

After running it, just fill in the base_url and API Key when prompted — the script writes the config file for you automatically:

powershell
iex (irm 'https://raw.githubusercontent.com/QuantumNous/new-api-docs/refs/heads/main/helper/factory-cli-setup.ps1')
bash
curl -fsSL https://raw.githubusercontent.com/QuantumNous/new-api-docs/refs/heads/main/helper/factory-cli-setup.sh | bash
  • For base_url, enter: https://byesu.com/v1
  • For API Key, enter: the token sk-xxxx you created in the byesu console

Option 2 (manual): edit the config file

Edit ~/.factory/config.json (on Windows, %USERPROFILE%\.factory\config.json) and add byesu model entries to the custom_models array:

json
{
  "custom_models": [
    {
      "model_display_name": "GPT-5.5 [byesu]",
      "model": "gpt-5.5",
      "base_url": "https://byesu.com/v1",
      "api_key": "sk-xxxx",
      "provider": "openai",
      "max_tokens": 128000
    },
    {
      "model_display_name": "Claude Opus 4.8 [byesu]",
      "model": "claude-opus-4-8",
      "base_url": "https://byesu.com/v1",
      "api_key": "sk-xxxx",
      "provider": "openai",
      "max_tokens": 128000
    },
    {
      "model_display_name": "Gemini 3.1 Pro [byesu]",
      "model": "gemini-3.1-pro-high",
      "base_url": "https://byesu.com/v1",
      "api_key": "sk-xxxx",
      "provider": "openai",
      "max_tokens": 128000
    }
  ]
}

Field reference:

  • model: the actual model name on byesu (such as gpt-5.5, claude-opus-4-8, gemini-3.1-pro-high). Be sure the group your token belongs to supports that model.
  • base_url: always https://byesu.com/v1 (OpenAI-compatible format, with /v1).
  • api_key: your token sk-xxxx.
  • provider: always set to openai.
  • model_display_name: the name shown in the CLI's selection menu; choose whatever you like.

Using the native Anthropic format

The setup above uses the OpenAI-compatible endpoint (the simplest option). If you want a particular entry to use the native Anthropic protocol, change that entry's provider to anthropic and change its base_url to https://byesu.com without the /v1. Generally, keeping openai + https://byesu.com/v1 is all you need.

Step 3: Run it and verify

Start it from your project directory:

bash
cd /path/to/your/project
droid

Once you're in the interactive interface, use /model (or the model selection menu shown at startup) to switch to the … [byesu] model you just configured, and ask it something simple — like reading a file or explaining a snippet of code. If it responds normally, the connection is working.

Stuck?

  • 401 / Unauthorized: the api_key is wrong or missing the sk- prefix; confirm the token isn't disabled. See Common Errors #auth for details.
  • No available channel / no channel: the token's current group doesn't support the model you entered. Switch to another model within that group, or choose a different group. See Common Errors #no-channel for details.
  • Insufficient quota / 402: your account balance is too low; top up first. See Common Errors #balance for details.
  • Connection failed / 404: the base_url is wrong — for the OpenAI-compatible format it must be https://byesu.com/v1 (with /v1).

For more troubleshooting, see Common Errors and Choosing a Group.

Got a problem? Contact support or join our group.