Create Embeddings
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
In: header
Header Parameters
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
The number of dimensions the resulting output embeddings should have.
The format to return the embeddings in.
A unique identifier for the end-user
Response Body
curl -X POST "https://loading/v1/embeddings" \
-H "OpenAI-Organization: 5eb7cf5a86d9755df3a6c593" \
-H "OpenAI-Project: 5eb7cf5a86d9755df3a6c593" \
-H "Content-Type: application/json" \
-d '{
"encoding_format": "float",
"input": "Hello, how are you?",
"model": "llama3"
}'{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
-0.009327292,
-0.0028842222
],
"index": 0,
"model": "llama3",
"usage": {
"prompt_tokens": 0,
"total_tokens": 0
}
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.