Skip to Content
API ReferenceEmbeddings API

Embeddings API

Vector embedding generation and similarity search service for the Loop knowledge base.

Base URL: https://embeddings.loop.health/api/embeddings


Generate Embedding

Generate a vector embedding for a single text input.

curl -X POST "https://embeddings.loop.health/api/embeddings/generate" \ -H "Content-Type: application/json" \ -d '{ "text": "What are the benefits of BPC-157 for gut healing?" }'

Response:

{ "success": true, "data": { "id": "emb_abc123", "embedding": [0.0123, -0.0456, ...], "dimensions": 1536, "model": "text-embedding-3-small" } }

Batch Generate

Generate embeddings for up to 100 texts at once.

curl -X POST "https://embeddings.loop.health/api/embeddings/generate/batch" \ -H "Content-Type: application/json" \ -d '{ "texts": [ "BPC-157 benefits", "Ipamorelin dosing protocol", "TB-500 for tendon repair" ] }'

Limit: Maximum 100 texts per batch.


Find the most similar embeddings in the knowledge base.

curl -X POST "https://embeddings.loop.health/api/embeddings/search" \ -H "Content-Type: application/json" \ -d '{ "query": "How does BPC-157 help with gut healing?", "limit": 5 }'

Response:

{ "success": true, "data": [ { "id": "emb_xyz789", "content": "BPC-157 has shown significant promise in...", "similarity": 0.92, "source": "research_paper", "metadata": { "title": "BPC-157 Gastrointestinal Effects" } } ] }

Get Embedding

curl -X GET "https://embeddings.loop.health/api/embeddings/:id"

Delete Embedding

curl -X DELETE "https://embeddings.loop.health/api/embeddings/:id"

Stats

curl -X GET "https://embeddings.loop.health/api/embeddings/stats"

Returns cache hit rate and database statistics.


Health Check

curl -X GET "https://embeddings.loop.health/health"
{ "status": "ok" }