All guides / Coding assistants
Use XHuoAPI in fx (Vercel Labs)
fx is an open-source coding agent CLI from Vercel Labs: one native binary that can connect to any OpenAI Chat Completions–compatible endpoint. XHuoAPI provides that endpoint, so one connection in the settings file is enough. We had fx 0.0.13 create and run a file for real, and the config below is the one we tested.
Before you start
- Sign up in the console and create an API token. Registration needs an email address only, no phone number.
- You pick a tier when creating the token; new accounts default to Standard. The tier sets price and stability and also which models are available — see the pricing page.
Verify first
Before touching the tool, confirm the key and model work with curl. This rules out half of the 'I configured it and nothing happens' cases.
curl https://api.xhuoapi.ai/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v3.2","messages":[{"role":"user","content":"ping"}]}'
Steps
Install fx (macOS 15 or later, or Linux; macOS builds need 15+ since 0.0.14). The installer puts it in ~/.local/bin.
curl -fsSL https://fx.sh/setup.sh | bash
Edit ~/.fx/settings.json (create it if it doesn't exist) and add the connection below. End base_url at /v1; fx appends /chat/completions itself. Use model IDs exactly as written on the pricing page.
{
"provider": "xhuoapi",
"providers": {
"xhuoapi": {
"protocol": "openai-chat-completions",
"base_url": "https://api.xhuoapi.ai/v1",
"auth": { "type": "bearer", "env": "XHUOAPI_API_KEY" },
"model_metadata": {
"glm-5.3": { "supports_tool_use": true },
"kimi-k3": { "supports_tool_use": true },
"deepseek-v4-flash": { "supports_tool_use": true }
}
}
},
"models": { "xhuoapi": "glm-5.3" }
}
Put your API key in the environment variable named by auth.env, then run fx status --json and check that provider_endpoint and model are right.
export XHUOAPI_API_KEY=YOUR_XHUOAPI_KEY fx status --json
Run fx in your project directory for interactive mode, or fx ask for a one-off task. Use the FX_MODEL environment variable to switch models for one run.
fx ask "Create hello.py that prints hello, then run it" FX_MODEL=kimi-k3 fx ask "Explain what this repository does"
Notes
Commonly used models
These are common choices for this kind of tool; click a model to see its price in each tier. The full list is on the pricing page.
Steps follow the tool's current official documentation; the UI may change after updates. Tell us if something no longer matches.