Pexo
Pexo/Blog/AI Video News & Trends/How to Make Videos With Codex Using Grok 4.6 (2026 Guide)

How to Make Videos With Codex Using Grok 4.6 (2026 Guide)

Lan He avatarLan He
·Last updated Aug 13, 2026
Summarize with:ChatGPTChatGPTPerplexityPerplexityClaudeClaudeGeminiGeminiGrokGrok
How to Make Videos With Codex Using Grok 4.6 (2026 Guide)
Summary

Pexo ships an installable skill for OpenAI Codex that turns a plain-language request into a finished, edited video. You add it with npx skills add, and Codex, driven by Grok 4.6 (xAI's frontier long-running-agent model, released August 12, 2026, and OpenAI-compatible) as the backend, plans and dispatches the job while the Pexo skill generates each shot, auto-routing across Seedance 2.0, Kling AI, and more, layering voiceover, music, and Foley audio, and exporting 16:9, 9:16, or 1:1. Covers the ~/.codex/config.toml provider setup for grok-4.6 at api.x.ai, the Responses-API 404 caveat and OpenRouter or LiteLLM fallback, the exact install and prompt steps, and an 11-question FAQ.

Make AI videos just by chatting.

UPDATED: 2026-08-13

To make videos with Codex using Grok 4.6, install the Pexo skill into OpenAI Codex, point Codex at Grok 4.6 as its backend model, then describe the video you want in plain language. Codex plans and dispatches the job, and the Pexo skill generates and edits a finished clip. Grok 4.6 reasons, Codex orchestrates, and Pexo makes the video.

There is no "make video" button inside Codex, and Grok 4.6 does not render footage either. Keeping that split straight is the whole trick: Grok 4.6 is xAI's reasoning model, Codex is the coding agent that runs commands, and Pexo is the installable skill that adds video generation. Grok 4.6 shipped on August 12, 2026 as xAI's frontier model for long-running agents, it speaks the OpenAI API format, and that compatibility is exactly why it drops into Codex as a backend. This guide walks the five steps end to end, in about 15 minutes once your keys are in place.

How to make videos with Codex using Grok 4.6: the quick version

  1. Install OpenAI Codex — run codex once so it writes ~/.codex/config.toml.
  2. Point Codex at Grok 4.6 — add an xAI provider block with your XAI_API_KEY and model grok-4.6.
  3. Install the Pexo skill — run npx skills add https://github.com/pexoai/pexo-skills --skill pexo-agent.
  4. Describe the video — type a plain-language brief; Codex plans on Grok 4.6 and the Pexo skill renders.
  5. Iterate and export — request changes, pick 16:9, 9:16, or 1:1, and download the finished video.

The five steps in full

Step 1: Install and launch OpenAI Codex once

Install OpenAI Codex and run it a single time so it creates its config file. Install the CLI with npm install -g @openai/codex (or use the official installer for your platform), then run codex in a terminal once. That first launch writes ~/.codex/config.toml on macOS and Linux, or %USERPROFILE%\.codex\config.toml on Windows, which is the file you edit in the next step. Keep in mind that Codex is a coding agent that writes and runs commands, not a video engine, so this install gives you the orchestrator, not the generator.

Hand-drawn terminal window showing a codex prompt, labelled Install Codex

Step 2: Point Codex at Grok 4.6 as the backend model

Point Codex at Grok 4.6 by adding an xAI provider to ~/.codex/config.toml. Create an API key in the xAI console, then set it in your shell with export XAI_API_KEY=xai-... (setx XAI_API_KEY xai-... on Windows). Add this block to the config:

model = "grok-4.6"
model_provider = "xai"

[model_providers.xai]
name = "xAI"
base_url = "https://api.x.ai/v1"
env_key = "XAI_API_KEY"

Launch codex again and the startup banner should read model: grok-4.6. If Codex reports a /responses 404 instead, see the pitfalls below — xAI's endpoint is chat-style, so you route it through an OpenAI-compatible gateway.

Hand-drawn config.toml file with an arrow pointing to a Grok chip, labelled grok-4.6

Step 3: Install the Pexo skill into Codex

Install the Pexo skill into Codex so the agent can actually generate video. Run npx skills add https://github.com/pexoai/pexo-skills --skill pexo-agent, then add your Pexo credentials when the skill prompts for them. This is the layer that does the rendering: Codex and Grok 4.6 handle the reasoning and command execution, and the Pexo skill turns the plan into finished footage. Pexo is an installable skill you add to Codex, not a feature built into Codex or xAI, so this step is what unlocks video output in the first place.

Hand-drawn puzzle piece labelled Pexo skill snapping into a Codex box, labelled Install Pexo

Step 4: Describe the video you want in plain language

Describe the video you want to Codex in plain, conversational language. Type a brief such as: "Make a 20-second vertical promo for a cold-brew coffee brand, upbeat, with a voiceover and background music." Codex, reasoning on Grok 4.6, plans the job and dispatches it to the Pexo skill. Pexo auto-routes each shot across models like Seedance 2.0, Kling AI, and more, layers in voiceover, music, and Foley sound effects, and assembles a coherent cut. You do not write model prompts or open an editing timeline — you describe the outcome and Pexo builds it.

Hand-drawn chat bubble holding a plain-English video brief, labelled Describe it

Step 5: Iterate on the result, then export

Review the first cut, ask Codex for changes in the same conversation, then export. Tell it what to fix in plain language — "make it shorter", "swap the opening shot for the product close-up", "add captions" — and the Pexo skill re-renders the affected parts. When the cut is right, choose your aspect ratio (16:9 for YouTube, 9:16 for Shorts and TikTok, or 1:1 for feed posts) and download the finished video. Because the whole loop runs inside Codex, you iterate by conversation instead of re-editing in a separate app.

Hand-drawn video card with a download arrow and aspect-ratio chips, labelled Export

How to get more out of the Pexo skill in Codex

Once the workflow runs, the Pexo skill is where the quality lives, and it repays knowing what it can do beyond a single line. Pexo works from more than text: you can hand Codex an image, a URL, an audio file, a PDF, or a slide deck and ask for a video built from it, which helps when you already have source material and do not want to start from a blank brief. Under the hood it draws on capabilities like text-to-video and script-to-video, so a rough outline or a finished script both become valid starting points.

The multi-model routing is the point. Instead of committing to one generator, Pexo spreads shots across Seedance 2.0, Kling AI, and more, and chooses per shot, so you get breadth without picking models yourself and without switching apps. To see the entry point the skill mirrors, the social media video use case shows the same description box and preset chips you drive through Codex.

Screenshot of the Pexo Social Media Video Maker create page showing the headline and a Make a vertical video for TikTok preset chip

Because everything happens inside Codex, you never leave the agent to make the video: no separate account tab, no export-and-reimport shuffle. That single-surface loop — describe in Codex, get a finished video back — is what separates this from wiring a video API into your own script by hand.

Common pitfalls

  • Expecting Codex or Grok 4.6 to render the video themselves. They plan and reason; only the Pexo skill generates footage. If you skip Step 3, Codex has no video capability to call and the job stalls — install the Pexo skill and let it handle generation.
  • The banner still shows the default model. If codex does not print model: grok-4.6, you probably put the provider block in a project-level .codex/config.toml, where Codex ignores model_provider for safety. Move the block to ~/.codex/config.toml.
  • Codex returns a /responses 404. xAI's API is OpenAI-compatible on the chat-completions side, while Codex prefers the Responses API. Route Grok 4.6 through an OpenAI-compatible gateway — OpenRouter, an official Grok 4.6 partner, or a local LiteLLM proxy — and match the wire_api setting to whatever that gateway serves.
  • Reusing the reserved provider id. openai is a built-in id Codex will not let you override, so name your block something unique like xai.
  • Hard-coding the key. Do not paste your xAI key into config.toml; set env_key = "XAI_API_KEY" and keep the secret in your shell environment.

Start making videos with Codex using Grok 4.6

The setup is a one-time cost: install Codex, point it at Grok 4.6, add the Pexo skill, and from then on every video is a conversation. Grok 4.6 handles the planning, and Pexo turns the plan into a finished cut with no timeline to operate and no model prompt to engineer. Open the social media video workspace and describe your first video.

Type your thoughts here...

Pexo

Create AI videos with Pexo

Turn any idea into a publish-worthy video. One sentence is all it takes.

Frequently Asked Questions (FAQ)

How do I make videos with Codex using Grok 4.6?

Install the Pexo skill into OpenAI Codex (npx skills add https://github.com/pexoai/pexo-skills --skill pexo-agent), point Codex at grok-4.6 as its backend model in ~/.codex/config.toml, then describe the video in plain language. Codex, reasoning on Grok 4.6, plans the job and the Pexo skill generates a finished, edited clip — auto-routing shots across Seedance 2.0, Kling AI, and more, adding voiceover, music, and Foley sound, and exporting 16:9, 9:16, or 1:1.

Does Codex generate video on its own?

No. Codex is a coding agent that writes and runs commands; it does not render video. It makes video by driving the Pexo skill, which handles the actual generation and editing.

Does Grok 4.6 make videos?

No. Grok 4.6 is xAI's reasoning model, released August 12, 2026, and built for long-running agents. In this workflow it is the brain that plans the job inside Codex, while the Pexo skill is what produces the footage.

Is Grok 4.6 OpenAI-compatible?

Yes. Grok 4.6 works with the OpenAI API format: set the model to grok-4.6 and point the client at https://api.x.ai/v1 with your XAI_API_KEY. That compatibility is what lets it slot into Codex as a custom provider.

How do I get a Grok 4.6 API key?

Create a key in the xAI developer console, then set it in your shell as XAI_API_KEY. Codex reads it through the env_key field in your provider block, so you never paste the secret into a config file.

Why use Grok 4.6 instead of Codex's default model?

Grok 4.6 is tuned for long-running agent tasks and multi-step planning, which is the kind of work a video brief triggers, and it launched priced below comparable frontier models. Swapping it in changes only the reasoning layer; the Pexo skill still does the generation.

Which video models does the Pexo skill use?

Pexo auto-routes across multiple model families — Seedance 2.0, Kling AI, and more — and picks per shot instead of locking you to one generator. You describe the result and Pexo handles model selection.

Can I use Grok 4.6 in Claude Code or Cursor instead of Codex?

Yes. The Pexo skill installs into Claude Code and Cursor as well, and Grok 4.6 is available in Cursor natively and through the xAI API. The three-layer split is identical: the agent orchestrates, Grok 4.6 reasons, and Pexo generates.

What if Codex returns a /responses 404 with Grok 4.6?

xAI's endpoint serves the chat-completions format, while Codex prefers the Responses API. Route Grok 4.6 through an OpenAI-compatible gateway such as OpenRouter (an official Grok 4.6 partner) or a local LiteLLM proxy, and match the wire_api setting to what that gateway serves.

What kinds of video input can I give Codex through Pexo?

Through the Pexo skill you can start from text, an image, a URL, an audio file, a PDF, or a slide deck. Describe what you want built from the source and Pexo assembles the video.

Do I need to know how to edit video?

No. There is no timeline to operate: you describe the video and any changes in conversation, and the Pexo skill renders and re-renders. Editing skills are not required.

Lan He avatar
Lan He

Meet Lan, Senior Video Producer at Pexo, with over a decade of experience turning complex creative workflows into steps anyone can follow. A hands-on video editor and motion designer, he has taught thousands of creators how to ship video without the overwhelm, and he puts dozens of creative tools through real production work each year to see which ones actually hold up. At Pexo, he writes both step-by-step tutorials and best-of tool roundups, screen-recording each workflow himself and ranking tools on what they deliver in a real project rather than on their feature lists.

Pexo Recommend

The Best LTX-2.5 Alternatives in 2026

The Best LTX-2.5 Alternatives in 2026

The best LTX-2.5 alternative depends on whether you want to run a model yourself or just get a finished video. Top picks: Pexo, Kling 3.0, Veo 3.1, Wan 2.6, Runway.

Liora Adler avatarLiora AdlerAug 13, 2026