Coding Agent
Connect Codex CLI to SoCLaaS
Use Codex from your terminal with a SoCLaaS API key. Codex talks to the gateway through a custom OpenAI-compatible model provider.
We recommend OpenCode for most users. Codex CLI is built around OpenAI's own models and may not work best with third-party LLM providers. If you are choosing a client, start with the OpenCode setup guide.
Recommended: download a ready-made config. Open Portal → Client Setup, download soclaas.config.toml and soclaas-model-catalog.json, and save both in ~/.codex/. Then run codex --profile soclaas. The generated catalog lists every chat model available to your key.
The portal also provides a soclaas.env file for loading SOCLAAS_API_KEY; the shell environment instructions on the same page show where to save it.
The API key portal is available from the NUS network, while the API gateway itself is reachable from the Internet. Check the exact Codex config keys against your installed version, since the CLI changes frequently.
What you need
| Setting | Value |
|---|---|
| Base URL | https://soclaas-api.comp.nus.edu.sg/v1 |
| API key | From the SoCLaaS portal, stored in SOCLAAS_API_KEY |
| Model | A chat-capable ID from GET /v1/models |
Manual setup
Use these steps if you prefer not to download the generated config.
-
Get an API key
Sign in to the SoCLaaS portal from the NUS network and create a personal key. The portal can also download a
soclaas.envfile that setsSOCLAAS_API_KEYfor you. -
Export the key
Add this to your shell profile so new terminals pick it up.
export SOCLAAS_API_KEY="YOUR_API_KEY" -
Find a model ID
curl https://soclaas-api.comp.nus.edu.sg/v1/models \ -H "Authorization: Bearer $SOCLAAS_API_KEY"Choose a model that supports chat and copy its
id. -
Install Codex
npm install -g @openai/codex codex --version -
Configure the provider
Edit
~/.codex/config.toml. ReplaceYOUR_MODEL_IDwith the ID from step 3.model = "YOUR_MODEL_ID" model_provider = "soclaas" model_reasoning_effort = "none" [model_providers.soclaas] name = "SoCLaaS" base_url = "https://soclaas-api.comp.nus.edu.sg/v1" env_key = "SOCLAAS_API_KEY" wire_api = "responses"SoCLaaS exposes both endpoints. If your Codex version or chosen model has trouble with the Responses API, switch
wire_apitochat. -
Run Codex
codex "Summarise this repository in three bullets."If you saved the generated files instead, launch the profile with
codex --profile soclaas.
Troubleshooting
- 401 or 403: confirm
SOCLAAS_API_KEYis exported in the same shell that launches Codex. - Connection refused or timeout: check your network connection and the gateway status.
- Unknown model: re-run the
/v1/modelsrequest and use the exactidvalue. - Responses API errors: switch
wire_apitochat, or the other way around. - Profile not found: confirm
soclaas.config.tomlis directly inside~/.codex/.