Howto & Style

How to Use OpenAI Codex for Free

by hUndefined

Share:

📚 Main topics

  • Using alternative providersCodex can be configured to use providers beyond OpenAI, including OpenRouter and locally hosted models through Ollama. The video demonstrates both approaches. 0:31
  • Setting up OpenRouterCreate an OpenRouter API key, set it as an environment variable, and launch Codex with OpenRouter as the provider. Then select a free model that supports tools. 1:03
  • Running a model with OllamaInstall Ollama, download a model that supports tools, and configure Codex to connect to Ollama using its provider option and API key environment variable. 4:38

✨ Key takeaways

  • Free cloud modelsOpenRouter offers free models, but you need to check that a model supports tools for it to work with Codex. 2:34
  • Local and offline useOllama runs models on your own computer, so Codex can work without sending requests to an external service. 6:09
  • Model requirements varyModels can differ in quality, speed, availability, cost, and hardware demands; local models may require substantial storage and computing resources. 4:07

🧠 Lessons learned

  • Expect some trial and errorA model may fail or behave differently, so try other tool-capable models if your first choice doesn’t work. 3:36
  • Protect API keysCopy a newly created OpenRouter key when it’s shown, and keep it private; create a replacement if it’s lost or exposed. 1:33
  • Check Ollama is runningIf starting the Ollama server produces a bind error, Ollama may already be running in the background. 5:38

🏁 Conclusion/next steps

  • Choose a provider and modelUse OpenRouter for eligible free hosted models or Ollama for local execution, and check each model’s tool support and limitations. 7:13

Transcript excerpt

0:00 Let me show you how you can use OpenAI's CLI tool, Codex, for free. By default, if you've used Codex before, you'll notice that you're using the model04 Mini. Now, this is one of OpenAI's models and it costs money in order to use the API to send and receive requests. Well, since every OpenAI model requires some amount of price in order to put in any inputs and get any outputs. This means that you have to supply your account with some money in order to use Codex at all, at least with the OpenAI models. But now we have the ability to switch providers. So we

0:31 don't just have to use open AI. We could use any model in the OpenRouter platform or the Gemini models or Ollama particularly. We could pull down an Ollama model onto our machine, run it locally and then configure it to be used inside of Codex. So we don't have to pay anything. We're literally running the model on our machine. So let's check out how we can do that. Well, the first way is I want to show you using the provider flag and using OpenRouter. So all we do here is we call C Codex which is our CLI tool and then we put a d-provider and then we follow that with

🔒 The full, searchable transcript is available with Pro.

🔒 Unlock Premium Features

This is a premium feature. Upgrade to unlock unlimited Q&A, transcripts, mindmaps, and translations.

🔒 Unlock Premium Features

Access to Chat is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Mindmap is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Translation is a premium feature. Upgrade now to unlock unlimited studying tools.

Get unlimited summaries, Q&A, transcripts and more with Pro

Upgrade to Pro

Suggestions

🔒 Unlock Premium Features

Access to AI Suggestions is a premium feature. Upgrade now to unlock unlimited studying tools.