You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gpt-5-codex model endpoint support + Codex CLI documentation #117
enable compatibility with new gpt-5-codex model, by default copilot-api routes to chat/completions endpoint however looks like codex model expects different endpoint
provide some documentation around compatibility with usage to Codex CLI config (similar to existing docs showing how can be used with claude code settings already)
here is minimal working toml config I have been using: (although if repo maintainers have other suggestions around that would be appreciated, if when added to README potentially)
model = "gpt-5-mini"review_model = "gpt-5-mini"model_provider = "copilot"
[model_providers.copilot]
name = "Github Copilot"base_url = "http://127.0.0.1:4141"
Reacted by Tom Brandenburg, Vlad Ivanov and Maplefurr
▌ hello?
⚠️ stream error: unexpected status 404 Not Found: 404 Not Found; retrying 1/5 in 187ms…
⚠️ stream error: unexpected status 404 Not Found: 404 Not Found; retrying 2/5 in 414ms…
⚠️ stream error: unexpected status 404 Not Found: 404 Not Found; retrying 3/5 in 863ms…
I used the same configuration, aren't you getting the same result?
copilot-api console:
<-- POST /responses
--> POST /responses 404 1ms
<-- POST /responses
--> POST /responses 404 0ms
<-- POST /responses
--> POST /responses 404 0ms
@zicjin#119 I have added the ping event, which currently resolves the codex disconnection issue: Transport error: error decoding response body. I've tested it and it's working fine now.
hi @caozhiyuan, I tried your fork branch and it works great. Thank you very much for your work. During usage, I encountered a small issue I'd like to ask you about: after enabling the codex web_search feature, when I run codex --search, I get the following error. Do you have any idea what might be causing this?
unexpected status 400 Bad Request: {"error":{"message":"{\"error\":{\"message\":\"The use of the web search tool is not supported.\",\"code\":\"unsupported_value\",\"param\":\"tools\",\"type\":\"invalid_request_error\"}}\n","type":"error"}}
Okay, but if we disable the web-search tool, how can the agent fetch the latest documents or information from the web? Doesn't this cause the agent to always use the data it was trained on?
@zicjin#119 I have added the ping event, which currently resolves the codex disconnection issue: Transport error: error decoding response body. I've tested it and it's working fine now.
@caozhiyuan I have been using your forked /all branch for Codex CLI lately and has been working great for the most part (for Planning/review etc.) although when it comes time to make file edits am running into 500 status internal server error intermittently (with gpt-5.2 model)
Since when has it been like this? I tried locally and it's the same. I've been using claude code. @dylbarne This is a copilot server-side error, possibly related to apply_patch custom_tool_call, it's not a function call.
Since when has it been like this? I tried locally and it's the same. I've been using claude code. @dylbarne This is a copilot server-side error, possibly related to apply_patch custom_tool_call, it's not a function call.
hmm yah am not entirely sure, I had also recently been using CC and opencode more recently, just came back to Codex this ~week and noticed the error
seems copilot not support custom tool . so changed it to function tool . codex support funtion and custom apply_patch tool, but can't change gpt-5.2 default config, so change tool type in request.
Given the recent policies of Claude, I'm also planning to migrate to OpenCode, which is a great tool. However, this tool has a lot of content, and feature updates might not be timely, so I've added a custom provider for this project. @dylbarne#167 (comment)
for me when setting only at the [features].web_search level, this did not seem to work , needed to set as web_search = "disabled" at root level despite warning in CLI
@caozhiyuan to some of the above point, would it potentially be possible to "map" web_search tool however Codex is calling to whatever legit enabled way Copilot expects? I am unfamiliar with the two architectures compatibility, though just assuming may have some may of doing this that the copilot api does allow
Activity
vtomnet commentedon Sep 25, 2025
#118
caozhiyuan commentedon Sep 26, 2025
@dylbarne @vtomnet in codex cli in done, https://github.com/caozhiyuan/copilot-api/tree/feature/gpt-5-codex . but in claude code ,need more test . use gpt-5-codex generated these codes
Louis454545 commentedon Sep 26, 2025
wow thanks for that, but how to setup copilot-api with codex ?
caozhiyuan commentedon Sep 26, 2025
@Louis454545 config.toml
model = "gpt-5-codex"
model_provider = "github-copilot"
model_reasoning_effort = "high"
[model_providers.github-copilot]
name = "github-copilot"
base_url = "http://localhost:4141"
env_key = "GITHUB_COPILOT_API_KEY"
wire_api = "responses"
zicjin commentedon Oct 1, 2025
@caozhiyuan
I used the same configuration, aren't you getting the same result?
copilot-api console:
caozhiyuan commentedon Oct 1, 2025
@zicjin #119 I have added the ping event, which currently resolves the codex disconnection issue: Transport error: error decoding response body. I've tested it and it's working fine now.
please update code , use https://github.com/caozhiyuan/copilot-api/tree/feature/gpt-5-codex
caozhiyuan commentedon Oct 1, 2025
this is my codex config
model = "gpt-5-codex"
model_provider = "github-copilot"
model_reasoning_effort = "high"
[model_providers.github-copilot]
name = "github-copilot"
base_url = "http://localhost:4141"
env_key = "GITHUB_COPILOT_API_KEY"
wire_api = "responses"
request_max_retries = 3
stream_max_retries = 0
stream_idle_timeout_ms = 300000
guanghechen commentedon Oct 18, 2025
hi @caozhiyuan, I tried your fork branch and it works great. Thank you very much for your work. During usage, I encountered a small issue I'd like to ask you about: after enabling the codex web_search feature, when I run
codex --search, I get the following error. Do you have any idea what might be causing this?caozhiyuan commentedon Oct 18, 2025
@guanghechen copilot don't support web_search tool, you should deny WebSearch. if use in claude code , add this setting https://github.com/ericc-ch/copilot-api/blob/master/README.md?plain=1#L319 . codex also can disable web_search tool
guanghechen commentedon Oct 18, 2025
Okay, but if we disable the web-search tool, how can the agent fetch the latest documents or information from the web? Doesn't this cause the agent to always use the data it was trained on?
caozhiyuan commentedon Oct 18, 2025
@guanghechen use mcp fetch or websearch
guanghechen commentedon Oct 18, 2025
Thank you for your fast reply! Do you have any recommended MCP fetch tools, Context7? By the way, what does "websearch" mean? Is it an MCP tool?
caozhiyuan commentedon Oct 18, 2025
@guanghechen "context7": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
},
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch",
"--ignore-robots-txt"
]
}
dylbarne commentedon Jan 9, 2026
@caozhiyuan I have been using your forked
/allbranch for Codex CLI lately and has been working great for the most part (for Planning/review etc.) although when it comes time to make file edits am running into 500 status internal server error intermittently (withgpt-5.2model)my config mostly matches the one you gave with respect to provider setup
caozhiyuan commentedon Jan 10, 2026
Since when has it been like this? I tried locally and it's the same. I've been using claude code. @dylbarne This is a copilot server-side error, possibly related to apply_patch custom_tool_call, it's not a function call.
dylbarne commentedon Jan 10, 2026
hmm yah am not entirely sure, I had also recently been using CC and opencode more recently, just came back to Codex this ~week and noticed the error
maybe is due to some settings around
apply_patch_freeform(just did this based on guidance from https://steipete.me/posts/2025/shipping-at-inference-speed#my-config) - potentially can play around with other patch-related settingsbut yah was just curious if you/others were experiencing the same
caozhiyuan commentedon Jan 10, 2026
@dylbarne fixed in caozhiyuan/copilot-api@afb7a5c
caozhiyuan commentedon Jan 10, 2026
seems copilot not support custom tool . so changed it to function tool . codex support funtion and custom apply_patch tool, but can't change gpt-5.2 default config, so change tool type in request.
caozhiyuan commentedon Jan 10, 2026
Given the recent policies of Claude, I'm also planning to migrate to OpenCode, which is a great tool. However, this tool has a lot of content, and feature updates might not be timely, so I've added a custom provider for this project. @dylbarne #167 (comment)
dylbarne commentedon Jan 29, 2026
just noting for others who might see and run into this, looks like Codex
web_searchis now enabled by default (https://developers.openai.com/codex/changelog/#codex-2026-01-28-mdx), so will need to disable in config.tomlfor me when setting only at the
[features].web_searchlevel, this did not seem to work , needed to set asweb_search = "disabled"at root level despite warning in CLI@caozhiyuan to some of the above point, would it potentially be possible to "map" web_search tool however Codex is calling to whatever legit enabled way Copilot expects? I am unfamiliar with the two architectures compatibility, though just assuming may have some may of doing this that the copilot api does allow
caozhiyuan commentedon Jan 30, 2026
@dylbarne fixed
johnib commentedon Apr 5, 2026
@dylbarne see my comment here: openai/codex#8361 (comment)
caozhiyuan commentedon Apr 6, 2026
The GitHub copilot gpt model has supported native web search for the past two months.
johnib commentedon Apr 6, 2026
my trials were on gpt-5.3-codex. could it be that it's indeed not enabled on that model?
not sure if this page confirms that or just not updated:
https://github.blog/changelog/2026-02-25-improved-web-search-in-copilot-on-github-com/
caozhiyuan commentedon Apr 8, 2026
@johnib in github website copilot setting, have a native websearch enable switch