continue-custom/docs/customize/model-providers/top-level/openai.mdx
Dallin Romney 15ea93dae0
feat: add useResponsesApi option to opt out of Responses API (#11809)
* feat: add `useResponsesApi` option to allow opting out of OpenAI Responses API

Add a `useResponsesApi` config option that, when set to false, forces
o-series and gpt-5 models to use /chat/completions instead of /responses.
This helps users whose organizations are not verified avoid "organization
must be verified" errors related to reasoning summaries and streaming.

The option gates both code paths where the Responses API is selected:
- `canUseOpenAIResponses()` in BaseLLM (native path)
- `shouldUseResponsesEndpoint()` in the OpenAI adapter

Closes #11772
Related: #8209, #7129

* feat: suggest `useResponsesApi: false` in org verification error messages

Update error detection to also catch "organization must be verified to
stream" errors (in addition to reasoning summaries), and update the
error message to suggest adding `useResponsesApi: false` to model config
as a workaround.

* fix: improve org verification error message copy

* fix: add useResponsesApi to LLMOptions in index.d.ts

The actual type definitions used by tsc are in core/index.d.ts, not in
the string template in config/types.ts.

* fix: also check provider name when detecting org verification errors

The error message from OpenAI's API doesn't always contain the word
"openai" — check the provider name from the model config as well.

* feat: detect missing authentication header error and suggest adding apiKey

* fix: handle missing auth error directly in 401 dialog block

The 401 status code handler in StreamError.tsx renders before the
customErrorMessage check, so detect the missing authentication error
inline within the 401 block.

* Revert "fix: handle missing auth error directly in 401 dialog block"

This reverts commit 0053957d2df7c64ddea2279982f5e07e2cee1020.

* style: fix prettier formatting in index.d.ts

* style: revert unrelated prettier reformatting in index.d.ts

* fix: handle undefined providerName in error analysis

* fix: use YAML-style formatting in useResponsesApi suggestion
2026-03-25 16:09:46 -07:00

167 lines
3.9 KiB
Text

---
title: "How to Configure OpenAI Models with Continue"
slug: ../openai
sidebarTitle: "OpenAI"
---
<Tip>
**Discover OpenAI models [here](https://continue.dev/openai)**
</Tip>
<Info>
Get an API key from the [OpenAI Console](https://platform.openai.com/account/api-keys)
</Info>
## Configuration
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: <MODEL_NAME>
provider: openai
model: <MODEL_ID>
apiKey: <YOUR_OPENAI_API_KEY>
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<MODEL_NAME>",
"provider": "openai",
"model": "<MODEL_ID>",
"apiKey": "<YOUR_OPENAI_API_KEY>"
}
]
}
```
</Tab>
</Tabs>
<Info>
**Check out a more advanced configuration [here](https://continue.dev/openai/gpt-5?view=config)**
</Info>
## OpenAI API compatible providers
OpenAI API compatible providers include
- [KoboldCpp](https://github.com/lostruins/koboldcpp)
- [text-gen-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai#setup--installation)
- [FastChat](https://github.com/lm-sys/FastChat/blob/main/docs/openai_api.md)
- [LocalAI](https://localai.io/basics/getting_started/)
- [llama-cpp-python](https://github.com/abetlen/llama-cpp-python#web-server)
- [TensorRT-LLM](https://github.com/NVIDIA/trt-llm-as-openai-windows?tab=readme-ov-file#examples)
- [vLLM](https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html)
- [BerriAI/litellm](https://github.com/BerriAI/litellm)
- [Tetrate Agent Router Service](https://router.tetrate.ai)
If you are using an OpenAI API compatible providers, you can change the `apiBase` like this:
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: <OPENAI_API_COMPATIBLE_PROVIDER_MODEL>
provider: openai
model: <MODEL_NAME>
apiBase: http://localhost:8000/v1
apiKey: <YOUR_CUSTOM_API_KEY>
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<OPENAI_API_COMPATIBLE_PROVIDER_MODEL>",
"provider": "openai",
"model": "<MODEL_NAME>",
"apiKey": "<YOUR_CUSTOM_API_KEY>",
"apiBase": "http://localhost:8000/v1"
}
]
}
```
</Tab>
</Tabs>
### How to Force Legacy Completions Endpoint Usage
To force usage of `completions` instead of `chat/completions` endpoint you can set:
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: <OPENAI_API_COMPATIBLE_PROVIDER_MODEL>
provider: openai
model: <MODEL_NAME>>
apiBase: http://localhost:8000/v1
useLegacyCompletionsEndpoint: true
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<OPENAI_API_COMPATIBLE_PROVIDER_MODEL>",
"provider": "openai",
"model": "<MODEL_NAME>",
"apiBase": "http://localhost:8000/v1",
"useLegacyCompletionsEndpoint": true
}
]
}
```
</Tab>
</Tabs>
### How to Disable the Responses API
By default, Continue uses OpenAI's `/responses` endpoint for o-series and gpt-5 models. If you encounter "organization must be verified" errors related to reasoning summaries or streaming, you can force the use of `/chat/completions` instead:
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: gpt-5
provider: openai
model: gpt-5
useResponsesApi: false
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "gpt-5",
"provider": "openai",
"model": "gpt-5",
"useResponsesApi": false
}
]
}
```
</Tab>
</Tabs>