[KongchangAI]
· 3 min read· 1,686 words

The Most Detailed Codex Tutorial on Bilibili: 5 Hours from Installation to 80% Cost Reduction

The Most Detailed Codex Tutorial on Bilibili: 5 Hours from Installation to 80% Cost Reduction

Bilibili 5-hour Codex tutorial: connect DeepSeek via CCSwitch, plus the three-piece Fenjue and two Skills to cut token consumption by 60%-80%.

Based on Bilibili creator Wei Fanshi's detailed Codex tutorial, this article outlines how domestic users can bypass network and account barriers to quickly get started with AI Agents. The core solution uses CCSwitch to connect the DeepSeek API to Codex, avoiding ChatGPT account registration and verification. At the configuration level, it proposes the "three-piece Fenjue": switching the follow-up method from queue to guide to reduce ineffective execution, enabling memory to lower repeated communication costs, and configuring Agent.md as the AI employee handbook (recommending Karpathy's open-source template). It also introduces two Skills, Ponytail and Caveman, for suppressing redundant code and compressing fluff answers. The tutorial claims the entire tuning can reduce token consumption by 60% to 80%, but this data comes from a single comparison test, and actual results vary by task.

Why Codex Is Worth Your 5 Hours

The AI Agent tool Codex is becoming standard equipment in developers' daily workflows. Bilibili creator "Wei Fanshi" released what they call "the most detailed Codex tutorial on Bilibili," covering the entire process from installation and configuration to hands-on feature usage in 5 hours, promising that even beginners can get up to speed quickly. The tutorial's core value lies in two things: first, bypassing complex network environment and account verification issues by connecting directly to domestic models like DeepSeekAd; second, a configuration tuning method the creator calls the "Fenjue" that claims to reduce token consumption by 60% to 80%.

This step is very simple

For domestic users blocked by login barriers, these two points hit exactly the pain points. This article organizes the reusable key steps and optimization logic based on the tutorial content.

Installation and API Access: Two Paths

Official Download and Login Methods

The Codex installation entry point is on the official page. The creator notes that in previous versions, ChatGPT and Codex have been officially merged, so what you download is actually the ChatGPT client. After double-clicking to open, two login methods appear: users with existing Plus or Pro accounts can log in directly; the other is logging in with an API, which is the key to switching to domestic models.

Connecting DeepSeek with CCSwitch

The bridge tool recommended in the tutorial is CCSwitch. After downloading and installing from the official website, a row of AI tools appears on the left side of the software—select Codex (the same applies to Claude Code). Add a provider in the upper right corner, select DeepSeek, and clicking "Get API Key" will redirect to the DeepSeek official page. After creating the key, copy and save it. The creator specifically reminds that a newly generated API Key is only displayed once, and do not leak it to others.

The newly generated API Key will only be displayed once

Paste the key into CCSwitch, click add and enable, completely exit Codex and reopen it, and DeepSeek is connected. The entire process avoids the hassle of account verification and phone number validation.

CCSwitch is an open-source desktop configuration switching tool, primarily used to centrally manage API endpoints and keys for various AI coding tools (such as Codex, Claude Code, etc.). Its core value is allowing users to quickly switch between different model providers without repeatedly modifying configuration files or environment variables. Its working principle is to centralize the configurations of various tools into a single UI interface. Users only need to select the target tool, add a provider, and fill in the API Key, and the software will automatically generate or modify the corresponding configuration files so that the tool reads the new configuration on its next startup. Since domestic models like DeepSeek provide APIs compatible with the OpenAI format, CCSwitch can complete the connection without modifying the Codex client itself—this is also the key to bypassing the official account system.

The Three-Piece Fenjue: Making Codex Smarter and More Cost-Effective

Guided Mode Replaces Queued Mode

Enter the settings general module, turn on full access permissions, and change the follow-up processing method from "queue" to "guide." The creator gives an intuitive example: when Codex deviates while executing a task, queued mode will finish executing the current erroneous action before processing new instructions, while guided mode will immediately stop the wrong approach and switch to executing new instructions. This avoids token waste from ineffective execution.

Switch to executing new instructions

In Agent-type tools, "queued mode" and "guided mode" correspond to two different instruction scheduling strategies. Queued mode treats user input as a pending queue—new instructions are not responded to until the current task is finished. Therefore, when the Agent goes in the wrong direction, the erroneous actions are still fully executed, wasting both tokens and time. Guided mode allows new instructions to interrupt the current execution flow, and the Agent immediately terminates operations that deviate from the goal and turns to the new instructions. This difference is especially pronounced in long tasks or multi-step reasoning scenarios: guided mode is closer to "timely correction" in human collaboration and can significantly reduce token consumption from ineffective execution. Note that guided mode requires the model to have good interruption and context-switching capabilities, and not all models can support it perfectly.

Enable Memory

After enabling the memory feature in the personalization interface, Codex will remember your instructions and interaction habits, gradually adapting to your communication style and work preferences. The benefit of this step is long-term: the more you use it, the better it understands you, and the cost of repeated explanations decreases accordingly.

Memory is one of the core personalization capabilities of AI coding assistants. Once enabled, Codex saves the user's instruction style, commonly used tech stack, code preferences, and key information from historical interactions locally or in the cloud, and automatically references them in subsequent conversations. Its technical implementation typically includes vectorized storage and retrieval: encoding historical interaction fragments into vectors, recalling relevant memories based on semantic similarity in new tasks, and then injecting them into the prompt. For users, this reduces the cost of repeatedly explaining project background and coding habits; but memory also brings trade-offs in privacy and accuracy—outdated or incorrect memories may interfere with the current task, so some tools provide entry points for viewing and deleting memories. The tutorial recommends keeping it enabled long-term, precisely based on the compounding effect of "the more you use it, the better it understands you."

Configure the Agent Manual

The Codex instructions in settings essentially correspond to the Agent.md file, which can be understood as the AI's "employee handbook." Codex reads and follows it before every task. The creator recommends beginners directly refer to the open-source template by AI expert Karpathy, which has received over 220,000 stars on GitHub. Its core principles are four: think before coding—stop and ask when confused; if 50 lines of code can do the job, never write 100; make precise modifications—only change the code that needs changing; goal-driven—loop verification until the goal is achieved. Once proficient, you can customize it yourself.

You can also add what you want or create a new custom one for yourself

Two Skills: Cutting Redundant Code and Fluff

Ponytail: Write Less Unnecessary Code

The first Skill is the famous Ponytail, which makes Codex avoid reinventing the wheel while ensuring safety. The creator's comparison: for the same task, the Agent without Ponytail wrote 335 lines of code, while with it installed, only a short 10 lines were needed. Installation is simple—just send a specified message to Codex to complete it.

A Skill in the Codex context is a preset prompt or instruction set. After installation, it is written into the Agent's configuration file or instruction file, causing the model to follow specific behavioral guidelines in subsequent tasks. Ponytail's core idea is "reuse over rewrite": it requires the Agent to first search the project for available functions, components, or utility libraries before starting to code, and only allows adding new code when it confirms no reusable solution exists. This strategy directly counters the common "reinventing the wheel" tendency in AI programming—models tend to generate complete implementations to pursue task completion while ignoring existing code assets. Although the 335-to-10-line comparison comes from a single test, it reflects the significant impact of prompt constraints on output scale. Installation of similar Skills usually only requires sending a natural language instruction to Codex, and the Agent writes it into the configuration file itself, lowering the barrier to use.

Caveman: Compress Fluff in Answers

The second Skill is Caveman, targeting the problem of AI wasting tokens on fluff. In a comparison test, without Caveman it consumed 63 tokens, while with it only 20 tokens were needed, and the answer quality was the same. It is likewise installed by sending a message to Codex.

These two Skills, together with the earlier configuration tuning, form the basis for the creator's claim of "reducing token consumption by 60% to 80%." It should be noted that these numbers come from single comparison tests within the tutorial, and the actual savings will vary depending on task type and usage habits.

Who This Method Is For

From the content, the barrier to this process is indeed very low: no need to struggle with network environments, no need to handle account verification, and it can run with the API of a domestic model. For users who want to try AI Agents but are deterred by login issues, this is an actionable path. And the value of the three-piece Fenjue and two Skills goes beyond saving money—guided mode reduces ineffective execution, memory lowers communication costs, and the Agent manual constrains output quality. Essentially, it's about training Codex from an "obedient tool" into a "well-matched collaborator."

The tutorial author also admits that these are just the beginning, and once proficient, you should re-customize the Agent manual according to your own habits. The barrier to entry for tools is decreasing, and the real difference will come down to how you configure it and how you give it instructions.

One-line Summary

Bilibili 5-hour Codex tutorial: connect DeepSeek via CCSwitch, combined with the three-piece Fenjue and two Skills to reduce token consumption by 60%-80%.

Paragraph Summary

Based on Bilibili creator "Wei Fanshi's" detailed Codex tutorial, this article outlines the path for domestic users to quickly get started with AI Agents while bypassing network and account barriers. The core solution is to use CCSwitch to connect the DeepSeek API to Codex, avoiding ChatGPT account registration and verification. At the configuration level, it proposes the "three-piece Fenjue": changing the follow-up method from queue to guide to reduce ineffective execution, enabling memory to lower repeated communication costs, and configuring Agent.md as the AI employee handbook (recommending Karpathy's open-source template). It also introduces two Skills, Ponytail and Caveman, respectively used to suppress redundant code and compress fluff answers. The tutorial claims the entire tuning can reduce token consumption by 60% to 80%, but this data comes from a single comparison test, and actual results vary by task.

#Codex tutorial#DeepSeek API#CCSwitch#AI Agent#token consumption reduction
Share:

Related articles