Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

add docs for `/api/embeddings`

Jeffrey Morganbe889b2f8140
diff --git a/docs/api.md b/docs/api.md
index 355bfef40..9fec79a28 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -8,6 +8,7 @@
- [Copy a model](#copy-a-model)
- [Delete a model](#delete-a-model)
- [Pull a model](#pull-a-model)
+- [Generate embeddings](#generate-embeddings)
## Conventions
@@ -220,3 +221,36 @@ curl -X POST http://localhost:11434/api/pull -d '{
"total": 2142590208
}
```
+
+## Generate Embeddings
+
+```
+POST /api/embeddings
+```
+
+Generate embeddings from a model
+
+### Parameters
+
+- `model`: name of model to generate embeddings from
+- `prompt`: text to generate embeddings for
+
+### Request
+
+```
+curl -X POST http://localhost:11434/api/embeddings -d '{
+ "model": "llama2:7b",
+ "prompt": "Here is an article about llamas..."
+}'
+```
+
+### Response
+
+```json
+{
+ "embeddings": [
+ 0.5670403838157654, 0.009260174818336964, 0.23178744316101074, -0.2916173040866852, -0.8924556970596313,
+ 0.8785552978515625, -0.34576427936553955, 0.5742510557174683, -0.04222835972905159, -0.137906014919281
+ ]
+}
+```