Skip to main content
Chroma supports OpenAI’s embedding models out of the box, allowing you to use state-of-the-art embeddings for your vector search applications.

Installation

Python usage

Basic setup

Available models

Chroma supports all OpenAI embedding models:

Custom dimensions

API configuration

JavaScript usage

Configuration

string
required
Your OpenAI API key
string
default:"text-embedding-3-small"
OpenAI embedding model to use
int
Number of dimensions (text-embedding-3 models only)
string
Custom API endpoint URL
string
OpenAI organization ID

Cost optimization

Reduce costs: Use text-embedding-3-small with reduced dimensions (512 or 768) for most applications. This provides excellent quality at a fraction of the cost.

Azure OpenAI

Error handling

Best practices

Choose the right model

Use text-embedding-3-small for most use cases. Only use text-embedding-3-large if you need the highest quality.

Batch requests

Process documents in batches to avoid rate limits and improve throughput.

Cache embeddings

Store embeddings to avoid re-computing them for the same content.

Monitor costs

Track your API usage and consider using reduced dimensions to lower costs.

Resources

Keep your OpenAI API key secure. Never commit it to version control. Use environment variables or secure key management.