API Key setup
Generate a config for Claude Code, Codex, OpenCode, or Hermes — or import it into CC Switch in one click.
Choose your AI tool
Codex local configuration
DeepSeek V4 Flash Vision Exp · Command line · macOS
codex --versionInstallation guide ↗1Save the configuration file
Create hiapi.config.toml in the .codex folder in your home directory, paste the configuration below, and save. Create the folder if needed.
~/.codex/hiapi.config.toml~ means your home directory; .codex is a hidden folder inside it.
model_provider = "hiapi"
model = "deepseek-v4-flash-vision-exp"
[model_providers.hiapi]
name = "HiAPI"
base_url = "https://api.hiapi.ai/v1"
env_key = "HIAPI_API_KEY"
wire_api = "responses"
Already have this file?
Leave config.toml unchanged. If hiapi.config.toml already exists, update its top-level model, model_provider, and the fields in [model_providers.hiapi]. Preserve other settings; do not duplicate keys or tables.
2Set your API key in the terminal
Open a terminal (bash / zsh), replace YOUR_HIAPI_API_KEY with your key, then run the command below. Do not put this command in the configuration file. Manage API Keys ↗
export HIAPI_API_KEY="YOUR_HIAPI_API_KEY"3Start your agent in the same terminal
In the terminal where you set the key, change to your project directory and run the command below. It loads hiapi.config.toml and preserves your default configuration. Set the key again when opening a new terminal. After starting the agent, send a message and check your request logs.
codex --profile hiapi4Confirm the connection with one message
After starting, send this in the same Agent conversation:
Reply with only HIAPI_OK. Do not read or modify files.After receiving the text, check request logs for the model and status; copying this prompt does not prove a connection. View request logs ↗
No reply?
Check your API Key, request logs, model, and CLI version first. Reasoning models may take longer; do not blindly set a very low output limit, force reasoning off, or change existing configuration.