OAuth
Fased stores model credentials as auth profiles. An auth profile can be:oauth: refreshable provider sign-in credentialstoken: static bearer token, including Anthropicsetup-tokenapi_key: provider API key or SecretRef-backed API key
Why the auth profile store exists
OAuth providers commonly mint a new refresh token during login or refresh. Some providers can invalidate older refresh tokens for the same user/app. Practical symptom: you sign in with Fased and another CLI, then one of them later looks logged out. Fased keeps provider credentials inauth-profiles.json so the runtime has one
source of truth:
- runtime reads credentials from one local store
- multiple accounts can coexist as separate profile IDs
- profile order can be managed per Agent
Storage (where tokens live)
Secrets are stored per-agent:- Auth profiles:
~/.fased/agents/<agentId>/agent/auth-profiles.json - Legacy compatibility file:
~/.fased/agents/<agentId>/agent/auth.json(staticapi_keyentries are scrubbed when discovered)
auth-profiles.json contains credential material or SecretRefs. The matching
fased.json fields auth.profiles and auth.order are metadata and routing
only.
Legacy import-only file (still supported, but not the main store):
~/.fased/credentials/oauth.json(imported intoauth-profiles.jsonon first use)
$FASED_STATE_DIR when a state-dir override is set.
Full reference: /gateway/configuration
For static secret refs and runtime snapshot activation behavior, see Secrets Management.
Login flows
OAuth sign-in
fased models auth login runs the selected provider’s auth flow:
- Fased opens the provider sign-in URL in the browser.
- The provider returns an authorization code or localhost callback.
- Fased exchanges that code for credentials.
- Fased writes a refreshable
oauthprofile.
- Fased prints a provider URL.
- Open it in your local browser.
- Paste the redirect URL or authorization code back into the terminal.
- Fased writes the same local
oauthprofile on the host.
openai-codex. The route name is
legacy/internal compatibility naming; the user-facing provider is OpenAI.
Anthropic setup-token
Anthropic setup-token is stored as atoken profile, not an OAuth profile. Run
claude setup-token on any machine, then paste it into Fased:
setup-token writes anthropic:manual by default from the direct CLI command.
The onboarding wizard can ask for a token name and create a named
anthropic:<name> profile.
Verify:
Profile IDs
OAuth login profile IDs are normally based on provider and email:openai-codex:[email protected]anthropic:[email protected]
provider:default. API-key defaults usually use provider:default; manually
pasted tokens usually use provider:manual unless you choose another profile
ID.
Refresh + expiry
OAuth and some token profiles store anexpires timestamp.
At runtime:
- if an OAuth profile is still valid, use the stored access token
- if OAuth is expired, refresh under a file lock and overwrite the profile
- if a static token is expired, skip it; Fased does not refresh static tokens
Multiple accounts (profiles) + routing
Two useful patterns:1) Preferred: separate agents
If you want personal and work credentials to never interact, use isolated agents with separate sessions, credentials, and workspaces:2) Advanced: multiple profiles in one agent
auth-profiles.json supports multiple profile IDs for the same provider. Fased
orders usable profiles like this:
- explicit per-agent order from
auth-profiles.json - configured order from
fased.json - discovered profiles, sorted OAuth -> token -> API key, round-robin by last use
- per Agent with
fased models auth order set - per-session via
/model ...@<profileId>
fased models status --json- Agent > Models in the Control UI
Operational notes
- Re-authenticate when
models status --checkreports expired or missing auth. - Keep
auth-profiles.jsonlocal to the Agent host; do not paste it into issues or public logs. - On multi-Agent setups, OAuth credentials can be synced to sibling Agent stores during onboarding/sign-in, but each Agent still has its own auth profile store.
- For provider rotation, cooldown, and fallback behavior, see /concepts/model-failover.
- /concepts/model-failover (rotation + cooldown rules)
- /concepts/model-providers (provider setup)
- /tools/slash-commands (command surface)