Datattention

2026-02-19

Testing an OpenAI-compatible endpoint with curl

Models first, then one chat completion, with no API key.

Test in two calls. The first is GET /v1/models. A JSON object with a data array means the process is up and speaking the OpenAI list shape. The second is POST /v1/chat/completions with a model name and one user message.

Leave the Authorization header off when the server does not require one. Adding Bearer empty is unnecessary here. Set the content type to JSON. If you want a single JSON body rather than server-sent events, omit stream or set it to false.

Try the completions route only if the client you are about to use still posts prompts there. Chat clients do not. A 404 on a route you do not need is not a failed server.

On this host

Run the pair against port 8000 on this host. Port 8080 and port 4000 take the same two calls. No API key.

curl http://datattention.com:8000/v1/models
curl http://datattention.com:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

The full list of ports and paths is on the endpoints page.