[GH-ISSUE #12212] issue: 连接外部api失败,OpenAI: Network Problem?? #55175

Closed
opened 2026-05-05 17:15:41 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @tonycheungzyz on GitHub (Mar 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12212

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Pip Install

Open WebUI Version

0.5.19-0.5.20

Ollama Version (if applicable)

No response

Operating System

windows10 and ubuntu

Browser (if applicable)

Chrome

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

使用外部api

Actual Behavior

OpenAI: Network Problem

Steps to Reproduce

1、管理员面板--外部连接 open ai api
2、url https://ark.cn-beijing.volces.com/api/v3
密钥:a6xxxxx-xxxx-xxxx-xxx-xxxxxxxx
模型id:xxxx
验证连接时提示:OpenAI: Network Problem

Logs & Screenshots

控制台报错:
Traceback (most recent call last):

File "", line 198, in _run_module_as_main
File "", line 88, in _run_code

File "D:\open_webui.venv\Scripts\open-webui.exe_main_.py", line 10, in
sys.exit(app())
│ │ └ <typer.main.Typer object at 0x000002625A1C0890>
│ └
└ <module 'sys' (built-in)>

File "D:\open_webui.venv\Lib\site-packages\typer\main.py", line 322, in call
return get_command(self)(*args, **kwargs)
│ │ │ └ {}
│ │ └ ()
│ └ <typer.main.Typer object at 0x000002625A1C0890>
└ <function get_command at 0x000002625E2D6FC0>
File "D:\open_webui.venv\Lib\site-packages\click\core.py", line 1161, in call
return self.main(args, **kwargs)
│ │ │ └ {}
│ │ └ ()
│ └ <function TyperGroup.main at 0x000002625E24B9C0>

File "D:\open_webui.venv\Lib\site-packages\typer\core.py", line 740, in main
return _main(
└ <function _main at 0x000002625E24AC00>
File "D:\open_webui.venv\Lib\site-packages\typer\core.py", line 195, in _main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x000002625E2F6900>
│ └ <function MultiCommand.invoke at 0x000002625C3A4F40>

File "D:\open_webui.venv\Lib\site-packages\click\core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x000002625A351310>
│ │ │ └ <function Command.invoke at 0x000002625C3A4900>
│ │ └
│ └ <click.core.Context object at 0x000002625A351310>
└ <function MultiCommand.invoke.._process_result at 0x000002625E64E7A0>
File "D:\open_webui.venv\Lib\site-packages\click\core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080}
│ │ │ │ └ <click.core.Context object at 0x000002625A351310>
│ │ │ └ <function serve at 0x000002625E64E660>
│ │ └
│ └ <function Context.invoke at 0x000002625C393240>
└ <click.core.Context object at 0x000002625A351310>
File "D:\open_webui.venv\Lib\site-packages\click\core.py", line 788, in invoke
return _callback(*args, **kwargs)
│ └ {'host': '0.0.0.0', 'port': 8080}
└ ()
File "D:\open_webui.venv\Lib\site-packages\typer\main.py", line 697, in wrapper
return callback(**use_params)
│ └ {'host': '0.0.0.0', 'port': 8080}
└ <function serve at 0x000002625E4A7BA0>
File "D:\open_webui.venv\Lib\site-packages\open_webui_init
.py", line 77, in serve
uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="
")
│ │ │ │ │ │ └ 8080
│ │ │ │ │ └ '0.0.0.0'
│ │ │ │ └ <fastapi.applications.FastAPI object at 0x000002627C4510D0>
│ │ │ └ <module 'open_webui.main' from 'D:\open_webui\.venv\Lib\site-packages\open_webui\main.py'>
│ │ └ <module 'open_webui' from 'D:\open_webui\.venv\Lib\site-packages\open_webui\init.py'>
│ └ <function run at 0x000002625E4A7B00>
└ <module 'uvicorn' from 'D:\open_webui\.venv\Lib\site-packages\uvicorn\init.py'>
File "D:\open_webui.venv\Lib\site-packages\uvicorn\main.py", line 579, in run
server.run()
│ └ <function Server.run at 0x000002625E4A7D80>
└ <uvicorn.server.Server object at 0x0000026210E745F0>
File "D:\open_webui.venv\Lib\site-packages\uvicorn\server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
│ │ │ │ └ None
│ │ │ └ <function Server.serve at 0x000002625E4A7E20>
│ │ └ <uvicorn.server.Server object at 0x0000026210E745F0>
│ └ <function run at 0x000002625E2D7EC0>
└ <module 'asyncio' from 'C:\Program Files\Python312\Lib\asyncio\init.py'>
File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
│ │ └ <coroutine object Server.serve at 0x000002625E607760>
│ └ <function Runner.run at 0x000002625E40D1C0>
└ <asyncio.runners.Runner object at 0x0000026210E115E0>
File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
│ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at D:\open_webui.venv\Lib\site-packages\uvicorn\server.py:70> wait
...
│ │ └ <function BaseEventLoop.run_until_complete at 0x000002625E402DE0>
│ └
└ <asyncio.runners.Runner object at 0x0000026210E115E0>
File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 674, in run_until_complete
self.run_forever()
│ └ <function ProactorEventLoop.run_forever at 0x000002625E447C40>

File "C:\Program Files\Python312\Lib\asyncio\windows_events.py", line 322, in run_forever
super().run_forever()
File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 641, in run_forever
self._run_once()
│ └ <function BaseEventLoop._run_once at 0x000002625E40CB80>

File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 1987, in _run_once
handle._run()
│ └ <function Handle._run at 0x000002625E395080>
└ <Handle Task.task_wakeup()>
File "C:\Program Files\Python312\Lib\asyncio\events.py", line 88, in _run
self._context.run(self._callback, *self._args)
│ │ │ ��� │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle Task.task_wakeup()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle Task.task_wakeup()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle Task.task_wakeup()>
File "D:\open_webui.venv\Lib\site-packages\starlette\middleware\base.py", line 141, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
│ │ │ │ └ <function BaseHTTPMiddleware.call..call_next..send_no_error at 0x0000026212145080>
│ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x0000026210EC89B0>
└ <open_webui.main.RedirectMiddleware object at 0x000002620FAD4080>
File "D:\open_webui.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
│ │ │ │ │ │ └ <function BaseHTTPMiddleware.call..call_next..send_no_error at 0x0000026212145080>
│ │ │ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ │ │ └ <starlette.requests.Request object at 0x000002621233B7D0>
│ │ └ <fastapi.routing.APIRouter object at 0x000002627C467AD0>
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x0000026210EC89B0>
└ <function wrap_app_handling_exceptions at 0x000002626101E160>
File "D:\open_webui.venv\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x0000026212144540>
│ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
└ <fastapi.routing.APIRouter object at 0x000002627C467AD0>
File "D:\open_webui.venv\Lib\site-packages\starlette\routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x0000026212144540>
│ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x000002627C467AD0>>
└ <fastapi.routing.APIRouter object at 0x000002627C467AD0>
File "D:\open_webui.venv\Lib\site-packages\starlette\routing.py", line 735, in app
await route.handle(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x0000026212144540>
│ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ └ <function Route.handle at 0x000002626101F600>
└ APIRoute(path='/openai/verify', name='verify_connection', methods=['POST'])
File "D:\open_webui.venv\Lib\site-packages\starlette\routing.py", line 288, in handle
await self.app(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x0000026212144540>
│ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ └ <function request_response..app at 0x000002621091E980>
└ APIRoute(path='/openai/verify', name='verify_connection', methods=['POST'])
File "D:\open_webui.venv\Lib\site-packages\starlette\routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
│ │ │ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x0000026212144540>
│ │ │ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
│ │ └ <starlette.requests.Request object at 0x000002621233B200>
│ └ <function request_response..app..app at 0x0000026212145BC0>
└ <function wrap_app_handling_exceptions at 0x000002626101E160>
File "D:\open_webui.venv\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions..wrapped_app..sender at 0x00000262121380E0>
│ │ └ <function BaseHTTPMiddleware.call..call_next..receive_or_disconnect at 0x00000262121442C0>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
└ <function request_response..app..app at 0x0000026212145BC0>
File "D:\open_webui.venv\Lib\site-packages\starlette\routing.py", line 73, in app
response = await f(request)
│ └ <starlette.requests.Request object at 0x000002621233B200>
└ <function get_request_handler..app at 0x000002621091F880>
File "D:\open_webui.venv\Lib\site-packages\fastapi\routing.py", line 301, in app
raw_response = await run_endpoint_function(
└ <function run_endpoint_function at 0x000002626101DEE0>
File "D:\open_webui.venv\Lib\site-packages\fastapi\routing.py", line 212, in run_endpoint_function
return await dependant.call(**values)
│ │ └ {'user': UserModel(id='d2736cf4-8548-45b0-aea0-bc0d3fc411dc', name='志哥本机', email='1@qq.com', role='admin', profile_image_url=...
│ └ <function verify_connection at 0x000002627A6DD080>
└ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

File "D:\open_webui.venv\Lib\site-packages\open_webui\routers\openai.py", line 554, in verify_connection
res = await r.json()
│ └ <function ClientResponse.json at 0x000002625F537740>
└ <ClientResponse(https://ark.cn-beijing.volces.com/api/v3/models) [404 Not Found]>
<CIMultiDictProxy('x-request-id': '02174339...
File "D:\open_webui.venv\Lib\site-packages\aiohttp\client_reqrep.py", line 1281, in json
raise ContentTypeError(
└ <class 'aiohttp.client_exceptions.ContentTypeError'>

aiohttp.client_exceptions.ContentTypeError: 404, message='Attempt to decode JSON with unexpected mimetype: ', url='https://ark.cn-beijing.volces.com/api/v3/models'
2025-03-31 11:28:05.557 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:58233 - "POST /openai/verify HTTP/1.1" 500 - {}

Additional Information

使用python可以正常访问该接口:
def get_json_from_api(api_key, endpoint_id):
client = OpenAI(
api_key="与所填密钥一致",
base_url="https://ark.cn-beijing.volces.com/api/v3",
)
completion = client.chat.completions.create(
model="与所填模型id一致",
max_tokens=12288,
response_format={
'type': 'json_object'
},
messages=[
{
"role": "system",
"content": "内容"
},
{
"role": "user",
"content": "提问内容"
}
])

Originally created by @tonycheungzyz on GitHub (Mar 31, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12212 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Pip Install ### Open WebUI Version 0.5.19-0.5.20 ### Ollama Version (if applicable) _No response_ ### Operating System windows10 and ubuntu ### Browser (if applicable) Chrome ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior 使用外部api ### Actual Behavior OpenAI: Network Problem ### Steps to Reproduce 1、管理员面板--外部连接 open ai api 2、url https://ark.cn-beijing.volces.com/api/v3 密钥:a6xxxxx-xxxx-xxxx-xxx-xxxxxxxx 模型id:xxxx 验证连接时提示:OpenAI: Network Problem ### Logs & Screenshots 控制台报错: Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "D:\open_webui\.venv\Scripts\open-webui.exe\__main__.py", line 10, in <module> sys.exit(app()) │ │ └ <typer.main.Typer object at 0x000002625A1C0890> │ └ <built-in function exit> └ <module 'sys' (built-in)> File "D:\open_webui\.venv\Lib\site-packages\typer\main.py", line 322, in __call__ return get_command(self)(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <typer.main.Typer object at 0x000002625A1C0890> └ <function get_command at 0x000002625E2D6FC0> File "D:\open_webui\.venv\Lib\site-packages\click\core.py", line 1161, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function TyperGroup.main at 0x000002625E24B9C0> └ <TyperGroup > File "D:\open_webui\.venv\Lib\site-packages\typer\core.py", line 740, in main return _main( └ <function _main at 0x000002625E24AC00> File "D:\open_webui\.venv\Lib\site-packages\typer\core.py", line 195, in _main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x000002625E2F6900> │ └ <function MultiCommand.invoke at 0x000002625C3A4F40> └ <TyperGroup > File "D:\open_webui\.venv\Lib\site-packages\click\core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) │ │ │ │ └ <click.core.Context object at 0x000002625A351310> │ │ │ └ <function Command.invoke at 0x000002625C3A4900> │ │ └ <TyperCommand serve> │ └ <click.core.Context object at 0x000002625A351310> └ <function MultiCommand.invoke.<locals>._process_result at 0x000002625E64E7A0> File "D:\open_webui\.venv\Lib\site-packages\click\core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080} │ │ │ │ └ <click.core.Context object at 0x000002625A351310> │ │ │ └ <function serve at 0x000002625E64E660> │ │ └ <TyperCommand serve> │ └ <function Context.invoke at 0x000002625C393240> └ <click.core.Context object at 0x000002625A351310> File "D:\open_webui\.venv\Lib\site-packages\click\core.py", line 788, in invoke return __callback(*args, **kwargs) │ └ {'host': '0.0.0.0', 'port': 8080} └ () File "D:\open_webui\.venv\Lib\site-packages\typer\main.py", line 697, in wrapper return callback(**use_params) │ └ {'host': '0.0.0.0', 'port': 8080} └ <function serve at 0x000002625E4A7BA0> File "D:\open_webui\.venv\Lib\site-packages\open_webui\__init__.py", line 77, in serve uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*") │ │ │ │ │ │ └ 8080 │ │ │ │ │ └ '0.0.0.0' │ │ │ │ └ <fastapi.applications.FastAPI object at 0x000002627C4510D0> │ │ │ └ <module 'open_webui.main' from 'D:\\open_webui\\.venv\\Lib\\site-packages\\open_webui\\main.py'> │ │ └ <module 'open_webui' from 'D:\\open_webui\\.venv\\Lib\\site-packages\\open_webui\\__init__.py'> │ └ <function run at 0x000002625E4A7B00> └ <module 'uvicorn' from 'D:\\open_webui\\.venv\\Lib\\site-packages\\uvicorn\\__init__.py'> File "D:\open_webui\.venv\Lib\site-packages\uvicorn\main.py", line 579, in run server.run() │ └ <function Server.run at 0x000002625E4A7D80> └ <uvicorn.server.Server object at 0x0000026210E745F0> File "D:\open_webui\.venv\Lib\site-packages\uvicorn\server.py", line 66, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ None │ │ │ └ <function Server.serve at 0x000002625E4A7E20> │ │ └ <uvicorn.server.Server object at 0x0000026210E745F0> │ └ <function run at 0x000002625E2D7EC0> └ <module 'asyncio' from 'C:\\Program Files\\Python312\\Lib\\asyncio\\__init__.py'> File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) │ │ └ <coroutine object Server.serve at 0x000002625E607760> │ └ <function Runner.run at 0x000002625E40D1C0> └ <asyncio.runners.Runner object at 0x0000026210E115E0> File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at D:\open_webui\.venv\Lib\site-packages\uvicorn\server.py:70> wait_... │ │ └ <function BaseEventLoop.run_until_complete at 0x000002625E402DE0> │ └ <ProactorEventLoop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x0000026210E115E0> File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 674, in run_until_complete self.run_forever() │ └ <function ProactorEventLoop.run_forever at 0x000002625E447C40> └ <ProactorEventLoop running=True closed=False debug=False> File "C:\Program Files\Python312\Lib\asyncio\windows_events.py", line 322, in run_forever super().run_forever() File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 641, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x000002625E40CB80> └ <ProactorEventLoop running=True closed=False debug=False> File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 1987, in _run_once handle._run() │ └ <function Handle._run at 0x000002625E395080> └ <Handle Task.task_wakeup(<Future finished result=None>)> File "C:\Program Files\Python312\Lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) │ │ │ ��� │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle Task.task_wakeup(<Future finished result=None>)> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle Task.task_wakeup(<Future finished result=None>)> │ └ <member '_context' of 'Handle' objects> └ <Handle Task.task_wakeup(<Future finished result=None>)> File "D:\open_webui\.venv\Lib\site-packages\starlette\middleware\base.py", line 141, in coro await self.app(scope, receive_or_disconnect, send_no_error) │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x0000026212145080> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x0000026210EC89B0> └ <open_webui.main.RedirectMiddleware object at 0x000002620FAD4080> File "D:\open_webui\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x0000026212145080> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ │ │ └ <starlette.requests.Request object at 0x000002621233B7D0> │ │ └ <fastapi.routing.APIRouter object at 0x000002627C467AD0> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x0000026210EC89B0> └ <function wrap_app_handling_exceptions at 0x000002626101E160> File "D:\open_webui\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x0000026212144540> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... └ <fastapi.routing.APIRouter object at 0x000002627C467AD0> File "D:\open_webui\.venv\Lib\site-packages\starlette\routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x0000026212144540> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x000002627C467AD0>> └ <fastapi.routing.APIRouter object at 0x000002627C467AD0> File "D:\open_webui\.venv\Lib\site-packages\starlette\routing.py", line 735, in app await route.handle(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x0000026212144540> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <function Route.handle at 0x000002626101F600> └ APIRoute(path='/openai/verify', name='verify_connection', methods=['POST']) File "D:\open_webui\.venv\Lib\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x0000026212144540> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <function request_response.<locals>.app at 0x000002621091E980> └ APIRoute(path='/openai/verify', name='verify_connection', methods=['POST']) File "D:\open_webui\.venv\Lib\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x0000026212144540> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ │ └ <starlette.requests.Request object at 0x000002621233B200> │ └ <function request_response.<locals>.app.<locals>.app at 0x0000026212145BC0> └ <function wrap_app_handling_exceptions at 0x000002626101E160> File "D:\open_webui\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x00000262121380E0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x00000262121442C0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... └ <function request_response.<locals>.app.<locals>.app at 0x0000026212145BC0> File "D:\open_webui\.venv\Lib\site-packages\starlette\routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0x000002621233B200> └ <function get_request_handler.<locals>.app at 0x000002621091F880> File "D:\open_webui\.venv\Lib\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( └ <function run_endpoint_function at 0x000002626101DEE0> File "D:\open_webui\.venv\Lib\site-packages\fastapi\routing.py", line 212, in run_endpoint_function return await dependant.call(**values) │ │ └ {'user': UserModel(id='d2736cf4-8548-45b0-aea0-bc0d3fc411dc', name='志哥本机', email='1@qq.com', role='admin', profile_image_url=... │ └ <function verify_connection at 0x000002627A6DD080> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... > File "D:\open_webui\.venv\Lib\site-packages\open_webui\routers\openai.py", line 554, in verify_connection res = await r.json() │ └ <function ClientResponse.json at 0x000002625F537740> └ <ClientResponse(https://ark.cn-beijing.volces.com/api/v3/models) [404 Not Found]> <CIMultiDictProxy('x-request-id': '02174339... File "D:\open_webui\.venv\Lib\site-packages\aiohttp\client_reqrep.py", line 1281, in json raise ContentTypeError( └ <class 'aiohttp.client_exceptions.ContentTypeError'> aiohttp.client_exceptions.ContentTypeError: 404, message='Attempt to decode JSON with unexpected mimetype: ', url='https://ark.cn-beijing.volces.com/api/v3/models' 2025-03-31 11:28:05.557 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:58233 - "POST /openai/verify HTTP/1.1" 500 - {} ### Additional Information 使用python可以正常访问该接口: def get_json_from_api(api_key, endpoint_id): client = OpenAI( api_key="与所填密钥一致", base_url="https://ark.cn-beijing.volces.com/api/v3", ) completion = client.chat.completions.create( model="与所填模型id一致", max_tokens=12288, response_format={ 'type': 'json_object' }, messages=[ { "role": "system", "content": "内容" }, { "role": "user", "content": "提问内容" } ])
GiteaMirror added the bug label 2026-05-05 17:15:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55175