コンテンツにスキップ

Authenticate a model provider

このコンテンツはまだ日本語訳がありません。

Model credentials belong in the provider-supported environment or subscription login, not in prompts, settings committed to a repository, or command arguments.

Which authentication method should I choose?

Section titled “Which authentication method should I choose?”

Use a provider application programming interface (API) key for service-style automation. Use a supported subscription login for an interactive user session. Run xcsh --list-models <PROVIDER> after authentication to confirm the credential can enumerate models.

Terminal window
xcsh --model p-openai/gpt-5.2 --no-tools -p "Summarize README.md"

Replace the example with a model shown by your installed build. Provider-qualified names avoid an accidental fuzzy match when several providers expose similar model names.

For Anthropic, either complete /login anthropic with a Claude subscription or export ANTHROPIC_API_KEY for direct API billing. --model fable and --model anthropic/fable are exact aliases for anthropic/claude-fable-5-1; use anthropic/claude-fable-5 when you specifically need the earlier Fable 5 model. Fable access depends on the selected account’s entitlement.

Start xcsh, enter /login, and choose only the provider you intend to use. Complete the provider-owned sign-in flow, return to the model picker, and select an explicit model. Authentication may store a refresh token or subscription session outside the repository; a prompt never needs the credential value. Send a no-tool prompt, inspect the selected provider and model, then use /logout when the account must not remain available on that workstation.