All pages
On this page

OpenAI and OpenAI Image

OAR offers two providers that run on your own OpenAI API key, and you save the key once for both.

  • OpenAI (BYOK) is a coding agent. It is the GitHub Copilot runtime, pointed at the OpenAI API (or a compatible endpoint) with your key instead of a Copilot plan's models. It reads files, runs commands and edits code like a Copilot conversation.
  • OpenAI Image (BYOK) is not an agent. It is a chat in which every message becomes a request to the OpenAI Images API, and every reply is one or more pictures.

Both bill your OpenAI account. The OpenAI agent needs the GitHub Copilot CLI on the relay host, because the Copilot runtime runs it; see GitHub Copilot. The image provider does not use the Copilot CLI.

Setting it up #

Open Settings → Providers → OpenAI.

Field What it is Default
OpenAI API key Your key. Until a key is saved, the placeholder shows the start of an OpenAI key; afterwards it reads Saved API key (enter to replace). none
Enable OpenAI API key for New Chat model selection Offers OpenAI (BYOK) and OpenAI Image (BYOK) in New Chat. It is on as soon as you save a key, and unavailable until a key exists. on after the first save
OpenAI model ID The model the OpenAI agent uses by default. gpt-4o
Base URL (optional) Where requests go. Leave it empty for OpenAI itself. https://api.openai.com/v1

Press Save OpenAI settings. The relay then asks the endpoint for its model list (/models under the base URL) and adds what it finds to the model pickers. If that fails, the settings are still saved and a notice says why; the models from earlier stay.

The key is stored in the relay's database on the host. The field never shows it again: once a key is saved, its placeholder reads Saved API key (enter to replace). Leave it blank to keep the saved key, or type a new one to replace it.

The status line under the fields tells you where you are:

OpenAI API is enabled. Select OpenAI in New Chat to use model gpt-4o.
API key saved but currently disabled. Enable it to allow OpenAI selection in New Chat.
Not configured. New conversations use GitHub Copilot.

Switching it off or removing the key #

You do What happens
Turn the enable switch off New Chat stops offering both providers. The key and the model list stay saved. Conversations that have not sent a message yet stay where they are.
Press Remove saved key After a confirmation, the key and the model list are deleted and OpenAI is switched off. Conversations that have not sent a message yet and have nothing queued move to Copilot. A notice says new conversations use GitHub Copilot.
Press Remove saved key while an OpenAI conversation has a message or a queued item Refused. An alert shows Cannot remove OpenAI API key while N active OpenAI conversation(s) still exist. Disable OpenAI for new conversations instead. and the key stays.

Image chats count as OpenAI conversations here. In practice the key can only be removed once every OpenAI or OpenAI Image conversation that has a message has been deleted. If you only want to stop new OpenAI chats, turn the switch off instead. Conversations of other providers do not matter.

Another endpoint #

Put the address of any endpoint that speaks the OpenAI API in Base URL, for example https://llm.example.com/v1, and the key that endpoint expects in OpenAI API key. The agent talks to it for conversations, the relay for model discovery and for images. Saving the default address again clears the stored value.

The agent needs a model that supports tool calling and streaming, with a context window of at least 128k tokens for the best results. That is the Copilot CLI's requirement for any bring-your-own-key model; OAR does not check it. An image chat needs an endpoint with the image generation route and, for edits, the image edit route, and that lists an image model.

OpenAI, the agent #

Choose OpenAI (BYOK) as the Provider in New Chat. The model list is the one saved for your key. The conversation then behaves like a Copilot conversation: the same mode picker, queue, steering, question cards and file tools. See Starting a conversation for the dialog and Relay modes for the modes.

What follows from running on the Copilot runtime:

  • The Copilot engine decides the features. It is the relay-wide choice under Settings → Providers → Copilot → Copilot engine, read when a conversation's worker starts. Steering, the background task panel and question cards depend on it; see GitHub Copilot.

  • The model is pinned. After the first message, the composer is locked to the model the conversation started with, and the note above the input names it.

  • Reasoning effort depends on the model. The Reasoning effort options follow the model's name. The first option is preselected unless you used another one last.

    Model name starts with Options
    gpt-5, codex none, low, medium, high, xhigh
    o1, o3, o4 low, medium, high
    anything else none
  • Wire format. gpt-5, codex-, o1, o1-, o3, o3- and o4- models use the Responses API; others use Chat Completions. This matters if your endpoint supports only one of the two.

  • No plan usage. OpenAI turns have no usage line under the reply and no entry in Check Usage; those are for Copilot only. Compaction, restarts and resume work as for Copilot: see Compacting and Restarts and resume.

OpenAI Image, the image chat #

An image chat is for making and reworking pictures from a description. There is no agent: the relay sends your message to the Images API and shows what comes back in the chat.

Starting one #

  1. Open New Chat and set Provider to OpenAI Image (BYOK). It appears next to OpenAI (BYOK) once OpenAI is enabled.
  2. Choose a Model. Only image models are listed: those whose name starts with gpt-image- or dall-e-. The relay's model discovery keeps only names that start with gpt-, chatgpt-, o1, o3, o4-, codex- or openai/, so gpt-image-* models are found from your endpoint, but a dall-e-* model appears only if you enter its ID as the OpenAI model ID. If no image model is listed, there is nothing to choose.
  3. Set Quality and Size.
  4. Press Start chat, then describe the picture.

A chat with a non-image model is refused: OpenAI image provider requires an image model (received "model-name").

Picker Options Default
Quality auto, low, medium, high The option you used last (it shares the memory of Reasoning effort), otherwise auto
Size, gpt-image-* and other image models auto, 1024x1024, 1536x1024, 1024x1536 The size you used last, otherwise auto
Size, dall-e-3 1024x1024, 1792x1024, 1024x1792 The size you used last if offered, otherwise 1024x1024
Size, dall-e-2 256x256, 512x512, 1024x1024 The size you used last if offered, otherwise 256x256

"Used last" is remembered per browser. In the open chat, the composer keeps the two as pickers (the quality in the place of reasoning effort, titled Quality, and the size titled Image size), so you can change them from message to message. Each message makes one image. Quality and size are also set in Starting a conversation.

Editing and follow-ups #

A new message is a fresh picture. To rework one you already have, use Edit this image under it:

  1. Press Edit this image under the picture. A chip above the composer reads Editing and the image's name, with a button to cancel, and the input asks Describe how to edit this image….
  2. Type what to change and send. The relay sends that exact image and your text to the Images API's edit route, and the new picture appears as the reply.
  3. The new picture has Edit this image too, and a link Edited from previous image that jumps back to the one it came from.

Because the edit starts from the picture you pressed the button under, you can branch: edit an older image again without the later ones coming along. The chip clears after the message is sent.

You can also attach an image of your own to a message in an image chat. The first image attached is the one that is edited. Only the first is used.

Switching it off

Edit this image belongs to the Generated-image continuity setting in Settings → Features, which is on by default. With it off, the button is gone and a follow-up has no link to an earlier picture, but attaching an image still edits it.

Where the pictures live #

The relay saves each generated picture as a file on the host, in the Copilot CLI's session-state folder (~/.copilot/session-state, or the folder named by COPILOT_SESSION_STATE_DIR), under the conversation. It shows them in the chat from there, and a shared read-only link shows them too. They stay as long as the conversation does; deleting the conversation deletes its pictures.

What an image chat does not have #

The request is only your text and, for an edit, one image. So there is no working folder to read or write, no tools, no questions from an agent, no steering of a running turn, no background tasks and no compacting. The mode picker still shows but has no effect; see Relay modes. Nothing runs on the relay host except the request.

If a request fails, the chat shows the reason in the reply. A failure the endpoint reports as a client error (status 400 to 499) is not retried; the turn fails with Error code: relay.image-provider-rejected. A network error or a server error is retried. If the relay is interrupted after an image may already have been made, it is not run again, to avoid duplicates.

Costs #

Both providers bill your OpenAI account, or whatever account your endpoint belongs to. OAR does not meter it: OpenAI turns have no usage line and no entry in Check Usage, and image requests show no cost. Watch your spend in your provider's dashboard. One image message makes one image request; an agent turn can make many model requests, because every tool step is another round trip.

Side by side #

OpenAI (BYOK) OpenAI Image (BYOK)
What runs The Copilot runtime, with your key The relay, calling the Images API
Needs the Copilot CLI Yes No
Reply Text, code, tool activity One picture per message
Models The discovered chat models; default gpt-4o gpt-image-* and dall-e-*
New Chat pickers Reasoning effort Quality and Size
Tools, working folder, relay modes Yes No (the mode picker has no effect)
Steering, background tasks, question cards Yes (SDK engine) No
Follow-up The conversation continues Edit this image, or an attached image

When it does not work #

You see Cause and fix
OpenAI (BYOK) and OpenAI Image (BYOK) are missing from Provider No key is saved, or the enable switch is off. Open Settings → Providers → OpenAI.
OpenAI API key is not configured when starting a chat No key is saved. Save one again.
Save an OpenAI API key before enabling OpenAI. You turned the switch on with no key saved. Enter a key and press Save OpenAI settings.
A notice after saving that model discovery failed, such as OpenAI model discovery failed (401) The endpoint refused the key, or the base URL is wrong. The settings are saved; fix the key or URL and save again.
OpenAI model "name" is not available The model is not in the saved list. Check the OpenAI model ID and the endpoint's model list, or press Refresh in Select Models.
An image chat has no model to choose The endpoint lists no gpt-image-* or dall-e-* model.
OpenAI image API failed (401) or another status The endpoint rejected the request. The first 240 characters of its message follow the status. A bad key, no access to that model, or a refused size or quality are the usual causes.
OpenAI image API request failed The relay could not reach the endpoint. Check the base URL and the host's network.
An edit says The parent generated image is unavailable The picture's file is gone from the host. Start from a new picture.
Cannot remove OpenAI API key while N active OpenAI conversation(s) still exist… See Switching it off or removing the key.
The OpenAI agent fails to start Check that the Copilot CLI is installed on the host (see GitHub Copilot) and that the model fits the endpoint, including the wire format above.