Grok BotSoftwareShipping codeAI score · 73/100AI-assisted edit · no obvious prompt-injection riskX

Connect Codex to Grok Bot: Have One AI Assistant Call Another to Write Code

Create a dedicated Bot in Grok Bot → enable ChatGPT device-code login → install Codex on cloud or call local instance → assign tasks or chain to GPT Image

Some experienceStepsTip
Who
Users who want Grok Bot to command OpenAI Codex for coding, web building, or image generation
You get
Trigger Codex via Grok Bot with natural language to generate code/webpages, or chain to GPT Image for graphics
You need
Grok Bot

Constraints

Source: X user @AndyCui0's summary of a video tutorial cross-checked with OpenAI docs; author verified codex-cli installs on cloud and codex login --device-auth exists. Requires: Grok Bot account, ChatGPT account (personal: enable device-code login beta; workspace: admin-enabled), optional local Codex CLI or cloud environment. Costs: Codex usage may incur OpenAI API/subscription fees; OpenCode is MIT-licensed and free but third-party models may cost extra.

What they did

Author @AndyCui0 summarized a Chinese tutorial video into a 5-step method for connecting OpenAI Codex to Grok Bot, cross-checking with official docs. The author personally tested that codex-cli installs on cloud (v0.164.0) and that codex login --device-auth exists.

How it went

Author reports: dedicated Bot isolates permissions; device-code login suits environments without browser callbacks; cloud install and device-auth option verified; local calls require confirmation each time; chaining Codex to GPT Image for graphics was shown in video but not separately verified by author.

Worth knowing

Source is a video tutorial summary, not site-tested. OpenCode is mentioned as a free alternative (MIT license), but specific free model names from the video are unverified. Device-code login is beta and toggle names may change. Codex usage may incur OpenAI fees. Multi-Bot team division (video/tools/monitoring) is presented as an idea without specific configuration.

Steps

  1. Create a dedicated Bot to isolate permissions and memory

    In Grok Bot, create a new Bot dedicated to calling Codex, e.g., name it "Codex Worker". Keep it separate from Bots handling email, calendar, or drafting so login state, permissions, and memory are isolated. This makes troubleshooting easier and prevents a Bot that can read email from accidentally gaining code-execution capabilities.

  2. Enable device-code login in ChatGPT web settings (beta)

    Log into ChatGPT web, go to Security settings, locate and enable the device-code login toggle. Workspace accounts require an admin to enable this in permissions. This feature is currently in beta; the exact toggle name depends on the page.

  3. Install and log in to Codex (cloud or local)

    Method 1 (cloud): In the Bot's cloud environment, install codex-cli and run codex login --device-auth. The terminal outputs a link and one-time device code; open the link in a browser and enter the code to complete login. Author verified codex-cli installs (v0.164.0) and the device-auth option exists. Method 2 (local): If Codex is already installed locally, have the Bot call your local instance; each invocation requires manual confirmation.

  4. Assign tasks to Codex via Grok Bot

    Send natural-language instructions to the dedicated Bot, e.g., "Use Codex to build me an expense-tracking webpage." The Bot calls Codex to generate code and returns results. You can also chain Codex to GPT Image for graphics, creating an AI-calling-AI pipeline. Once the Bot memorizes the invocation pattern, saying "Use Codex" alone can trigger it without repeating full instructions.

  5. Security confirmation and credential safekeeping

    Enter device codes only on OpenAI's official page; never send them to anyone in DMs or chat. Do not send keys or tokens in any chat, including to AI assistants. Codex login credentials may be stored in plaintext at ~/.codex/auth.json; protect them like passwords. For local invocations, review what the AI will do before confirming each execution.

Prompt you can copy

Reference prompt · Editorial suggestion。Confirm the destination, input variables and output format before use.

This block is the prompt. Ads are never placed here.

No prompt needed — just follow the steps.

Source

(中文)Codex 接进 Grok Bot 五步:专用 Bot、设备码登录、云电脑或本机、安全提醒 · AndyCui0 · X · 2026-10-26T23:00:00.000Z

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related