Embeddings
Generate text embeddings through Runtoken.
Prerequisites#
Before you start, prepare:
- A platform API key created in the console.
- An embedding model ID from the catalogue.
- A server-side HTTP environment for submitting the text.
Endpoint and authentication#
Send JSON with your platform key in the Authorization header.
/v1/embeddingsThe complete URL is https://api.runtoken.net/v1/embeddings.
Send text#
Start with a single text input to check the model ID and authentication.
curl 'https://api.runtoken.net/v1/embeddings' \
-H 'Authorization: Bearer YOUR_PLATFORM_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "YOUR_MODEL_ID",
"input": "Hello!"
}'Replace these placeholders before running the example.
| Placeholder | Replace with |
|---|---|
YOUR_PLATFORM_KEY | Your platform API key from the console. |
YOUR_MODEL_ID | An embedding model ID from the catalogue. |
Set input to the text you want to embed.
Store and reuse vectors#
Record the model ID alongside the vectors in your application. Before switching models in an existing index, check the dimensions and compatibility of the new vectors with your retrieval system.
Use the selected model’s response fields to read the vectors, and check their dimensions and encoding before inserting them into an index.
Batch input and limits#
Do not assume that every model accepts the same batch size, input length or dimensions parameter. Confirm those values before building a batch ingestion job.
Usage#
The platform requests usage on each call. Check request usage and charges rather than estimating cost from the number of vectors alone. This page does not publish fixed prices; refer to the selected model's pricing information.
Next steps#
For shared authentication, routing and billing guidance, see the integration guide. For image endpoints, see Images.