Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Diagnosing 404s from OpenAI-compatible API endpoints

AI summary

The tutorial recommends inspecting the fully constructed request URL before changing the model when an OpenAI-compatible API returns a 404. It shows how a duplicated /v1 path can produce the error, then uses terminal and curl commands to distinguish routing problems from model IDs, HTML error pages, and configuration-loading issues.

In-depth insight

Checking the final request path first can prevent developers from changing a valid model name while an incorrect API route remains the actual source of a 404.

exec-c8484b63-8ca3-4509-b90f-93d7f0ee02b2.png

假设配置文件里写着 API_BASE_URL=https://api.vsoui.com/v1,业务代码里写着 ${API_BASE_URL}/v1/chat/completions。分开看,两行都挺眼熟。拼在一起,问题就出来了:

https://api.vsoui.com/v1/v1/chat/completions

如果网关没有这条路由,请求就可能收到 404。这时候换模型名,只会带着新模型再走一遍同样的错路。

先把最终地址打印出来

如果服务商文档给的接口前缀已经以 /v1 结尾,手写 Chat Completions 请求时,只需要再拼上 /chat/completions。下面这两行可以直接在终端里跑,不需要 Key:

#OpenAI#维索 API#Chat Completions

Original · 2 min readRead the original
Group chat

No comments yet. Start the conversation.