Skip to content

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
}
FieldTypeRequiredDescription
inputstring/arrayYesInput text or tokens to embed.
modelstringYesID of the model to use.
input_type.stringNoUse query for queries and document for documents being indexed
encoding_formatstringNoFormat of the embeddings (float or base64). Default: float.
dimensionsintegerNoNumber 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
  }
}
FieldTypeDescription
objectstringAlways "list".
modelstringThe model used to generate the embedding.
dataarrayList of embeddings generated.
usageobjectToken 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"
    }
  ]
}
FieldTypeDescription
idstringModel identifier.
objectstringAlways "model".
createdintegerUnix timestamp of model creation.
owned_bystringOrganization 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:

  1. Navigate to the Digital Marketplace.
  2. Go to the Documentation section.
  3. Select the plan associated with the Nemotron-3-Embed-8B-BF16 model.
  4. Locate the production URL provided in the plan details.
  5. Set up the environment variable API_URL to 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