Create Embeddings
curl --request POST \
--url https://api.apiyi.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text-embedding-ada-002",
"input": "This is a sample text for embedding."
}
'{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292,
0.015797347
]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}API Reference
Create Embeddings
Online playground for the embeddings endpoint — enter your API Key to send requests and view responses. POST /v1/embeddings
POST
/
v1
/
embeddings
Create Embeddings
curl --request POST \
--url https://api.apiyi.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text-embedding-ada-002",
"input": "This is a sample text for embedding."
}
'{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292,
0.015797347
]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}Authorizations
API Key obtained from the APIYI Console
Body
application/json
Embedding model name
Examples:
"text-embedding-ada-002"
"text-embedding-3-small"
"text-embedding-3-large"
Text to embed. Can be a single string or an array of strings.
Example:
"This is a sample text for embedding."
Encoding format for the returned vectors
Available options:
float, base64 Was this page helpful?
⌘I