Skip to main content
POST
https://api.savegate.ai
/
v1
/
embeddings
Embeddings
curl --request POST \
  --url https://api.savegate.ai/v1/embeddings \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": {},
  "encoding_format": "<string>"
}
'
{
  "object": "<string>",
  "data": [
    {
      "object": "<string>",
      "embedding": [
        {}
      ],
      "index": 123
    }
  ],
  "model": "<string>",
  "usage": {}
}

Overview

Create embeddings for text inputs. Useful for semantic search, clustering, and RAG applications.

Request

Body Parameters

model
string
required
Embedding model ID (e.g., text-embedding-3-small, text-embedding-ada-002)
input
string or array
required
Text or array of texts to embed
encoding_format
string
default:"float"
Format for embeddings (float or base64)

Response

object
string
Object type (always list)
data
array
Array of embedding objects
model
string
Model used
usage
object
Token usage

Examples

from openai import OpenAI

client = OpenAI(
    api_key="sk-savegate-xxxxxxxxxxxxx",
    base_url="https://api.savegate.ai/v1"
)

response = client.embeddings.create(
    model="text-embedding-3-small",
    input="Your text here"
)

embedding = response.data[0].embedding
print(f"Embedding dimension: {len(embedding)}")

Batch Embeddings

# Embed multiple texts at once
texts = [
    "First document",
    "Second document",
    "Third document"
]

response = client.embeddings.create(
    model="text-embedding-3-small",
    input=texts
)

embeddings = [item.embedding for item in response.data]
print(f"Created {len(embeddings)} embeddings")

Supported Models

ModelDimensionDescription
text-embedding-3-small1536Latest, most efficient
text-embedding-3-large3072Highest quality
text-embedding-ada-0021536Previous generation

Use Cases

Semantic Search

Find relevant documents based on meaning

Clustering

Group similar texts together

RAG Applications

Retrieval-augmented generation

Recommendations

Content recommendation systems