okx-cex-auth

Authenticate OKX CLI sessions via OAuth 2.0 device flow or API keys.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill okx-cex-auth-wandreandrade2018-maker
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okx-cex-auth
Source: https://github.com/wandreandrade2018-maker/claude-config/tree/main/.agents/skills/okx-cex-auth
Command: npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill okx-cex-auth-wandreandrade2018-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @okx_ai/okx-trade-cli.

What problem does it solve? It handles OKX CLI authentication end to end: first-time login, re-authentication after session expiry, site (region) selection, API-key vs OAuth conflict resolution, and okx-auth binary installation issues. ## Core Features & Use Cases - OAuth 2.0 Device Flow Login: Runs okx auth login --manual to obtain a verification URL and user code without blocking, then confirms status after the user authorizes in the browser. - Pre-flight Auth Checks: Inspects okx config show --json and okx auth status --json to detect existing API keys, pending logins, and missing site selection before any login attempt. - Binary Management: Installs, updates, checks, and removes the okx-auth binary, including recovery from "Failed to spawn okx-auth" errors. - Use Case: A user runs an OKX portfolio command and gets "Session expired". The skill re-runs the device-flow login for the correct regional site (Global, EEA, or US) and restores the session. ## Quick Start Log me in to my OKX account on the Global site using the okx CLI.

Frequently Asked Questions about okx-cex-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I log in to OKX from the command line?▼

Run okx auth login --manual --site <global|eea|us> to get a verification URL and user code without blocking. Open the URL in a browser, enter the code, then confirm with okx auth status --json once it shows logged_in.

How do I fix OKX CLI session expired errors?▼

Re-run the OAuth device flow with okx auth login --manual and your site flag. Token refresh is automatic, so re-authentication is only needed when the refresh token itself expires after extended inactivity.

Does OKX CLI support both API keys and OAuth login?▼

Yes, but the REST client always prefers an API key over OAuth and never falls back. If a profile has an api_key configured, okx auth login skips OAuth, so you must remove the API-key profile before switching to OAuth.

Why does okx auth login fail with Failed to spawn okx-auth?▼

The okx-auth binary is missing or corrupted. Run okx auth install to download it, verify with okx auth install-status, then retry the original auth command.

Which OKX site should I choose for my region?▼

Choose global for www.okx.com, eea for my.okx.com (European Economic Area), or us for app.okx.com. The site is persisted after a successful login and affects instrument availability due to regional restrictions.