Embeddings
Embeddings
Creates an embedding vector representing the input text.
Endpoint
POST /v1/embeddingsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
input | string/array | Yes | Text to embed (string or array of strings) |
encoding_format | string | No | float (default) or base64 |
Example
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
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