[GH-ISSUE #10016] 404 Page Not Found when trying to access /api/generate #6568

Closed
opened 2026-04-12 18:11:47 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Sunny-DCosta on GitHub (Mar 27, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10016

I am running Ollama version 0.6.2 on Windows 10. When I try to access the /api/generate endpoint using curl, I receive a 404 Page Not Found error. I have confirmed that Ollama is running and listening on port 11434, but the specific endpoint seems to be unavailable.

Steps taken:

  1. Started Ollama using the command: ollama start
  2. Confirmed Ollama is running by accessing the root endpoint: curl http://127.0.0.1:11434/
  3. Attempted to access /api/generate: curl http://127.0.0.1:11434/api/generate

Error message:
ERROR - [test2.py:383] - Processing error: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/generate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000190D9F4E350>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Any help would be appreciated.

Originally created by @Sunny-DCosta on GitHub (Mar 27, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10016 I am running Ollama version 0.6.2 on Windows 10. When I try to access the /api/generate endpoint using curl, I receive a 404 Page Not Found error. I have confirmed that Ollama is running and listening on port 11434, but the specific endpoint seems to be unavailable. Steps taken: 1. Started Ollama using the command: ollama start 2. Confirmed Ollama is running by accessing the root endpoint: curl http://127.0.0.1:11434/ 3. Attempted to access /api/generate: curl http://127.0.0.1:11434/api/generate Error message: ERROR - [test2.py:383] - Processing error: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/generate (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000190D9F4E350>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) Any help would be appreciated.
GiteaMirror added the needs more info label 2026-04-12 18:11:47 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 27, 2025):

A bare curl uses GET. /api/generate only accepts POST. Try curl -X POST http://127.0.0.1:11434/api/generate and you should get an error about a missing body.

<!-- gh-comment-id:2758725801 --> @rick-github commented on GitHub (Mar 27, 2025): A bare `curl` uses `GET`. `/api/generate` only accepts `POST`. Try `curl -X POST http://127.0.0.1:11434/api/generate` and you should get an error about a missing body.
Author
Owner

@pdevine commented on GitHub (Mar 27, 2025):

@Sunny-DCosta please try @rick-github 's curl command above. Can you post the code which you're trying to run in test2.py which is having the issue? Is it using ollama's python bindings?

<!-- gh-comment-id:2759720366 --> @pdevine commented on GitHub (Mar 27, 2025): @Sunny-DCosta please try @rick-github 's `curl` command above. Can you post the code which you're trying to run in `test2.py` which is having the issue? Is it using ollama's python bindings?
Author
Owner

@Sunny-DCosta commented on GitHub (Mar 28, 2025):

Well I do not know how but the problem has resolved, thank you for your aid @rick-github and @pdevine . Could I maybe reach out to you for other issues not related exactly to ollama? I am currently creating a RAG project and am in dire need of guidance. No AI is able to resolve my issues and guide me.

<!-- gh-comment-id:2760230299 --> @Sunny-DCosta commented on GitHub (Mar 28, 2025): Well I do not know how but the problem has resolved, thank you for your aid @rick-github and @pdevine . Could I maybe reach out to you for other issues not related exactly to ollama? I am currently creating a RAG project and am in dire need of guidance. No AI is able to resolve my issues and guide me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6568