Embeddings model
Turn texts into vectors and search them by meaning.
assetfeed-embed-v1
Text embeddings
Our own embedding model. It turns a text into one vector, so you can search by meaning. Embed your documents once, embed each query with input_type “query”, and compare the vectors.
- Model ID
- assetfeed/assetfeed-embed-v1
- Endpoint
- POST /embeddings
- Limits
- 1 to 64 texts per request
- Output
- One vector per text, 1024 values by default; 512 or 256 on request
- Price
- 1 credit per 70,000 tokensOn the Free plan: 1 credit per 7,000 tokens
Use your AssetFeed API key. Get an API key
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | assetfeed/assetfeed-embed-v1 |
| input | string | string[] | Yes | One text, or 1 to 64 texts. |
| dimensions | integer | No | Length of each vector: 1024, 512 or 256. Default: 1024. |
| encoding_format | string | No | "float" (default) or "base64". |
| input_type | string | No | "query" for a search query, "document" for the texts you search in. Default: "document". This parameter is our addition to the OpenAI format. |
Dimensions: the vector is trained so that its first 256 or 512 values are a usable shorter vector (Matryoshka). A shorter vector takes less space and is faster to compare, with some loss in quality. Use the same dimensions for the queries and the documents.
Input type: embed your documents with input_type "document" and your search queries with "query". The OpenAI SDK has no such argument, so pass it with extra_body.
A failed request is refunded. The example response shows only 3 values of the vector.
Example request
curl -X POST "https://api.assetfeed.com/api/v1/models/embeddings" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "assetfeed/assetfeed-embed-v1",
"input": ["What is a stablecoin?"],
"dimensions": 512,
"input_type": "query"
}'Example response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0123,
-0.0456,
0.0789
]
}
],
"model": "assetfeed/assetfeed-embed-v1",
"usage": {
"prompt_tokens": 6,
"total_tokens": 6
}
}