Fylun Code
A coding agent that runs in your terminal, powered by your Fylun subscription. Every frontier model, one browser login, one wallet — no API keys to buy, no per-provider accounts to juggle.
Install
One small binary — no runtime to install. Pick your platform.
curl -fsSL fylun.ai/code/install | bashpowershell -NoProfile -Command "irm fylun.ai/code/install.ps1 | iex"brew install usefylun/tap/fylun-codescoop bucket add fylun https://github.com/usefylun/scoop-bucket
scoop install fylun-codeSign in
Launch the agent and sign in once through your browser — there are no API keys to copy around for the CLI itself. Your tokens stay on your machine.
fylun-codeThis opens the TUI and, on first run, a browser login at fylun.ai. To manage or re-authenticate providers later, use:
fylun-code authConfigure
Global config lives at ~/.config/fylun-code/fyluncode.jsonc. It is seeded once on install and holds your defaults and the Fylun provider endpoint — the model catalog itself is baked into the binary, so upgrades keep it current.
{
"$schema": "https://opencode.ai/config.json",
"theme": "palenight",
// The model the agent uses by default.
"model": "fylun/deepseek-v4-flash",
// Cheaper model for side-tasks (titles, summaries).
"small_model": "fylun/gemini-3.1-flash-lite"
}Set model to any id from the catalog (in provider/model form, e.g. fylun/claude-sonnet-5).
Commands
- fylun-code — launch the full terminal UI in the current project.
- fylun-code -m provider/model — start with a specific model.
- fylun-code --continue — resume your last session.
- fylun-code run "…" — one-shot: run a single prompt non-interactively, for scripts and CI.
- fylun-code models — list every model available to your account.
- fylun-code mcp — manage Model Context Protocol servers.
- fylun-code upgrade — update to the latest version.
# switch model and resume the last session
fylun-code -m fylun/claude-sonnet-5 --continue
# one-shot task from a script
fylun-code run "write a changelog entry for the last commit"Models & pricing
Every model in your Fylun subscription is available in the CLI, and you can switch mid-session. Usage is billed to the same wallet at Fylun's flat markup — the same price you see on the models page. There is nothing separate to pay for and no per-provider key to manage.
Set a cheap small_modelin your config so background work (session titles, compaction summaries) doesn't run on a frontier model at frontier prices.
API access
Fylun exposes an OpenAI-compatible API, so the same wallet powers your own scripts, agents, and any tool that speaks the OpenAI format (Fylun Code, opencode, Crush, Cursor, the OpenAI SDKs).
- Base URL —
https://fylun.ai/api/v1 - Auth —
Authorization: Bearer fyl_…
curl https://fylun.ai/api/v1/models \
-H "Authorization: Bearer $FYLUN_API_KEY"curl https://fylun.ai/api/v1/chat/completions \
-H "Authorization: Bearer $FYLUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"messages": [{ "role": "user", "content": "Hello from Fylun" }]
}'import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FYLUN_API_KEY,
baseURL: "https://fylun.ai/api/v1",
});
const res = await client.chat.completions.create({
model: "gpt-5.6-terra",
messages: [{ role: "user", content: "Hello from Fylun" }],
});
console.log(res.choices[0].message.content);from openai import OpenAI
client = OpenAI(
api_key=os.environ["FYLUN_API_KEY"],
base_url="https://fylun.ai/api/v1",
)
res = client.chat.completions.create(
model="gemini-3.6-flash",
messages=[{"role": "user", "content": "Hello from Fylun"}],
)
print(res.choices[0].message.content)Requests are billed to your wallet at the same markup as the app. Streaming is supported with "stream": true.
Upgrade & troubleshooting
fylun-code upgradeFully quit any running fylun-code session and relaunch. The agent runs a background server that loads its config and catalog once at startup, so a running instance keeps its old list until you restart it. Run fylun-code models in a fresh shell to confirm the current catalog.
Use fylun-code debug for troubleshooting tools, or delete ~/.config/fylun-code/fyluncode.jsonc to re-seed a fresh default config on the next launch.