[GH-ISSUE #2801] [DOCS]: /v1/openai/embeddings has incorrect example body #1796

Closed
opened 2026-02-22 18:26:34 -05:00 by yindo · 0 comments
Owner

Originally created by @scottybo on GitHub (Dec 11, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2801

Description

In the Swagger docs for the /v1/openai/embeddings it gives an example value for the input as:

{
  "input": [
    "This is my first string to embed",
    "This is my second string to embed"
  ],
  "model": null
}

However, the input should be plural inputs otherwise an error gets thrown. I.e.

{
  "inputs": [
    "This is my first string to embed",
    "This is my second string to embed"
  ],
  "model": "text-embedding-3-small"
}

In addition, it should be made clear that in order for this endpoint to work with the correct embedding engine (rather than the default NativeEmbedder), the environment variable EMBEDDING_ENGINE should be set (e.g. to openai) otherwise a 500 error gets thrown.

It would also be useful to give an example of the model, e.g. text-embedding-3-small.

Just for reference if anyone else comes across this issue, the options for the EMBEDDING_ENGINE are

  • openai
  • azure
  • localai
  • ollama
  • native
  • lmstudio
  • cohere
  • voyageai
  • litellm
  • mistral
  • generic-openai

And they can be seen in function getEmbeddingEngineSelection in server/utils/helpers/index.js

Originally created by @scottybo on GitHub (Dec 11, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2801 ### Description In the Swagger docs for the `/v1/openai/embeddings` it gives an example value for the input as: ```json { "input": [ "This is my first string to embed", "This is my second string to embed" ], "model": null } ``` However, the `input` should be plural `inputs` otherwise an error gets thrown. I.e. ```json { "inputs": [ "This is my first string to embed", "This is my second string to embed" ], "model": "text-embedding-3-small" } ``` In addition, it should be made clear that in order for this endpoint to work with the correct embedding engine (rather than the default NativeEmbedder), the environment variable `EMBEDDING_ENGINE` should be set (e.g. to `openai`) otherwise a 500 error gets thrown. It would also be useful to give an example of the model, e.g. `text-embedding-3-small`. Just for reference if anyone else comes across this issue, the options for the `EMBEDDING_ENGINE` are - openai - azure - localai - ollama - native - lmstudio - cohere - voyageai - litellm - mistral - generic-openai And they can be seen in `function getEmbeddingEngineSelection` in `server/utils/helpers/index.js`
yindo added the documentation label 2026-02-22 18:26:34 -05:00
yindo closed this issue 2026-02-22 18:26:34 -05:00
yindo changed title from [DOCS]: /v1/openai/embeddings has incorrect example body to [GH-ISSUE #2801] [DOCS]: /v1/openai/embeddings has incorrect example body 2026-06-05 14:42:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1796