Skip to content

Embeddings

Embeddings

Creates an embedding vector representing the input text.

Endpoint

POST /v1/embeddings

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID
inputstring/arrayYesText to embed (string or array of strings)
encoding_formatstringNofloat (default) or base64

Example

Terminal window
curl -X POST https://cryptgpt.co/v1/embeddings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b",
"input": "The quick brown fox jumps over the lazy dog"
}'

Response

{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [0.0023064255, -0.009327292, ...],
"index": 0
}
],
"model": "gemma-4-26b",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}

Multiple Inputs

Terminal window
curl -X POST https://cryptgpt.co/v1/embeddings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b",
"input": ["Hello world", "Goodbye world"]
}'

Use Cases

  • Semantic search: Compare embedding similarity for document retrieval
  • Clustering: Group similar texts together
  • Classification: Use embeddings as features for ML models
  • Recommendation: Find similar items based on text descriptions