> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
> Use this file to discover all available pages before exploring further.

# text-embedding-3-small

> OpenAI's text-embedding-3-small is a compact, low-cost text embedding model that you can use for integrated embedding on Pinecone document indexes.

[Back to all models](https://docs.pinecone.io/models/overview.md)

![OpenAI](https://cdn.sanity.io/images/vr8gru94/production/8e6637d244b5c43daff9dfc12be07c8f2f4e9016-250x250.svg)

# text-embedding-3-small

OpenAI

Hosted by Pinecone

Specifications

<dl />

## When to use it

`text-embedding-3-small` is a compact dense text embedding model from OpenAI. Pinecone offers it for [integrated embedding](https://docs.pinecone.io/guides/search/integrated-embedding.md#embed-with-text-embedding-3) on document indexes, so you upsert and search with text and Pinecone embeds it through Microsoft Azure.

## Inputs, limits, and pricing

| Input | Limits | Price |
| - | - | - |
| Text | 8192 tokens per input, 96 inputs per request, 10,000 bytes per search query | $0.02 per 1M tokens in `global`, $0.022 in `us` |

Monthly and per-minute limits depend on your plan. See [Rate limits](https://docs.pinecone.io/reference/api/database-limits/rate-limits.md#monthly-usage-limits).

## Quickstart

### Installation

Integrated embedding on document indexes requires Python SDK `10.1.0`, Node.js SDK `9.1.0`, or Go SDK `7.1.0` or later.

```shell Python theme={null}
pip install --upgrade pinecone
```

```shell JavaScript theme={null}
npm install @pinecone-database/pinecone
```

```shell Go theme={null}
go get github.com/pinecone-io/go-pinecone/v7/pinecone
```

### Create index

This creates a document index whose `chunk_text` field embeds with `text-embedding-3-small` at its default 1,536 dimensions.

```python Python theme={null}
import time
from pinecone import Pinecone, SchemaBuilder

pc = Pinecone(api_key="YOUR_API_KEY")

schema = (
    SchemaBuilder()
      .add_string_field(
          name="chunk_text",
          embed={"model": "text-embedding-3-small"},
      )
      .build()
)
pc.indexes.create(name="text-embedding-3-small", schema=schema)

while not pc.indexes.describe(name="text-embedding-3-small").status.ready:
    time.sleep(2)

index = pc.index(name="text-embedding-3-small")
```

```javascript JavaScript theme={null}
import { Pinecone } from '@pinecone-database/pinecone';

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

const indexModel = await pc.indexes.create({
  name: 'text-embedding-3-small',
  schema: {
    fields: {
      chunk_text: {
        type: 'string',
        embed: { model: 'text-embedding-3-small' },
      },
    },
  },
  waitUntilReady: true,
});

const index = pc.index({ host: indexModel.host, namespace: 'example-namespace' });
```

```go Go theme={null}
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v7/pinecone"
)

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    model := "text-embedding-3-small"
    idx, err := pc.CreateIndex(ctx, &pinecone.CreateIndexRequest{
        Name: "text-embedding-3-small",
        Schema: pinecone.IndexSchema{
            Fields: map[string]pinecone.IndexSchemaField{
                "chunk_text": {
                    String: &pinecone.StringField{
                        Embed: &pinecone.EmbedConfig{Model: &model},
                    },
                },
            },
        },
    })
    if err != nil {
        log.Fatalf("Failed to create index: %v", err)
    }
    fmt.Printf("Successfully created index: %v", idx.Name)
}
```

```bash curl theme={null}
curl -X POST "https://api.pinecone.io/indexes" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -d '{
    "name": "text-embedding-3-small",
    "schema": {
      "fields": {
        "chunk_text": {
          "type": "string",
          "embed": { "model": "text-embedding-3-small" }
        }
      }
    }
  }'
```

### Embed & upsert

Upsert documents with plain text on the embedded field. Pinecone embeds each value on write, up to 96 documents per request.

```python Python theme={null}
index.documents.upsert(
    namespace="example-namespace",
    documents=[
        {"_id": "doc1", "chunk_text": "Apple is a popular fruit known for its sweetness and crisp texture."},
        {"_id": "doc2", "chunk_text": "The tech company Apple is known for its innovative products like the iPhone."},
        {"_id": "doc3", "chunk_text": "Many people enjoy eating apples as a healthy snack."},
        {"_id": "doc4", "chunk_text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
        {"_id": "doc5", "chunk_text": "An apple a day keeps the doctor away, as the saying goes."},
        {"_id": "doc6", "chunk_text": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."},
    ],
)
```

```javascript JavaScript theme={null}
await index.documents.upsert({
  documents: [
    { _id: 'doc1', chunk_text: 'Apple is a popular fruit known for its sweetness and crisp texture.' },
    { _id: 'doc2', chunk_text: 'The tech company Apple is known for its innovative products like the iPhone.' },
    { _id: 'doc3', chunk_text: 'Many people enjoy eating apples as a healthy snack.' },
    { _id: 'doc4', chunk_text: 'Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.' },
    { _id: 'doc5', chunk_text: 'An apple a day keeps the doctor away, as the saying goes.' },
    { _id: 'doc6', chunk_text: 'Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership.' },
  ],
});
```

```go Go theme={null}
idx, err := pc.DescribeIndex(ctx, "text-embedding-3-small")
if err != nil {
    log.Fatalf("Failed to describe index: %v", err)
}

idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: idx.Host, Namespace: "example-namespace"})
if err != nil {
    log.Fatalf("Failed to create IndexConnection: %v", err)
}

_, err = idxConnection.UpsertDocuments(ctx, &pinecone.UpsertDocumentsRequest{
    Documents: []pinecone.Document{
        {"_id": "doc1", "chunk_text": "Apple is a popular fruit known for its sweetness and crisp texture."},
        {"_id": "doc2", "chunk_text": "The tech company Apple is known for its innovative products like the iPhone."},
        {"_id": "doc3", "chunk_text": "Many people enjoy eating apples as a healthy snack."},
        {"_id": "doc4", "chunk_text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
        {"_id": "doc5", "chunk_text": "An apple a day keeps the doctor away, as the saying goes."},
        {"_id": "doc6", "chunk_text": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."},
    },
})
if err != nil {
    log.Fatalf("Failed to upsert documents: %v", err)
}
```

```bash curl theme={null}
curl -X POST "https://$INDEX_HOST/namespaces/example-namespace/documents/upsert" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -d '{
    "documents": [
      { "_id": "doc1", "chunk_text": "Apple is a popular fruit known for its sweetness and crisp texture." },
      { "_id": "doc2", "chunk_text": "The tech company Apple is known for its innovative products like the iPhone." },
      { "_id": "doc3", "chunk_text": "Many people enjoy eating apples as a healthy snack." },
      { "_id": "doc4", "chunk_text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces." },
      { "_id": "doc5", "chunk_text": "An apple a day keeps the doctor away, as the saying goes." },
      { "_id": "doc6", "chunk_text": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership." }
    ]
  }'
```

### Query

Search with an `embed` clause, and Pinecone embeds the query text with the same model.

```python Python theme={null}
response = index.documents.search(
    namespace="example-namespace",
    top_k=3,
    score_by=[
        {"type": "embed", "fields": ["chunk_text"], "query": "Tell me about the tech company known as Apple."}
    ],
    include_fields=["chunk_text"],
)

for match in response.matches:
    print(match._id, match._score, match.chunk_text)
```

```javascript JavaScript theme={null}
const response = await index.documents.search({
  topK: 3,
  scoreBy: [
    { type: 'embed', fields: ['chunk_text'], query: 'Tell me about the tech company known as Apple.' },
  ],
  includeFields: ['chunk_text'],
});

console.log(response);
```

```go Go theme={null}
query := "Tell me about the tech company known as Apple."
response, err := idxConnection.SearchDocuments(ctx, &pinecone.SearchDocumentsRequest{
    TopK: 3,
    ScoreBy: []pinecone.DocumentScoringMethod{
        {Type: pinecone.DocumentScoringTypeEmbed, Fields: []string{"chunk_text"}, Query: &query},
    },
    IncludeFields: []string{"chunk_text"},
})
if err != nil {
    log.Fatalf("Failed to search documents: %v", err)
}
fmt.Println(response)
```

```bash curl theme={null}
curl -X POST "https://$INDEX_HOST/namespaces/example-namespace/documents/search" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -d '{
    "top_k": 3,
    "score_by": [
      { "type": "embed", "fields": ["chunk_text"], "query": "Tell me about the tech company known as Apple." }
    ],
    "include_fields": ["chunk_text"]
  }'
```

## Parameters

Set these in the field's `write_parameters` and `read_parameters`. Set `dimension` and `processing_location` on the `embed` object itself, as `embed.dimension` and `embed.processing_location`. Putting either one in `write_parameters` or `read_parameters` returns a `400`.

| Parameter | Type | Required/Optional | Description | Default |
| :- | :- | :- | :- | :- |
| `truncate` | string | Optional | How to handle inputs longer than those supported by the model. Accepted values: `END` or `NONE`. `END` truncates the input sequence at the input token limit. `NONE` returns an error when the input exceeds the input token limit. | `END` |

## Good to know

* **Dimension**: 1,536 by default, or any integer from 1 to 1,536. The dimension is fixed when you create the index. Very low dimensions keep little of the text's meaning. At dimension 1, every `cosine` score is `1` or `-1`, so results fall into two tied groups regardless of the query. [OpenAI's benchmarks](https://openai.com/index/new-embedding-models-and-api-updates/) of shortened `text-embedding-3` embeddings go down to 256 dimensions, so treat a few hundred as a practical minimum.
* **Metric**: `cosine` by default, or `dotproduct` or `euclidean`.
* **Processing location**: `global` (default) or `us`. The Starter and Builder plans can use only `global`. See [Processing locations](https://docs.pinecone.io/guides/indexes/processing-locations.md).
* **Availability**: Integrated embedding on document indexes only, on every plan.
