[GH-ISSUE #5830] OpenAI endpoint gives 404 #29392

Closed
opened 2026-04-22 08:14:35 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @defaultsecurity on GitHub (Jul 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5830

What is the issue?

Otherwise Ollama is working. I'm not sure what to do.

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.2.7

Originally created by @defaultsecurity on GitHub (Jul 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5830 ### What is the issue? - http://localhost:11434/v1/chat/completions (gives 404) - http://localhost:11434 (shows ollama is running) Otherwise Ollama is working. I'm not sure what to do. ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.2.7
GiteaMirror added the bug label 2026-04-22 08:14:35 -05:00
Author
Owner

@rick-github commented on GitHub (Jul 21, 2024):

If you're using curl or wget to test the endpoint, be aware that by default these tools send a GET and /v1/chat/completions requires a POST.

$ curl -D - http://localhost:11434/v1/chat/completions
HTTP/1.1 404 Not Found
Content-Type: text/plain
Date: Sun, 21 Jul 2024 14:31:09 GMT
Content-Length: 18

404 page not found
$ curl -D - -X POST http://localhost:11434/v1/chat/completions
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Date: Sun, 21 Jul 2024 14:31:44 GMT
Content-Length: 83

{"error":{"message":"EOF","type":"invalid_request_error","param":null,"code":null}}

curl will automatically use POST when you supply data (-d, --data):

$ curl -D - http://localhost:11434/v1/chat/completions -d '{"model": "gemma2", "messages": [{"role": "user", "content": "hello"}], "stream": false}'
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 21 Jul 2024 14:36:54 GMT
Content-Length: 326

{"id":"chatcmpl-385","object":"chat.completion","created":1721572614,"model":"gemma2","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! 👋\n\nHow can I help you today? 😊"},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":13,"total_tokens":23}}
<!-- gh-comment-id:2241632971 --> @rick-github commented on GitHub (Jul 21, 2024): If you're using `curl` or `wget` to test the endpoint, be aware that by default these tools send a `GET` and /v1/chat/completions requires a `POST`. ``` $ curl -D - http://localhost:11434/v1/chat/completions HTTP/1.1 404 Not Found Content-Type: text/plain Date: Sun, 21 Jul 2024 14:31:09 GMT Content-Length: 18 404 page not found ``` ``` $ curl -D - -X POST http://localhost:11434/v1/chat/completions HTTP/1.1 400 Bad Request Content-Type: application/json; charset=utf-8 Date: Sun, 21 Jul 2024 14:31:44 GMT Content-Length: 83 {"error":{"message":"EOF","type":"invalid_request_error","param":null,"code":null}} ``` `curl` will automatically use `POST` when you supply data (-d, --data): ``` $ curl -D - http://localhost:11434/v1/chat/completions -d '{"model": "gemma2", "messages": [{"role": "user", "content": "hello"}], "stream": false}' HTTP/1.1 200 OK Content-Type: application/json Date: Sun, 21 Jul 2024 14:36:54 GMT Content-Length: 326 {"id":"chatcmpl-385","object":"chat.completion","created":1721572614,"model":"gemma2","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! 👋\n\nHow can I help you today? 😊"},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":13,"total_tokens":23}} ```
Author
Owner

@defaultsecurity commented on GitHub (Jul 22, 2024):

You're aboslutely right. Thank you for the information.

<!-- gh-comment-id:2242172241 --> @defaultsecurity commented on GitHub (Jul 22, 2024): You're aboslutely right. Thank you for the information.
Author
Owner

@gamersalpha commented on GitHub (Jan 30, 2026):

I'm experiencing the exact same issue on a fresh Ollama installation.

Environment:

  • OS: Debian Trixie (testing)
  • Ollama version: Latest (installed today via curl -fsSL https://ollama.com/install.sh | sh)
  • CPU-only setup (no GPU)
  • Ollama running as systemd service

What works:

curl http://127.0.0.1:11434/api/generate -d '{
  "model": "mistral:7b",
  "prompt": "Hello",
  "stream": false
}'
# ✅ Returns valid response in ~4.8 seconds

What doesn't work:

curl http://127.0.0.1:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistral:7b",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": false
  }'
# ❌ Hangs indefinitely, no response, no error

The native Ollama API (/api/generate) works perfectly, but the OpenAI-compatible endpoint (/v1/chat/completions) doesn't respond at all - it just hangs without returning any HTTP status code.

I tried using litellm as a proxy with --drop_params flag but that only revealed that the /v1 endpoint itself isn't responding to requests.

This makes Ollama incompatible with tools that require OpenAI-compatible APIs (like OpenClaw/Clawdbot).

Is the /v1 endpoint supposed to work out of the box, or does it require specific configuration?

<!-- gh-comment-id:3825613434 --> @gamersalpha commented on GitHub (Jan 30, 2026): I'm experiencing the exact same issue on a fresh Ollama installation. **Environment:** - OS: Debian Trixie (testing) - Ollama version: Latest (installed today via `curl -fsSL https://ollama.com/install.sh | sh`) - CPU-only setup (no GPU) - Ollama running as systemd service **What works:** ```bash curl http://127.0.0.1:11434/api/generate -d '{ "model": "mistral:7b", "prompt": "Hello", "stream": false }' # ✅ Returns valid response in ~4.8 seconds ``` **What doesn't work:** ```bash curl http://127.0.0.1:11434/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "mistral:7b", "messages": [{"role": "user", "content": "Hello"}], "stream": false }' # ❌ Hangs indefinitely, no response, no error ``` The native Ollama API (`/api/generate`) works perfectly, but the OpenAI-compatible endpoint (`/v1/chat/completions`) doesn't respond at all - it just hangs without returning any HTTP status code. I tried using litellm as a proxy with `--drop_params` flag but that only revealed that the `/v1` endpoint itself isn't responding to requests. This makes Ollama incompatible with tools that require OpenAI-compatible APIs (like OpenClaw/Clawdbot). Is the `/v1` endpoint supposed to work out of the box, or does it require specific configuration?
Author
Owner

@rick-github commented on GitHub (Jan 31, 2026):

It is not the exact same issue. Open a new issue.

<!-- gh-comment-id:3828551311 --> @rick-github commented on GitHub (Jan 31, 2026): It is not the exact same issue. Open a new issue.
Author
Owner

@carloslockward commented on GitHub (Feb 8, 2026):

@gamersalpha Did you find a solution?

<!-- gh-comment-id:3867969098 --> @carloslockward commented on GitHub (Feb 8, 2026): @gamersalpha Did you find a solution?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#29392