From a342160803f4b9cbd85c2cdf411c265af224f385 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Tue, 28 Oct 2025 19:17:54 -0700 Subject: [PATCH] docs: fix root api documentation page (#12813) --- docs/api.md | 48 +++++++++++++++++++++++++++++++-- docs/{api/index.mdx => api.mdx} | 2 +- docs/docs.json | 2 +- 3 files changed, 48 insertions(+), 4 deletions(-) rename docs/{api/index.mdx => api.mdx} (98%) diff --git a/docs/api.md b/docs/api.md index ed39eeb7..1f1f2517 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,3 +1,47 @@ -# API Reference +--- +title: "Introduction" +--- -Ollama's API reference now lives here: https://docs.ollama.com/api +Ollama's API allows you to run and interact with models programatically. + +## Get started + +If you're just getting started, follow the [quickstart](/quickstart) documentation to get up and running with Ollama's API. + +## Base URL + +After installation, Ollama's API is served by default at: + +``` +http://localhost:11434/api +``` + +For running cloud models on **ollama.com**, the same API is available with the following base URL: + +``` +https://ollama.com/api +``` + +## Example request + +Once Ollama is running, its API is automatically available and can be accessed via `curl`: + +```shell +curl http://localhost:11434/api/generate -d '{ + "model": "gemma3", + "prompt": "Why is the sky blue?" +}' +``` + +## Libraries + +Ollama has official libraries for Python and JavaScript: + +- [Python](https://github.com/ollama/ollama-python) +- [JavaScript](https://github.com/ollama/ollama-js) + +Several community-maintained libraries are available for Ollama. For a full list, see the [Ollama GitHub repository](https://github.com/ollama/ollama?tab=readme-ov-file#libraries-1). + +## Versioning + +Ollama's API isn't strictly versioned, but the API is expected to be stable and backwards compatible. Deprecations are rare and will be announced in the [release notes](https://github.com/ollama/ollama/releases). diff --git a/docs/api/index.mdx b/docs/api.mdx similarity index 98% rename from docs/api/index.mdx rename to docs/api.mdx index bdda0a62..1f1f2517 100644 --- a/docs/api/index.mdx +++ b/docs/api.mdx @@ -44,4 +44,4 @@ Several community-maintained libraries are available for Ollama. For a full list ## Versioning -Ollama's API isn't strictly versioned, but the API is expected to be stable and backwards compatible. Deprecations are rare and will be announced in the [release notes](https://github.com/ollama/ollama/releases). \ No newline at end of file +Ollama's API isn't strictly versioned, but the API is expected to be stable and backwards compatible. Deprecations are rare and will be announced in the [release notes](https://github.com/ollama/ollama/releases). diff --git a/docs/docs.json b/docs/docs.json index 1c938cf8..52565da4 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -130,7 +130,7 @@ { "group": "API Reference", "pages": [ - "/api/index", + "/api", "/api/authentication", "/api/streaming", "/api/usage",