okx-cex-auth

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

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-auth-nickthelegend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: okx-cex-auth
Source: https://github.com/nickthelegend/xorr-monorepo/tree/main/.agents/skills/okx-cex-auth
Command: npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-auth-nickthelegend

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? It handles OKX account authentication for the OKX CLI, covering first-time login, session expiry recovery, site selection, and logout so that trading, portfolio, and earn commands can run with valid credentials. ## Core Features & Use Cases - OAuth 2.0 Device Flow Login: Runs non-blocking okx auth login --manual with a verification URL and user code, supporting Global, EEA, US, and TR sites. - Pre-flight Auth Checks: Inspects okx config show and okx auth status to detect existing API keys, pending logins, or expired sessions before attempting any login. - Binary Management: Installs, updates, checks, and removes the okx-auth binary, with troubleshooting for spawn and CDN download failures. - Use Case: A user asks an AI agent to check their OKX balance, the command fails with "Session expired", and the agent walks them through re-authentication by presenting a verification link and code, then confirms the login status. ## Quick Start Ask the assistant to log you into your OKX account and follow the verification link and code it provides.

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|tr> to get a verification URL and user code, then authorize in your browser. Verify completion with okx auth status --json, which should return status logged_in.

How do I fix OKX CLI session expired errors?

Re-authenticate by running okx auth login --manual with your site and completing the browser authorization again. Token refresh is automatic, so re-login is only needed when the refresh token itself expires after extended inactivity.

Can I use an API key instead of OAuth with OKX CLI?

Yes, run okx config init to configure an API key with site, demo/live mode, and AK/SK/Passphrase credentials. The CLI always prefers an API key over OAuth, so OAuth login is skipped while any API key profile exists.

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

This error means 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 command.

Which OKX regional sites does the CLI support?

The CLI supports four sites: Global (www.okx.com), EEA (my.okx.com), US (app.okx.com), and TR (tr.okx.com). The site must be chosen explicitly during login and is persisted after the first successful authentication.