Appearance
Nemotron-3-Embed-8B ​
The Text-2-Vector API allows you to generate vector embeddings for input text. These embeddings can be used for semantic similarity, information retrieval, and Retrieval-Augmented Generation (RAG) use cases.
The API is compatible with the OpenAI embeddings API and also provides an endpoint to list available models. The Nemotron-3-Embed-8B-BF16 model produces native 4096-dimensional embeddings.
Endpoints ​
1. Create Embedding ​
POST /v1/embeddings
Description ​
Generates a dense embedding vector for the supplied input text using nvidia/nemotron-3-embed-8b-bf16. The model supports a maximum sequence length of 32,768 tokens. Inputs exceeding this limit should be chunked or truncated before embedding
Request Body ​
json
{
"input": "The quick brown fox jumped over the lazy dog",
"model": "nvidia/nemotron-3-embed-8b-bf16",
"input_type": "query",
"encoding_format": "float",
"dimensions": 4096
}| Field | Type | Required | Description |
|---|---|---|---|
input | string/array | Yes | Input text or tokens to embed. |
model | string | Yes | ID of the model to use. |
input_type. | string | No | Use query for queries and document for documents being indexed |
encoding_format | string | No | Format of the embeddings (float or base64). Default: float. |
dimensions | integer | No | Number of dimensions for the output embeddings. |
Response ​
json
{
"object": "list",
"model": "nvidia/nemotron-3-embed-8b-bf16",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0.006587137468159199,
-0.013465482741594315,
0.012752742506563663,
-0.03218254819512367,
0.02331352047622204,
"..."
]
}
],
"usage": {
"prompt_tokens": 13,
"total_tokens": 13
}
}| Field | Type | Description |
|---|---|---|
object | string | Always "list". |
model | string | The model used to generate the embedding. |
data | array | List of embeddings generated. |
usage | object | Token usage details. |
2. List Models ​
GET /v1/models
Description ​
Lists all available models and their metadata.
Response ​
json
{
"object": "list",
"data": [
{
"id": "nvidia/nemotron-3-embed-8b-bf16",
"object": "model",
"created": 1686935002,
"owned_by": "Swiss AI Platform"
}
]
}| Field | Type | Description |
|---|---|---|
id | string | Model identifier. |
object | string | Always "model". |
created | integer | Unix timestamp of model creation. |
owned_by | string | Organization owning the model. |
Example Code Snippets ​
Note:
The production URL for this API is available in the corresponding plan for this model in the Digital Marketplace. To retrieve the URL:
- Navigate to the Digital Marketplace.
- Go to the Documentation section.
- Select the plan associated with the
Nemotron-3-Embed-8B-BF16model.- Locate the production URL provided in the plan details.
- Set up the environment variable
API_URLto the production URL retrieved.
1. Using curl ​
Create Embedding - Query ​
bash
curl -X POST $API_URL/v1/embeddings \
-H "Authorization: Bearer $DM_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nvidia/nemotron-3-embed-8b-bf16",
"input": "The quick brown fox jumped over the lazy dog",
"input_type": "query",
"encoding_format": "float"
}'Create Embedding - Document ​
For embedding content that will be stored in a vector database or used as a document in a retrieval workflow, use input_type: "document":
bash
curl -X POST $API_URL/v1/embeddings \
-H "Authorization: Bearer $DM_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nvidia/nemotron-3-embed-8b-bf16",
"input": "The quick brown fox jumped over the lazy dog",
"input_type": "document",
"encoding_format": "float"
}'List Models ​
bash
curl -X GET $API_URL/v1/models \
-H "Authorization: Bearer $YOUR_API_KEY"2. Using Python (OpenAI Client) ​
Create Embedding - Query ​
The API is OpenAI-compatible, so you can use the OpenAI Python client.
python
import os
import openai
client = openai.OpenAI(
api_key=os.getenv("YOUR_API_KEY"),
base_url=os.getenv("API_URL") + "/v1",
)
response = client.embeddings.create(
input="The quick brown fox jumped over the lazy dog",
model="nvidia/nemotron-3-embed-8b-bf16",
input_type="query",
encoding_format="float",
)
print(response)Create Embedding - Document ​
The API is OpenAI-compatible, so you can use the OpenAI Python client.
python
import os
import openai
client = openai.OpenAI(
api_key=os.getenv("YOUR_API_KEY"),
base_url=os.getenv("API_URL") + "/v1",
)
response = client.embeddings.create(
input="The quick brown fox jumped over the lazy dog",
model="nvidia/nemotron-3-embed-8b-bf16",
input_type="document",
encoding_format="float",
)
print(response)List Models ​
python
import os
import openai
client = openai.OpenAI(
api_key=os.getenv("YOUR_API_KEY"),
base_url=os.getenv("API_URL") + "/v1",
)
response = client.models.list()
print(response)Replace YOUR_API_KEY with your actual API key to authenticate the requests. You can follow the procedure in Inference Endpoints Overview
