ForHosting KIT · Semantic Search & RAG

Get text embeddings

A sentence means nothing to a database until it's a list of numbers a distance function can compare. This endpoint does that conversion on demand, so your own retrieval, clustering or recommendation logic has coordinates to work with instead of raw strings.

● StablePer request + per 1,000 tokens$0.002
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

Why raw text can't be searched by meaning

Keyword search matches characters, not intent, which is why a query for 'cancel my plan' misses a document that only says 'terminate subscription.' Embeddings fix that by placing text in a numeric space where nearby points mean similar things, regardless of the exact words chosen. search.embed is the step that gets a single piece of text into that space.

What happens when you call it

POST /search/embed with a string, get back a task_id, and receive the resulting vector by webhook or a signed 24-hour link once the job finishes. There's no model to host, no GPU to provision, and no library version to keep patched — you send text, you get coordinates back, and the infrastructure behind that stays entirely our problem.

A short history worth knowing

Vector representations of words go back to distributional semantics research from the 2000s and took off with word2vec in 2013, then moved from single words to full sentences and passages as transformer models matured. What used to require training a custom model is now a single API call, which is the whole point of exposing it this way rather than shipping a library.

One vector, many uses

A single embedding call is rarely the end goal — it's usually the first step before a similarity search, a clustering pass, or a classification model trained on top of the vectors. That's why the endpoint returns just the vector and a usage record, with no assumptions baked in about what you'll do with it next.

Where it fits in a real system

Teams building retrieval-augmented generation call this per query and per candidate chunk, comparing vectors to decide what context an LLM should see. Recommendation systems embed product descriptions once and reuse the vectors for months. Because pricing is per request plus per 1000 tokens with no subscription tier beyond an active balance, cost tracks usage exactly, whether you're embedding ten queries a day or ten thousand.

Query-time retrieval for RAG

An application embeds each incoming user question at request time and compares it against a pre-built vector index to pull the right context for an LLM.

Duplicate question detection

A support platform embeds new tickets and checks their vectors against recent ones to flag likely duplicates before an agent responds.

Lightweight semantic tagging

A content team embeds article titles to automatically cluster them into topics without hand-maintaining a taxonomy.

Custom recommendation scoring

An e-commerce team embeds product descriptions once and stores the vectors to power its own similarity ranking, separate from any of our indexing endpoints.

How do I generate a text embedding with the API?

Send your text to POST /search/embed, store the returned task_id, and retrieve the vector by webhook or a signed link valid for 24 hours.

Is the text embeddings API free?

No, there's no free tier or trial; it costs $0.002 per request plus $0.002 per 1000 tokens, and a failed task is never charged.

What can I use the resulting vectors for?

Semantic search, clustering, deduplication, recommendation scoring and RAG retrieval are the most common uses; the vector itself is generic and works with any downstream comparison logic.

How is this different from search.index_text?

This endpoint returns a raw vector for a single piece of text for you to store and query yourself; search.index_text chunks, embeds and stores content in a ready-to-query index on our side.

Is there a token limit per request?

Yes, check the endpoint reference for the current maximum; for longer documents, split the text or use the batch or indexing endpoints instead.

Can I embed non-English text?

Yes, the endpoint accepts text in multiple languages and returns a vector in the same shared embedding space regardless of source language.

Do I need to know how vector search works to use this?

No, you only need to store and compare the returned vectors with a distance metric like cosine similarity; the embedding logic itself is handled for you.

Is my text stored after embedding?

No, submitted text and results are deleted after the retention window and are never used for training.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/search/embed

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/search/embed \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"…"}'
{
  "text": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "search.embed",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002
Per 1,000 tokens$0.0015

Published price — no tokens, no invented credits. A failed task is never charged.

max_chunks10000
max_tokens20000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →