API
Embeddings
Turn text into vectors for search, clustering and retrieval.
res = client.embeddings.create(
model="openai/text-embedding-3-small",
input=["first document", "second document"],
)
vectors = [d.embedding for d in res.data]inputaccepts a string, an array of up to 2,048 strings, or token arrays.dimensionsis forwarded to models that support shortening.- Embeddings are billed on input tokens only.