此页面仅提供英文版。

Connect an account

Terminalbash
1aile connect # menu
2aile connect codex # a specific subscription
3aile connect openrouter # an API-key provider — prompts, masked

The menu splits Subscriptions (sign in with the provider) from API keys (paste a key, billed to you), because they are different things to share and stop for different reasons.

The CLI links the providers most sharers use. The dashboard's Connect a provider lists every one the deployment supports (xKiro, Lyceum and GitHub Enterprise Copilot among them), and an agent can link any of them over MCP (list_linkable_providers, start_provider_link, create_publisher_providers_batch for keys).

Some providers forbid resale

Many providers' terms restrict reselling access or sharing a credential. Linking such an account is your decision, and the risk to the account is yours. Over MCP, the link tools return the provider's own clause where one is on file.

Connecting an API key

Terminalbash
1aile connect openrouter # prompts for the key, masked
2echo "$KEY" | aile connect groq --key - # from stdin — scripts
3aile connect groq --key sk-... # direct, but visible in `ps`

The prompt is masked because a key pasted in the clear lands in scrollback and screen shares. --key - reads stdin so the key never appears in the process list or in shell history.

Without a terminal and without --key, the client declines rather than hanging on a stdin nobody is writing to.

The relay checks the key with the provider before storing it. A key the provider refuses outright (a 401, or an answer saying the key is invalid) is not linked. A 403, a rate limit, a timeout or a provider error proves nothing about the key, so it links as before.

For OpenRouter, a management (provisioning) key and an expired key are refused at link and fail every later check: neither can serve a completion, although OpenRouter's key check answers for both. A regular key from openrouter.ai/keys links.

Usage is billed to you

An API key has no ceiling. Every token served against it is billed to your provider account. The client says so before you paste.

Connecting a subscription

Consumer OAuth plans (Claude Code, Codex, Antigravity) link through the provider's own sign-in. For some providers (Codex today) the exchange also produces an attestation: the provider signs a nonce, which proves the account is theirs. See Verification.

Gemini CLI sign-in is retired, because Google ended it for personal accounts. Link a Google login as Antigravity (aile connect antigravity). A Gemini API key links as gemini from the dashboard or over MCP, not from the CLI.

Muse Code signs in with a device code; a Meta Model API key links as meta instead.

GitHub Enterprise Copilot links with a device code too, and asks for your Enterprise URL first: a GitHub Enterprise Cloud tenant, https://<tenant>.ghe.com. GitHub Enterprise Server hosts are refused.

Several accounts of one provider

Personal and work subscriptions have separate quotas, so both can earn.

Terminalbash
1aile connect codex --label work # connect a second and name it
2aile connect codex --account work # a stable key across re-links
3aile connect codex --replace 2 # rotate the credential on account #2
FlagWhat it does
--label <name>A human name. Cosmetic: the server never routes on it.
--account <key>An explicit key distinguishing two accounts the provider reports nothing about. Without it, the second link overwrites the first.
--replace <n>Replace the credential on an existing row instead of adding one.

--replace matters mainly for OAuth accounts the provider does not identify. A re-pasted API key already rotates onto its own row automatically: linking the same key again updates that account (the CLI says Reconnected) rather than adding a duplicate. On Cloudflare Workers AI the account ID counts too, so the same token on a second account ID is a second account.

A re-link keeps the account's settings: its nodeless setting, unless you pass --nodeless or --no-nodeless, and a Health check set to Never.

Each server caps how many accounts you may link per provider. As you approach it, aile connect prints how many slots are left; when you hit it, it names the way out: aile disconnect, or --replace.

For API-key providers, you can opt in as you link:

Terminalbash
1aile connect groq --nodeless # serve while this machine is off
2aile connect groq --no-nodeless # explicitly keep it node-only

The CLI refuses the flag for a subscription; the web dashboard can set Route to Direct for one. See Nodeless.

Cloudflare Workers AI also needs your account ID, and serves only nodeless:

Terminalbash
1aile connect cloudflare-ai --account-id <id> --nodeless

Managing what you have linked

Terminalbash
1aile accounts # connected accounts, grouped by provider, numbered
2aile accounts --json

The numbers here are what every other command means by <n>. Each account also shows its route (this machine, another of your machines, Direct, or no route when no node is up and Direct is off) and how many of its models are listed, untested, failed or can't sell. The route says how a request would reach the provider, not that anything is on sale.

After linking

A model lists only after it passes a test. A node-backed account's models are tested in the background when you link it, unless its Health check is Never. A nodeless account is not tested at link, so the CLI points you at aile test <n>.

Is it still good?

Terminalbash
1aile check-key # re-probe everything
2aile check-key 3 # just account #3

The relay probes the credential and reports works, rejected or no answer (the relay learned nothing, so there is nothing to fix). This is the live half of an account's status; it cannot change the identity half.

A key the provider refused outright is served last: the relay tries every other sharer first.

A key refused on a real request stays benched

When a provider answers a real caller request, or your own model test, with a 401 that means the key is dead (revoked, invalid, or an OpenRouter "User not found."), the account is served last and leaves the model list. A passing key check cannot lift that, because it can pass for a key that cannot generate: it reports rejected with the reason refused-on-serve. Link a new key. A request the key then serves successfully, or a passing model test, also clears it.

Which models are listed?

Terminalbash
1aile models 3 # what account #3 lists, and why a model does not
2aile test 3 # test its untested models so they list

A model lists after it passes a test, and each one says where it stands: listed, untested, failed, can't sell or off. Testing spends a little of the account's own quota. A key check does not list anything. Can't sell is something a test cannot fix, and its reason names it: no published price, off in your rates, needs the Direct route, no route at all, no payout wallet, a refused key, a balance too low for the model, and so on.

A Codex test first reads which models your ChatGPT plan carries; a model the plan does not list fails as Not on this account's Codex model list without a request being spent on it.

Why an account stops being picked

  • Out of credits or at a spending limit. The account leaves the marketplace. Top up or raise the limit, then aile check-key.
  • A cut stream. On Claude and on Responses-API providers such as Codex, an account whose answer the provider drops mid-stream, before its end, is rested for ten minutes. A subscription at the edge of its quota often answers that way.
  • One model refused. A provider that says this account cannot serve a model (a Gemini key with no quota for it, a Codex plan that dropped it) takes that model off that account, for up to a day or until a test passes; the account and its other models keep selling.
  • Not for these: a GitHub Copilot account whose premium-request allowance is spent keeps serving its base models, and a Kiro account keeps selling while the overage you bought covers a used-up plan.

What is left to give

Terminalbash
1aile usage
2aile usage --json

The quota each provider reports, per account. A subscription shows how much of its monthly ceiling is gone; an API key has no ceiling to report.

Naming and removing

Terminalbash
1aile label 2 work-laptop
2aile disconnect 2
3aile disconnect 2 --yes

Disconnecting removes the account server-side. It does not touch anything at the provider; revoke there too if that is what you meant.

A local model is not an account

If the only thing you share is a self-hosted model, aile accounts will say "no accounts" and point you at aile capacity. That is correct: a local model is capacity, but there is no credential to hold. See Self-hosted models.