CLI Integration
BeatAPI CLI (the beatapi command) is the official terminal tool for BeatAPI. After you install and sign in to beatapi, you or any terminal AI client (Claude Code, Codex, Gemini CLI, Antigravity, OpenCode) can search, check prices, and run BeatAPI capabilities directly from the command line.
BeatAPI CLI fits three common situations:
- You prefer letting a terminal AI client run
beatapishell commands instead of editing MCP config files. - You need to upload a local image, video, or audio file to get a public HTTPS URL before calling a BeatAPI media model (
beatapi files upload). - You want to call BeatAPI from shell scripts, scheduled jobs, or CI pipelines.
CLI login is separate from MCP: Running
beatapi auth loginsaves credentials for BeatAPI CLI only. CLI login does not configure BeatAPI MCP or export environment variables for other apps.
Prerequisites
- Node.js 18 or newer installed on your machine. Run
node -vin the terminal (v18,v20, orv22all work). - A BeatAPI API key created in BeatAPI Dashboard → API Keys (usually starting with
sk-).
Step 1: Install BeatAPI CLI
Run this command in your terminal to install beatapi globally:
Confirm the installation and verify your version is 0.3.0 or newer:
Step 2: Sign in (OS credential manager)
Run the login command:
- The terminal prompts for your BeatAPI API key. Characters do not appear on screen while you type or paste; this is standard terminal password hiding.
- Paste your BeatAPI API key and press Enter. BeatAPI CLI stores the key in your operating system’s credential manager (macOS Keychain, Windows Credential Manager, or Linux Secret Service) without creating a plaintext key file in your project.
- Run this free check to confirm authentication:
Seeing an authenticated status confirms BeatAPI CLI is ready.
Step 3: Everyday commands
1. Search capabilities (free)
Search using platform and action keywords in English or Chinese:
Copy the exact capability ID returned by the command (for example, data:xiaohongshu.app_v2.search_notes). Do not guess or hand-write capability IDs.
2. Check inputs and price (free)
Pass the copied capability ID to inspect to check required inputs and single-call pricing:
3. Run a capability and check progress (paid per call)
Use beatapi capabilities run to execute the inspected capability, and use beatapi capabilities status to check progress on image, video, or deep research jobs. View the exact flags supported by your installed CLI version with:
4. Upload a local image, video, or audio file
BeatAPI image, video, and audio models require public HTTPS URLs rather than local file paths. Upload a local file first:
beatapi files upload uses your saved CLI login to upload ./sample-product.png and prints a public HTTPS URL. Pass that URL into your next model or workflow call.
Step 4: Let terminal AI clients call BeatAPI CLI
Claude Code, Codex, Gemini CLI, Antigravity, and OpenCode can run beatapi directly through their shell tool without MCP configured:
- Complete Step 1 (
npm install --global beatapi) and Step 2 (beatapi auth login) on your computer. - Install the BeatAPI Agent Skill so your AI client always checks prices before running paid commands.
- Send a direct instruction in chat:
Use the installed
beatapiCLI to search for Xiaohongshu note search, runbeatapi capabilities inspecton the top result, and show me the required inputs and price. Wait for my confirmation before runningbeatapi capabilities run.
Because your BeatAPI API key is stored in the OS keychain, your AI client executes beatapi commands without seeing or printing your raw API key in chat.
Troubleshooting
- Terminal prints
command not found: beatapi: Your npm global bin folder is not inPATH. Runnpm prefix -g, add<prefix>/bin(macOS/Linux) or<prefix>(Windows) toPATH, and open a new terminal window. capabilitiessubcommand is missing: Your installed version is older than0.3.0. Runnpm install --global beatapi@latestto upgrade.- 401 error (missing or invalid key): Run
beatapi auth statusto check your saved login. If your old key was disabled in the dashboard, create a new key in BeatAPI Dashboard → API Keys and runbeatapi auth loginagain. - 400 error on
capabilities run: A required input field is missing or misspelled. Runbeatapi capabilities inspect <capability-id>to verify the required fields. - MCP still does not connect after
beatapi auth login: CLI login and MCP configuration are independent. Follow MCP Integration to configurehttps://beatapi.io/mcp.
Related pages
- MCP Integration — connect BeatAPI’s hosted remote MCP server (
https://beatapi.io/mcp) to Claude Code, Codex, Cursor, Gemini CLI, Antigravity, OpenCode, and VS Code. - Agent Skill Integration — install BeatAPI Skill for Muse, Grok Bot, Manus, OpenClaw, and local coding clients.
- Official BeatAPI CLI repository — full command reference, releases, and source code.
- Capabilities API Reference — underlying HTTP endpoint documentation.

