The SambaNova Embeddings API generates vector representations (embeddings) of input text, facilitating tasks such as semantic similarity analysis, clustering, search optimization, and retrieval-augmented generation (RAG). This API enables developers to integrate advanced AI capabilities into their applications by transforming textual data into structured numerical representations.Documentation Index
Fetch the complete documentation index at: https://docs-preprod.sambanova.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
The API provides an endpoint to generate embedding vectors for input text.Request
For SambaStack, developers should check with their system administrator for the correct URL.
Request body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
input | String or array of strings | The input text to be embedded. Must not exceed the model’s token limit. | Yes |
model | String | The model used to generate embeddings (e.g., E5-Mistral-7B-Instruct). | Yes |
Example request
The following example demonstrates how to send a request to the SambaCloud Embeddings API using curl.CURL request
CURL request
Example response
Example response
Response properties
The API response consists of the following properties:| Property | Type | Description |
|---|---|---|
object | String | The type of response, always list. |
data | Array | A list of embedding objects. |
model | String | The name of the model used to generate embeddings. |
usage | Object | Token usage statistics for the request, including prompt_tokens. |
Embedding object
| Property | Type | Description |
|---|---|---|
object | String | Always embedding. |
embedding | Array | The embedding vector, represented as a list of floats. |
index | Integer | The index of the embedding in the list of embeddings. |
Error handling
See API error codes page for more information.| Error type | HTTP code | Description | Code |
|---|---|---|---|
| Invalid request error | 400 | An issue with the request parameters, e.g., model not compatible or input too long. | invalid_request_error |
| Authentication error | 401 | The provided API key is invalid. | invalid_authentication |
| Rate limit exceeded | 429 | Request quota exceeded. | insufficient_quota |
| Request timeout | 408 | The request timed out. | request_timeout |
Example error response
Example error response
