惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
腾讯CDC
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
F
Fortinet All Blogs
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园_首页
B
Blog RSS Feed
D
Docker
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs: clarify xai oauth setup (#84350) · openclaw/opencla...
davemorin · 2026-05-20 · via Recent Commits to openclaw:main

@@ -6,30 +6,74 @@ read_when:

66

title: "xAI"

77

---

889-

OpenClaw ships a bundled `xai` provider plugin for Grok models.

9+

OpenClaw ships a bundled `xai` provider plugin for Grok models. For most

10+

users, the recommended path is Grok OAuth with an eligible SuperGrok or X Premium

11+

subscription. OpenClaw stays local-first: the Gateway, config, routing, and

12+

tools run on your machine, while Grok model requests authenticate through xAI

13+

and are sent to xAI's API.

101411-

## Getting started

15+

OAuth does not require an xAI API key, and it does not require the Grok Build

16+

app. xAI may still show Grok Build on the consent screen because OpenClaw uses

17+

xAI's shared OAuth client.

18+19+

## Choose your setup path

20+21+

Use the path that matches your OpenClaw install state:

12221323

<Steps>

14-

<Step title="Choose auth">

15-

Use either an API key from the [xAI console](https://console.x.ai/),

16-

xAI OAuth browser sign-in with an eligible xAI account, or xAI device-code

17-

sign-in for remote/VPS hosts where a localhost browser callback is awkward.

18-

OAuth does not require an xAI API key, and OpenClaw does not require the

19-

Grok Build app. xAI may still label the consent app as Grok Build because

24+

<Step title="New OpenClaw install">

25+

Run onboarding with daemon install when you are setting up a new local

26+

Gateway, then choose the xAI/Grok OAuth option in the model/auth step:

27+28+

```bash

29+

openclaw onboard --install-daemon

30+

```

31+32+

On a VPS or over SSH, use device-code during onboarding:

33+34+

```bash

35+

openclaw onboard --install-daemon --auth-choice xai-device-code

36+

```

37+38+

OAuth does not require an xAI API key. OpenClaw does not require the Grok

39+

Build app. xAI may still label the consent app as Grok Build because

2040

OpenClaw uses xAI's shared OAuth client.

41+2142

</Step>

22-

<Step title="Sign in">

23-

Set `XAI_API_KEY`, run the API-key wizard, or start the OAuth flow:

43+

<Step title="Existing OpenClaw install">

44+

If OpenClaw is already configured, sign in to xAI only. Do not rerun full

45+

onboarding or reinstall the daemon just to connect Grok:

24462547

```bash

26-

openclaw onboard --auth-choice xai-api-key

27-

openclaw onboard --auth-choice xai-oauth

28-

openclaw onboard --auth-choice xai-device-code

2948

openclaw models auth login --provider xai --method oauth

49+

```

50+51+

Use the device-code flow instead when the Gateway runs over SSH, Docker, or

52+

a VPS and a localhost browser callback is awkward:

53+54+

```bash

3055

openclaw models auth login --provider xai --device-code

3156

```

325758+

To make Grok the default model after signing in, apply it separately:

59+60+

```bash

61+

openclaw models set xai/grok-4.3

62+

```

63+64+

Rerun full onboarding only if you intentionally want to change Gateway,

65+

daemon, channel, workspace, or other setup choices.

66+67+

</Step>

68+

<Step title="API-key path">

69+

API-key setup still works for xAI Console keys and for media surfaces that

70+

require key-backed provider config:

71+72+

```bash

73+

openclaw models auth login --provider xai --method api-key

74+

export XAI_API_KEY=xai-...

75+

```

76+3377

</Step>

3478

<Step title="Pick a model">

3579

```json5

@@ -42,9 +86,9 @@ OpenClaw ships a bundled `xai` provider plugin for Grok models.

42864387

<Note>

4488

OpenClaw uses the xAI Responses API as the bundled xAI transport. The same

45-

credential from `openclaw onboard --auth-choice xai-api-key` or

46-

`openclaw onboard --auth-choice xai-oauth` /

47-

`openclaw onboard --auth-choice xai-device-code` can also power first-class

89+

credential from `openclaw models auth login --provider xai --method oauth`,

90+

`openclaw models auth login --provider xai --device-code`, or

91+

`openclaw models auth login --provider xai --method api-key` can also power first-class

4892

`x_search`, remote `code_execution`, and xAI image/video generation.

4993

Speech and transcription currently require `XAI_API_KEY` or provider config.

5094

`XAI_API_KEY` or plugin web-search config can power Grok-backed `web_search` too.

@@ -55,6 +99,22 @@ and, by default, `x_search` through an operator xAI Responses proxy.

5599

`code_execution` tuning lives under `plugins.entries.xai.config.codeExecution`.

56100

</Note>

57101102+

## OAuth troubleshooting

103+104+

- If browser OAuth cannot reach `127.0.0.1:56121`, use

105+

`openclaw models auth login --provider xai --device-code`.

106+

- If sign-in succeeds but Grok is not the default model, run

107+

`openclaw models set xai/grok-4.3`.

108+

- To inspect saved xAI auth profiles, run:

109+110+

```bash

111+

openclaw models auth list --provider xai

112+

openclaw models status

113+

```

114+115+

- xAI decides which accounts can receive OAuth API tokens. If an account is not

116+

eligible, try the API-key path or check the subscription on xAI's side.

117+58118

<Tip>

59119

Use `xai-device-code` when signing in from SSH, Docker, or a VPS. OpenClaw

60120

prints an xAI URL and short code; finish sign-in in any local browser while the

@@ -427,11 +487,12 @@ Legacy aliases still normalize to the canonical bundled ids:

427487428488

<Accordion title="Known limits">

429489

- xAI auth can use an API key, environment variable, plugin config fallback,

430-

or xAI OAuth browser sign-in with an eligible xAI account. OAuth uses a

431-

local callback on `127.0.0.1:56121`; for remote hosts, forward that port

432-

before opening the sign-in URL. xAI decides which accounts can receive

433-

OAuth API tokens, and the consent page may show Grok Build even though

434-

OpenClaw does not require the Grok Build app.

490+

browser OAuth, or device-code OAuth with an eligible xAI account. Browser

491+

OAuth uses a local callback on `127.0.0.1:56121`; for remote hosts, use

492+

`xai-device-code` unless you want to forward that port before opening the

493+

sign-in URL. xAI decides which accounts can receive OAuth API tokens, and

494+

the consent page may show Grok Build even though OpenClaw does not require

495+

the Grok Build app.

435496

- `grok-4.20-multi-agent-experimental-beta-0304` is not supported on the

436497

normal xAI provider path because it requires a different upstream API

437498

surface than the standard OpenClaw xAI transport.