Connect OpenAI to Unsloth: Run GPT Models in Local Chat
Learn how to connect OpenAI models, including GPT-5.5 to Unsloth so you can chat with all of them in an open-source local UI chat interface. By connecting your OpenAI API key, you can run GPT models inside Unsloth with features like web search, tool-calling, code execution, image generation, reusable code containers, and prompt caching.
This guide walks you through creating an OpenAI API key, connecting OpenAI as a provider, loading available models, and troubleshooting common setup issues.
Setup
Configure Connections
Next, connect your provider to Unsloth.
Open Settings → Connections, then click Add Connection.
Select the OpenAI, then paste the API key you copied earlier.
Click Reload Models to refresh the list with models available to your account.
Choose the models you want to enable, then hit save.

Code Execution
When enabled, supported OpenAI models can run code in a provider sandbox to solve problems, analyse data, and work with files.

OpenAI uses reusable shell containers. In Code Execution settings, you can set the idle timeout, create containers, select the active container, refresh the list, or delete old containers.
Select the same container in a new thread to continue with its files and state.

Prompt Caching
Prompt caching reduces latency and cost when requests reuse the same long prefix. It is supported for compatible providers and servers, including OpenAI. Use the Prompt caching setting in the side panel to control caching behaviour for supported connections.


Web Search & Thinking
Provider-side web search is available for supported models from OpenAI. The Think control adapts to the selected model: some models use an on/off toggle, while reasoning-effort models use model specific thinking levels.

Image Generation
Just like GPT, Unsloth also supports image generation. You can directly edit an image by clicking the “Edit Image” button and entering a new prompt to refine or regenerate it. Images are generated automatically when requested, but you can toggle this behavior off. A download button is also available, allowing you to save the image in its original full resolution.


Troubleshooting
If OpenAI fails to connect, check that the API key is valid and belongs to the correct OpenAI account.
If a model does not appear after clicking Load Models, it may not be available for your account. You can enter the model ID manually or choose another model.
Last updated
Was this helpful?



