https://thapi.cloud/v1

← All applications · Connect apps section on /docs

OpenAIconfigure codex

Codex CLI

Also known as: codex · OpenAI Codex CLI

Codex CLI: configure the API key, model and provider in your terminal.

Published instructions · Checked version: 0.163.0-alpha.10.2 · Checked on:

The real application was run against a local mock API to check connection settings, authentication and streaming responses. Production, all features, plugins and operating systems have not been verified.

Chat, ping, invoke and content-generation examples may send real billable requests. Check the model, balance, rate and minimum before running them. GET /v1/models checks authentication and the catalogue only. Set up environment variables safely

Base URL to paste

OpenAI SDKs generally use a URL ending in /v1; Anthropic SDKs use the root URL. Avoid adding /v1 twice. Protocol compatibility does not guarantee every provider feature.

https://thapi.cloud/v1

Prerequisites

  1. `codex` is installed
  2. API key ThAPI
  3. STALI_API_KEY environment variable (recommended)

Recommended model: gpt-5.6-sol

Quick way — command / config

npm install -g API CLI@latest
api-cli configure codex -m gpt-5.6-sol
export STALI_API_KEY='sk-thapi-...'
codex

Where to place file / fill Settings

Filemacos
~/.codex/config.toml
Use the content from the config.toml snippet. Make sure base_url includes /v1.
Filelinux
~/.codex/config.toml
Same as macOS.
Filewindows
%USERPROFILE%\.codex\config.toml
Create the `.codex` directory if missing; paste the TOML; run setx STALI_API_KEY.

Verify connection

  1. `codex` runs and returns a short response.
  2. Dashboard → Usage.

Troubleshooting

SymptomReasonHow to handle
404base_url is missing /v1.base_url = "https://thapi.cloud/v1"
Missing API keyenv_key STALI_API_KEY has not been exported.export/setx STALI_API_KEY, then open a new terminal.

Notes

  • Codex App (GUI) usually shares ~/.codex — see the codex-app page.

Related

Codex App · OpenCode · API CLI

Zalo group