Answer: Use the --method key flag to select API-key entry explicitly, for example: opencode auth login anthropic --method key. Method IDs are provider-specific, so run the command without --method to see the available methods when a provider has more than one. Status: Confirmed Entry: tool/opencode/account-and-plans/select-api-key-method Revision: 2 Digest: sha256:3d596bb4002eb5ba (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:21Z Last changed: 2026-11-18T13:38:47Z (Terminal requirement: — → API-key entry and provider forms require an interactive terminal.) Last verified: 2026-11-20T13:45:15Z Next check: 2026-11-21T13:45:15Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of API-key method flag | --method key | [1] | 2026-11-20 Example command | opencode auth login anthropic --method key | [1] | 2026-11-20 Method IDs note | Method IDs are provider-specific. | [1] | 2026-11-20 Listing methods | Run the command without --method to see the available methods when a provider has more than one. | [1] | 2026-11-20 Terminal requirement | API-key entry and provider forms require an interactive terminal. | [1] | 2026-11-20 Sources: [1] opencode. "CLI providers | OpenCode". https://opencode.ai/docs/cli/providers/ Role: primary. Accessed: 2026-11-20T13:45:15Z Quote: "Use --method key to select API-key entry explicitly." (Supports: API-key method flag) Quote: "opencode auth login anthropic --method key" (Supports: Example command) Quote: "Method IDs are provider-specific." (Supports: Method IDs note) Quote: "Run the command without --method to see the available methods when a provider has more than one." (Supports: Listing methods) Quote: "API-key entry and provider forms require an interactive terminal." (Supports: Terminal requirement) Snapshot SHA-256: 2f51e91fe95057d92c9d63b1a7ccb930aa9ac87ae3f8ed633a97ab71ab72e47f (captured 2026-11-18T13:38:46Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:47Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:15Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:15Z Last attempt: 2026-11-20T13:45:15Z Notes and limitations: Extracted automatically from a single official source (section "CLI"). Related: https://latestn.com/tool/opencode/account-and-plans/supported-payment-methods What payment methods does opencode Console billing support? https://latestn.com/tool/opencode/account-and-plans/use-go-provider How do I use the OpenCode Go provider in Pi? https://latestn.com/tool/opencode/admin-and-enterprise/budget-levels What budget levels does opencode support for members and service accounts? https://latestn.com/tool/opencode/account-and-plans/create-workspace How do I create a new workspace in OpenCode Console? https://latestn.com/tool/opencode/account-and-plans/manage-provider-accounts How do I manage multiple saved provider accounts in opencode? https://latestn.com/tool/opencode/account-and-plans/personal-vs-service-account-keys What is the difference between an opencode personal API key and a service account key? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:38:47Z | changed | Terminal requirement: — → API-key entry and provider forms require an interactive terminal. | [1] 2026-11-18T13:38:47Z | changed | Listing methods: — → Run the command without --method to see the available methods when a provider has more than one. | [1] 2026-11-18T13:38:47Z | changed | Method IDs note: — → Method IDs are provider-specific. | [1] 2026-11-18T13:38:47Z | changed | Example command: — → opencode auth login anthropic --method key | [1] 2026-11-18T13:38:47Z | changed | API-key method flag: — → --method key | [1] 2026-11-18T13:38:47Z | changed | requirement: API-key entry and provider forms require an interactive terminal → — | [1] 2026-11-18T13:38:47Z | changed | example command: opencode auth login anthropic --method key → — | [1] 2026-11-18T13:38:47Z | changed | flag: --method key → — | [1] 2026-11-13T03:56:21Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/account-and-plans/select-api-key-method/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/account-and-plans/select-api-key-method POST: https://latestn.com/dispute/tool/opencode/account-and-plans/select-api-key-method with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/account-and-plans/select-api-key-method?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I select an API-key authentication method when logging in to a provider in opencode? Revision 2, last verified 2026-11-20T13:45:15Z. https://latestn.com/tool/opencode/account-and-plans/select-api-key-method (accessed 2026-11-21T09:54:01Z). @misc{LatestN_tool_opencode_account_and_plans_select_api_key_method_r2, title = {How do I select an API-key authentication method when logging in to a provider in opencode?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/account-and-plans/select-api-key-method}}, note = {Revision 2; digest sha256:3d596bb4002eb5ba; last verified 2026-11-20T13:45:15Z; accessed 2026-11-21T09:54:01Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/account-and-plans/select-api-key-method