When to use it
text-embedding-3-small is a compact dense text embedding model from OpenAI. Pinecone offers it for integrated embedding 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 | $0.02 per 1M tokens in `global`, $0.022 in us |
Quickstart
Installation
Integrated embedding on document indexes requires Python SDK10.1.0, Node.js SDK 9.1.0, or Go SDK 7.1.0 or later.pip install --upgrade pinecone
npm install @pinecone-database/pinecone
go get github.com/pinecone-io/go-pinecone/v7/pinecone
Create index
This creates a document index whosechunk_text field embeds with text-embedding-3-small at its default 1,536 dimensions.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")
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' });
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)
}
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.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."},
],
)
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.' },
],
});
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)
}
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 anembed clause, and Pinecone embeds the query text with the same model.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)
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);
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)
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"]
}'
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.
- Processing location:
global(default) orus. The Starter and Builder plans can use onlyglobal. See Processing locations. - Availability: Integrated embedding on document indexes only, on every plan.