OPENAI_BASE_URL to determine the API endpoint. Set this to https://api.tokios.com along with your Tokios key, and Codex routes to your local model through the Tokios tunnel.
Prerequisites
- A running Tokios Connector paired with your local model — see Connector Install
- A registered model deployment name — see Register a Model
- A Tokios API key — see API Keys
- OpenAI Codex installed
Set up the environment
- Windows CMD
- macOS & Linux
codex-windows.cmd
Using the OpenAI Python SDK
If you prefer to call your local model programmatically, initialize the OpenAI client with the Tokios base URL and your API key:openai_tokios.py
The OpenAI Python SDK requires the base URL to end with
/v1. The Tokios endpoint is https://api.tokios.com/v1.