These are instructions to set up
You don’t need admin access or OpenAI API keys.
Download Visual Studio Code and install it.
Then open any folder in VS Code.
Select the Extensions icon in the sidebar. Search for “Codex” in the search bar and install the one by OpenAI.
CAREFUL! There are multiple Codex extensions. You want the Codex - OpenAI’s coding agent.
Click on the Codex icon in the sidebar.
This should show 2 buttons:
Click on Use API Key and type “ABCD” (or any other random string) in the API key field and click “OK”. We will change this later.
Press “Continue” when prompted.
Click on the gear-like settings icon to the right of the Codex pane, then Codex settings, then Open config.toml.
Paste the following into the config.toml
file and save it.
profile = "llmfoundry"
[profiles.llmfoundry]
model_provider = "llmfoundry_openai"
model = "gpt-5-codex"
model_reasoning_effort = "low"
[model_providers.llmfoundry_openai]
name = "LLM Foundry - OpenAI"
base_url = "https://llmfoundry.straive.com/openai/v1"
env_key = "LLMFOUNDRY_TOKEN"
wire_api = "responses"
Any changes to config.toml
require a restart of VS Code.
Visit LLM Foundry and log in with your official Google account.
Then click on the “Code” tab.
Copy the LLM Foundry token.
Search for “Edit environment variables for your account” in the Windows search bar.
Select “New” from the “User variables” section.
Set the variable name to:
LLMFOUNDRY_TOKEN
CAREFULLY! Copy paste it. Or, if typing:
LLMFOUNDRY
not llmfoundry
).LLMFOUNDRY
not LLMFOUNDARY
).LLMFOUNDRY_TOKEN
not LLMFOUNDRY TOKEN
).Set the variable value to the token you copied from LLM Foundry > Code.
Close VS Code.
Then re-open it.
Click on the Codex icon in the sidebar.
Type “Hi” (or anything else) in the prompt box and press Enter.
lf goes well, you should see a response from Codex.
If you see an error like this:
Try the following:
LLMFOUNDRY_TOKEN
environment variable is correct. Re-add it and restart VS Code.You can now use Codex in VS Code with LLM Foundry. Here are a few simple things to try.
Open the Windows search bar and search for “Python”. Install any of the Python versions from the Microsoft Store. This will allow Codex to run Python code locally.
To avoid Codex asking for too many approvals, use the “Agent (full access)” mode.