OpenAI's advanced language model with superior reasoning, creativity, and complex task handling capabilities.
Cost-efficient embedding model with improved performance over ada-002, supporting up to 8191 tokens.
Specifications
Performance (7-day Average)
Pricing
Usage Statistics
Similar Models
GPT-4 snapshot from June 2023 with improved function calling support. Optimized for complex reasoning tasks.
Legacy embedding model generating 1536-dimensional vectors for semantic search and similarity tasks.
High-performance embedding model generating 3072-dimensional vectors for advanced semantic understanding.
Documentation
text-embedding-3-small
A highly efficient embedding model that provides excellent performance for most use cases at a fraction of the cost of larger models.
Key Features
- 1536 Dimensions: Default embedding size (adjustable)
- 8191 Max Tokens: Large input capacity
- Cost Effective: Lower price than text-embedding-3-large
- Fast: Optimized for high-throughput applications
API Usage
Note: This model uses the
/v1/embeddingsendpoint, not/v1/chat/completions.
from openai import OpenAI
client = OpenAI(
base_url="https://api.ohmygpt.com/v1",
api_key="your-api-key",
)
response = client.embeddings.create(
model="text-embedding-3-small",
input="The quick brown fox jumps over the lazy dog",
)
embedding = response.data[0].embedding
print(f"Embedding dimension: {len(embedding)}")Batch Embedding
You can embed multiple texts in a single request:
response = client.embeddings.create(
model="text-embedding-3-small",
input=[
"First document to embed",
"Second document to embed",
"Third document to embed",
],
)
for i, item in enumerate(response.data):
print(f"Document {i}: {len(item.embedding)} dimensions")Reducing Dimensions
You can request smaller embeddings to save storage:
response = client.embeddings.create(
model="text-embedding-3-small",
input="Hello world",
dimensions=512, # Reduce from 1536 to 512
)Use Cases
| Use Case | Description |
|---|---|
| Semantic Search | Find relevant documents based on meaning |
| Clustering | Group similar texts together |
| Classification | Categorize text by similarity to examples |
| RAG | Retrieval-Augmented Generation pipelines |