Skip to main content
POST
/
embeddings
Embeddings
curl --request POST \
  --url https://api.redpill.ai/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "input": "<string>",
  "encoding_format": "<string>",
  "dimensions": 123
}'

Create Embeddings

Generate vector embeddings for semantic search and similarity.
POST https://api.redpill.ai/v1/embeddings
Try it now! Click the “Try it” button above to test the API in the playground. You’ll need:
  1. Your API key (add it when prompted)
  2. The model field is pre-filled with text-embedding-3-small
  3. The input field is pre-filled with example text

Request Body

model
string
default:"text-embedding-3-small"
required
Model ID to use for embeddingsExamples: text-embedding-3-large, text-embedding-3-small, text-embedding-ada-002
input
string
default:"RedPill democratizes AI access"
required
Text to generate embeddings for. Can be a string or array of strings.Example: "What is RedPill AI?"
encoding_format
string
Format for embeddings: float (default) or base64
dimensions
integer
Number of dimensions for the output (only supported by some models)

Example

curl https://api.redpill.ai/v1/embeddings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "RedPill democratizes AI access"
  }'

Response

{
  "object": "list",
  "data": [{
    "object": "embedding",
    "index": 0,
    "embedding": [0.0023, -0.0015, 0.0042, ...]
  }],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Supported Models

ModelDimensionsMax TokensPrice
text-embedding-3-large30728191$0.00013/1K
text-embedding-3-small15368191$0.00002/1K
text-embedding-ada-00215368191$0.0001/1K

All Models

View all 50+ supported models →