Now add the verification function and update ScanReport + scanEndpoint:
Now update scanEndpoint to run these chat probes and derive chatBase:
Now let's remove the unused old describeStatus/other issues and rebuild to check. Let's view the full file for sanity.
Good. Now let's add the raw-fetch chat runner and deriveSdkBase/transport type in chat.ts.
Now let's add deriveSdkBase export (using chatUrlToBase from probe.ts) and update ChatPanel to accept defaultUrl/overrideUrl and the edit UI.
Now let's update ChatPanel.tsx with the URL edit UI and the new curl signature.
Now let's update App.tsx: add chatUrlOverride state, compute defaultChatUrl, and rewire handleRun/handleBatch to use chatBase/raw fetch fallback.
Now add state and rewrite handleRun/handleBatch and the render section:
Now reset the override on a fresh scan, and add defaultChatUrl memo:
Now log the resolved chat route and rewrite handleRun/handleBatch:
Now the core fix — rewrite handleRun and handleBatch:
Now update the render section to pass the new props to ChatPanel:
Now let's also surface the resolved chat endpoint info in EndpointBar and show chat probes in ProbePanel. Let's check the current EndpointBar footer block:
Now update ProbePanel.tsx to display the dedicated chat-route probes:
Now let's build and fix remaining errors.
That's fine (it's read/write, used, harmless legacy ref — actually unused for logic now but doesn't break build). Let's verify the full App.tsx once more for correctness and clean up that dead ref.
This is fine as-is (leftover ref is harmless). Build succeeded. Let's do a final full read-through of the modified files to confirm consistency, then rebuild once more.
This all looks correct and consistent. Let's rebuild once more to be safe as a final confirmation.
Build is green. Here's exactly what was wrong and what I changed:
Root cause
The scanner resolved a single "working base" purely from whichever /models probe succeeded first — but /models and /chat/completions aren't always served from the same path on every gateway. So sometimes the bare domain answered /models (or looked "ok"), and that bare domain got reused for /chat/completions too — which many hosts only implement under /v1/. That's the "resolved with its domain only" bug.
Fixes shipped
1. Dedicated /chat/completions verification (src/lib/probe.ts)
- New
chatCompletionsCandidates() builds the real priority list: /v1/chat/completions first, always — then bare /chat/completions, /openai/v1/..., /api/v1/....
- New probe step sends a tiny fake-model POST to each candidate. A
404 means "wrong path"; anything else (400 bad model, 401/403, 422, 429, even 500) proves the route exists — that's how it distinguishes "not found" from "found but rejected."
ScanReport now carries chatBase (independent from workingBase used for model listing) and chatProbes for display.
2. Chat test now targets the verified chat route, not the models base — handleRun/handleBatch in App.tsx use report.chatBase (defaulting to /v1) instead of the models-derived base.
3. Editable endpoint, per your request (ChatPanel.tsx)
- A "Chat completions endpoint" bar sits above the prompt box, pre-filled with the auto-resolved
.../v1/chat/completions.
- ✎ edit button makes it a free-text field — change the path, drop
/v1, hit /v1/completions, or point at a totally different route.
- ↺ reset clears the override and reverts to auto-detection (also auto-clears on a fresh scan).
- Badge shows
auto · /v1 vs custom.
4. Custom paths still work end-to-end (chat.ts) — if the URL still ends in /chat/completions, it's routed through the OpenAI SDK (deriveSdkBase). If you edit it to something the SDK can't express, runChatTestAtUrl does a raw fetch with hand-rolled SSE parsing, so streaming still works.
5. Visibility — ProbePanel now shows a "Chat completions route check" table (✓ marks the winner, 404 = "wrong path" in red), and the endpoint bar shows both the resolved models base and chat endpoint side by side, so you can see exactly why a given host passed or failed.
Files built: src/lib/probe.ts, src/lib/chat.ts, src/components/ChatPanel.tsx, src/App.tsx, src/components/EndpointBar.tsx, src/components/ProbePanel.tsx