okx-cex-auth
okx cex auth
What it does
- API-key users: profile.site in ~/.okx/config.toml (written by okx config init).
- OAuth users: saved inside the okx-auth binary state the first time okx auth login --site <X> succeeds, and returned by okx auth status --json as the site field.
- config show --json has any profile with a non-empty site field, OR
- auth status --json returns a non-empty site field AND status is loggedin or pending.
- If the CLI returns {"status":"skipped","reason":"apikeyconfigured",...}, your Step 0.2 check was stale — re-read config show --json and stop. Do not retry.
- Otherwise the CLI prints a single line of JSON: {"verificationUri":"...","userCode":"XXXX-XXXX","expiresIn":600}.
- profile is an internal routing field with no user value.
Requirements & configuration
- Site is a separate dimension from auth method. Both API-key and OAuth paths require a site. Once selected, a site is persisted:
- If yes → STOP. Tell the user "已配置 API key (profile: <name>)" and proceed with their original request directly. DO NOT run okx auth login or okx config init.
- Step 0.2.a — Handling an invalid API key (401 / signature error)
- 1. Replace the API key — the user generates a new key on the OKX web console (https://<site>/account/my-api) and either provides AK/SK/PP to you or re-runs okx config init themselves.
- Prerequisite: Step 0 completed and the Pre-login Gate above passes. You have a site the user just chose in chat, and you confirmed no apikey profile exists.
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
okx-cex-auth FAQ
What does the okx-cex-auth skill do?
Use this skill when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up credentials', 'first time setup', 'configure okx', '登录', '授权', '认证', '连接账户', '首次配置'. Also when any OKX CLI command fails with an auth error: 'Run okx auth login first', 'Session expired', 'not authenticated', 'requires_auth', '401 Unauthorized', 'token expired/not found', 'StorageNotFoundError', '会话过期', '未认证', '需要登录'. Also when the user asks about login status or the login was interrupted. Also when the user wants to install/update/check/remove the okx-auth binary — 'install/update/remove auth', 'download okx-auth', '安装/更新/卸载认证', 'auth binary status', 'Failed to spawn okx-auth'. Also use before using okx-cex-trade/portfolio/earn/bot for the first time. Do NOT use for market data queries (use okx-cex-market). API-key users: profile.site in ~/.okx/config.toml (written by okx config init). OAuth users: saved inside the okx-auth binary state the first time okx auth login --site <X> succeeds, and returned by okx auth status --json as the site field.
What does okx-cex-auth require?
Site is a separate dimension from auth method. Both API-key and OAuth paths require a site. Once selected, a site is persisted: If yes → STOP. Tell the user "已配置 API key (profile: <name>)" and proceed with their original request directly. DO NOT run okx auth login or okx config init. Step 0.2.a — Handling an invalid API key (401 / signature error) 1. Replace the API key — the user generates a new key on the OKX web console (https://<site>/account/my-api) and either provides AK/SK/PP to you or re-runs okx config init themselves. Prerequisite: Step 0 completed and the Pre-login Gate above passes. You have a site the user just chose in chat, and you confirmed no apikey profile exists.
How do I install okx-cex-auth?
Run: npx -y skills add https://github.com/okx/agent-skills --skill okx-cex-auth --agent claude-code — the source lives at github.com/okx/agent-skills.
Maintain okx-cex-auth?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[okx-cex-auth on getagentictools](https://getagentictools.com/skills/okx-agent-skills-okx-cex-auth?ref=badge) npx agentictools info skills/okx-agent-skills-okx-cex-auth The second line is the CLI lookup for this page — handy in READMEs and docs.