Skip to main content
OpenAI’s Codex CLI is a command-line coding agent that lets you interact with AI models directly from your terminal. This tutorial walks you through installing Codex CLI, creating a KiosAPI provider profile, and verifying that requests are routed correctly through KiosAPI.

System Requirements

You also need a KiosAPI API key (starts with sk-) from the DashboardToken Management.

Usage

VSCode Plugin

Codex is also available as a VSCode extension. After installing the extension, configure it to use KiosAPI by setting the same environment variables in your VSCode settings or terminal.
The VSCode extension reads environment variables from your shell. Make sure KILOAPI_KEY is exported in the shell that launches VSCode, or set it in the integrated terminal.

Advanced Configuration

Non-interactive CI mode

For CI/CD pipelines, run Codex in non-interactive mode:

MCP servers

Codex supports Model Context Protocol (MCP) servers for extended tool access. Add MCP servers to ~/.codex/config.toml:

Troubleshooting

Authentication error (401)

  • Verify KILOAPI_KEY is set correctly: echo $KILOAPI_KEY
  • Ensure the key starts with sk-
  • Check that the env_key value in your config file matches the environment variable name exactly

Model not found

  • Verify the model name in your profile is correct
  • Check available models on the KiosAPI pricing page

Connection error

  • Ensure base_url is https://kiosapi.com/v1 (with /v1)
  • Check your network connection and firewall settings

Need Help?