Dev.to AI 🤖 Ai 👁 2 📖 3 min read

We probed an OpenAI-compatible endpoint: what answers, what 404s, and why your agent feels broken

Most "my agent does not work with this endpoint" reports are really route-level facts. So I probed a live one and wrote down the raw responses. Endpoint: https://api.lbase.com (an independent gateway, not OpenAI or Anthr

Most "my agent does not work with this endpoint" reports are really route-level facts. So I probed a live one and wrote down the raw responses. Endpoint: https://api.lbase.com (an independent gateway, not OpenAI or Anthropic). Nothing below is paraphrased - these are the status codes and bodies the server returned.

The probe

# both of these hit /v1/models
curl -s -o /tmp/g -w "GET  %{http_code}\n" -H "Authorization: Bearer sk-invalid" \
  https://api.lbase.com/v1/models
curl -s -o /tmp/p -w "POST %{http_code}\n" -X POST -H "Authorization: Bearer sk-invalid" \
  -d '{}' https://api.lbase.com/v1/models

Output:

GET  /v1/models                401  {"code":"INVALID_API_KEY","message":"Invalid API key"}
POST /v1/models                404  404 page not found
GET  /v1/chat/completions      401  {"code":"INVALID_API_KEY","message":"Invalid API key"}
GET  /v1/responses             401  {"code":"INVALID_API_KEY","message":"Invalid API key"}
GET  /v1/messages              401  {"code":"INVALID_API_KEY","message":"Invalid API key"}
POST /v1/v1/chat/completions   404  404 page not found

Six lines, four lessons, one mistake I made myself.

1. The same plain-text 404 has two completely different causes

I first probed this endpoint with curl -d '{}', which sends POST. On /v1/models that produced:

404 page not found

I almost wrote "this gateway has no model discovery". It does - the route is GET. The same request with -X GET returned 401 with a JSON body, which proves the route exists and is behind auth.

That is the trap: a wrong method and a wrong path return the identical plain-text 404. If your client says "could not fetch models", check whether it is sending GET before you conclude the feature is missing.

2. A JSON 401 is the good outcome

/v1/chat/completions, /v1/responses and /v1/messages all answered:

{"code":"INVALID_API_KEY","message":"Invalid API key"}

with a deliberately wrong key, that is exactly right: the route exists, the auth layer sits in front of it, and the body is machine-readable. If /v1/messages returns a plain-text 404 instead, you are talking to a Chat-Completions-only gateway and no config will make Anthropic-format clients work.

3. Two 404s, two meanings

What you see What it means
404 page not found (plain text) path or method is wrong - doubled /v1, or POST on a GET route
401 {"code":"INVALID_API_KEY"} route exists, key does not
404 with a JSON body route exists, model name does not

If you cannot tell these apart you will edit the wrong file all evening.

4. Preflight, in ten seconds, with methods

BASE=https://api.lbase.com        # host only, no /v1 duplication
KEY=sk-your-key

# discovery is GET
curl -s -o /dev/null -w "models:%{http_code}\n" -H "Authorization: Bearer $KEY" "$BASE/v1/models"

# chat is POST
curl -s -o /dev/null -w "chat:%{http_code}\n" "$BASE/v1/chat/completions" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"model":"deepseek-flash","messages":[{"role":"user","content":"hi"}],"max_tokens":8}'

# anthropic format is POST, different header
curl -s -o /dev/null -w "messages:%{http_code}\n" "$BASE/v1/messages" \
  -H "x-api-key: $KEY" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" \
  -d '{"model":"deepseek-flash","max_tokens":8,"messages":[{"role":"user","content":"hi"}]}'

Three numbers tell you which layer is broken: discovery, OpenAI format, Anthropic format.

Why this is worth writing down

Every agent integration fails at one of four layers: the path, the method, the auth header, the request body shape. Three of those four are visible in a single curl call - if you know which status code belongs to which layer, and if you do not confuse "wrong verb" with "wrong route". I got that wrong once today; that is why this post exists.

The per-agent field list (nine tools, same three values) is at https://novaapi.lbase.com/agents.html - model names belong to their owners; the endpoint above is an independent gateway.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.