Skip to content

Codex Manual Setup

Connect Codex to Tianshu by editing config.toml and auth.json.

Prerequisite: you've completed Environment Check and Install and codex runs properly.

Open the config directory

text
Press Win + R, enter the path and press Enter:
%userprofile%\.codex
text
In Finder press Command + Shift + G, enter the path and press Enter:
~/.codex

We only need two files: config.toml (core config) and auth.json (the key). A fresh install may not have these two files, so you'll need to create them manually.

Configure config.toml

Write the following into config.toml (for model, use a model name from your Codex group on the Model Marketplace):

toml
model_provider = "tianshu"
model = "gpt-5.2"
model_reasoning_effort = "high"
model_verbosity = "high"
network_access = "enabled"
disable_response_storage = true
windows_wsl_setup_acknowledged = true

[features]
web_search_request = true

[model_providers.tianshu]
name = "tianshu"
base_url = "https://tian-shu.org/v1"
wire_api = "responses"
requires_openai_auth = true

Configure auth.json

Write the following into auth.json, replacing xxx with your Tianshu Codex group token:

json
{
  "OPENAI_API_KEY": "xxx"
}

Test

Run in a terminal:

bash
codex

When the chat interface appears and replies normally, the configuration succeeded.

Tips

  • Global prompt: create AGENTS.md in the config directory and write your global working rules (such as "answer in English"), then restart Codex to apply.
  • Common commands, Windows garbled text, the VSCode extension and more tips are in FAQ · Codex.