1---
2id: post-embeddings
3title: "Create Embeddings"
4description: "Creates an embedding vector representing the input text."
5sidebar_label: "Create Embeddings"
6hide_title: true
7hide_table_of_contents: true
8api: eJzVWFlvG7sV/isHfLoGRiNFcVJHb26uWxhIkSB1ChSSYVMzxxrecEiGi2RB0H8vDjmbliRuel/qJ4vLWb7znWW4Y56vHJvN2fUtu89Yia6wwnihFZux9xa5RwdcAdZLLEuhVrDGwmsLFo1Fh8rTmq8QhDLBg8dnny/UQv0dPfCTw5wkg34CDiuxRtXeqriHgitYIiB3Qm6h0MqFGktYbqHmRSUUgkRuFemrdYmS7CqBy5W2wle1y1nGtEEbddyWbMaMdv6hs9yxjFn8FtD5v+pyy2a7I3dvOh8Lcpwsbc6D4ZbX6NGSkEIrj8qTAG6MFEU8O/7DkZQdc0WFNaf//NYgmzG9/AML32gXFkvCO7rAMhYBIOiNJeO9QBctEzUqJ7RyvaA5E8rjCi3LmApS0q0nbWvu2Yy2Xk/ZcQTvKgQV6iVaAr0XGiNm0QUZ46eDpzD0UIGrdJAlVHyNOXxUcgsuGKOtxxKEgkeK86g7P3r9GIMhuUfbRIfCUQsl6lCz2WSfMVSFpsMPrc07phV+fGKzeQdVdGufHUeG3Ei3wGuw6INV0YWBxULl8L6hkPAVWnh8kpr7R9AW5o9L7vDt5eP9b5X3xs3GY7M1Itd2NTZWU3zGZpvOjC9y+B2feJDekboohWWtic5boVaM/CHP5qzdT7cpKF54SUdvGo//lhze3+/beJ9w77bLHlIZ3cogIoYlcAcckl5yhlvLtxRPr7+icjncNTegpnga2SQjYUIXhVpJbKmcgeEupnQnJkl2p6LTT1LQ5XcdnAelPeBzgVjGINT8uc3jaBCFKm0QEeC3q1fvpsOtY/Lwko8mk+njRUY1gIQvMdUc47eNdVlKdrVtTIx2LBGmk8urIa+1BYnO5TC/eeY1QfFp6yutgJDsg19o/XWp9ddcG1Rc5IWux5guuHGlNw9ePxQ6KP+Q7H7YCF89ePE1/ryIbsT9WP1SGKj8HPO5IQsxulmJ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SEJcZERwVLgqKHMxmOpCy4r7fzsavJucsLvD7QNJa5RalOj8o05ObzX6kmsgkWgLxN4HI1I4mMe24PDIljht1EfN+LhK9L/97RHyHzuX0FuehSGTw6Tc4NSnEO7L9i+VLZk7BbSJDvAmipZDEKTVJa+nGo8m8/OiAJL6I9IUSBl3GzHqATT6Gt4UeFomhNi/fh7uLPPGGGeBL/K3+aTUVDO03xPexSxmquB1JTpcDMM3IF5u55t/4dPY00CkBU0xggVe5CNzS/xds7Wr4bVKXYKIidt7Xb0vvHFyv2elr8FtJFTGVtzKyKqxLCMVchLisV8xyLt2PsE2uiODKDjMsRR6DhdadRJN66LAo3/4dn7QfJ9+vjPO3p/aR71CAHiGN9QU+QbNmPxZdC3r2lxbcckV6sQqyRLMunvP1vXXGc=
9sidebar_class_name: "post api-method"
10info_path: docs/api/HTTP/runtime
11custom_edit_url: null
12proxy: http://localhost:8090
13---
14
15import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
16import ParamsDetails from "@theme/ParamsDetails";
17import RequestSchema from "@theme/RequestSchema";
18import StatusCodes from "@theme/StatusCodes";
19import OperationTabs from "@theme/OperationTabs";
20import TabItem from "@theme/TabItem";
21import Heading from "@theme/Heading";
22
23<Heading
24 as={"h1"}
25 className={"openapi__heading"}
26 children={"Create Embeddings"}
27>
28</Heading>
29
30<MethodEndpoint
31 method={"post"}
32 path={"/v1/embeddings"}
33 context={"endpoint"}
34>
35
36</MethodEndpoint>
37
38
39
40Creates an embedding vector representing the input text.
41
42Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
43
44<Heading
45 id={"request"}
46 as={"h2"}
47 className={"openapi-tabs__heading"}
48 children={"Request"}
49>
50</Heading>
51
52<ParamsDetails
53 parameters={undefined}
54>
55
56</ParamsDetails>
57
58<RequestSchema
59 title={"Body"}
60 body={{"description":"Embedding creation request parameters","content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"dimensions":{"type":["integer","null"],"format":"int32","description":"The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.","minimum":0},"encoding_format":{"oneOf":[{"type":"null"},{"description":"The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). Defaults to float","type":"string","enum":["float","base64"],"title":"EncodingFormat"}]},"input":{"description":"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 `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"integer","format":"int32","minimum":0}},{"type":"array","items":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}],"title":"EmbeddingInput"},"model":{"type":"string","description":"ID of the model to use. You can use the\n[List models](https://platform.openai.com/docs/api-reference/models/list)\nAPI to see all of your available models, or see our\n[Model overview](https://platform.openai.com/docs/models/overview)\nfor descriptions of them."},"user":{"type":["string","null"],"description":"A unique identifier representing your end-user, which will help OpenAI\n to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/usage-policies/end-user-ids)."}},"title":"CreateEmbeddingRequest"},"example":{"input":"The food was delicious and the waiter...","model":"text-embedding-ada-002","encoding_format":"float"}}},"required":true}}
61>
62
63</RequestSchema>
64
65<StatusCodes
66 id={undefined}
67 label={undefined}
68 responses={{"200":{"description":"Embedding created successfully","content":{"application/json":{"schema":{"type":"object","required":["object","model","data","usage"],"properties":{"data":{"type":"array","items":{"type":"object","description":"Represents an embedding vector returned by embedding endpoint.","required":["index","object","embedding"],"properties":{"embedding":{"description":"The embedding vector, which is a list of floats. The length of vector\ndepends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings).","oneOf":[{"type":"array","items":{"type":"number","format":"float"}},{"type":"string"}],"title":"EmbeddingVector"},"index":{"type":"integer","format":"int32","description":"The index of the embedding in the list of embeddings.","minimum":0},"object":{"type":"string","description":"The object type, which is always \"embedding\"."}},"title":"Embedding"},"description":"The list of embeddings generated by the model."},"model":{"type":"string","description":"The name of the model used to generate the embedding."},"object":{"type":"string"},"usage":{"description":"The usage information for the request.","type":"object","required":["prompt_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","format":"int32","description":"The number of tokens used by the prompt.","minimum":0},"total_tokens":{"type":"integer","format":"int32","description":"The total number of tokens used by the request.","minimum":0}},"title":"EmbeddingUsage"}},"title":"CreateEmbeddingResponse"},"example":{"object":"list","data":[{"object":"embedding","embedding":[0.0023064255,-0.009327292,-0.0028842222],"index":0}],"model":"text-embedding-ada-002","usage":{"prompt_tokens":8,"total_tokens":8}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"type":"string"},"example":{"error":"model not found"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"},"example":{"error":"Unexpected internal server error occurred"}}}}}}
69>
70
71</StatusCodes>
72
73
74
1---
2id: post-embeddings
3title: "Create Embeddings"
4description: "Creates an embedding vector representing the input text."
5sidebar_label: "Create Embeddings"
6hide_title: true
7hide_table_of_contents: true
8api: eJzVWFlvG7sV/isHfLoGRiNFcVJHb26uWxhIkSB1ChSSYVMzxxrecEiGi2RB0H8vDjmbliRuel/qJ4vLWb7znWW4Y56vHJvN2fUtu89Yia6wwnihFZux9xa5RwdcAdZLLEuhVrDGwmsLFo1Fh8rTmq8QhDLBg8dnny/UQv0dPfCTw5wkg34CDiuxRtXeqriHgitYIiB3Qm6h0MqFGktYbqHmRSUUgkRuFemrdYmS7CqBy5W2wle1y1nGtEEbddyWbMaMdv6hs9yxjFn8FtD5v+pyy2a7I3dvOh8Lcpwsbc6D4ZbX6NGSkEIrj8qTAG6MFEU8O/7DkZQdc0WFNaf//NYgmzG9/AML32gXFkvCO7rAMhYBIOiNJeO9QBctEzUqJ7RyvaA5E8rjCi3LmApS0q0nbWvu2Yy2Xk/ZcQTvKgQV6iVaAr0XGiNm0QUZ46eDpzD0U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WpZEtfIVraYLC1WiQVU60GpQcriLt9NkQ8vzXtMqiPIlzI/n3LifRy7O9oPvRSLNaMOC27IyO+kQ56ruv6J/LM4XhPeLavkpwvFyW497EBpYWoh7J09mvCbKP636pCydBTo4jKTc8K2DRU+GBTssHZ3T5O6p2FMrYYWKPgsSZbu45/9Fl4pzNK/xsFcFRxOQ7uQfwhblfw+QfZu7Z5ket0CoFDL6EGlHqmaKy/t59Gy9MFbXph1e6Kz2XLY/T/Lu8PQvcqf/zGhGvYhOA3jScEKXA7N+UW+U8WPtA9AOBqRTSn2JMflho0oN4ahTtWFmxL62PFPedxt9bRuWwNl8kk8m09eTt5fTN2+yEf1693r6l+m7afoxvbq6nE6n0/susydUAH7a5jpyHcX26hj0q/0+tr7LyeUpF9PIQxP5kw6q/IVu1tN9gBZaqy2bJS8G4pMlb8612Vvl0SouwaFdo4Uk4k+254vCZ4NF6gRn9IEuimApxRrQavSVbl8aWMYM9xWbsfH61fjg2SEJcZERwVLgqKHMxmOpCy4r7fzsavJucsLvD7QNJa5RalOj8o05ObzX6kmsgkWgLxN4HI1I4mMe24PDIljht1EfN+LhK9L/97RHyHzuX0FuehSGTw6Tc4NSnEO7L9i+VLZk7BbSJDvAmipZDEKTVJa+nGo8m8/OiAJL6I9IUSBl3GzHqATT6Gt4UeFomhNi/fh7uLPPGGGeBL/K3+aTUVDO03xPexSxmquB1JTpcDMM3IF5u55t/4dPY00CkBU0xggVe5CNzS/xds7Wr4bVKXYKIidt7Xb0vvHFyv2elr8FtJFTGVtzKyKqxLCMVchLisV8xyLt2PsE2uiODKDjMsRR6DhdadRJN66LAo3/4dn7QfJ9+vjPO3p/aR71CAHiGN9QU+QbNmPxZdC3r2lxbcckV6sQqyRLMunvP1vXXGc=
9sidebar_class_name: "post api-method"
10info_path: docs/api/HTTP/runtime
11custom_edit_url: null
12proxy: http://localhost:8090
13---
14
15import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
16import ParamsDetails from "@theme/ParamsDetails";
17import RequestSchema from "@theme/RequestSchema";
18import StatusCodes from "@theme/StatusCodes";
19import OperationTabs from "@theme/OperationTabs";
20import TabItem from "@theme/TabItem";
21import Heading from "@theme/Heading";
22
23<Heading
24 as={"h1"}
25 className={"openapi__heading"}
26 children={"Create Embeddings"}
27>
28</Heading>
29
30<MethodEndpoint
31 method={"post"}
32 path={"/v1/embeddings"}
33 context={"endpoint"}
34>
35
36</MethodEndpoint>
37
38
39
40Creates an embedding vector representing the input text.
41
42Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
43
44<Heading
45 id={"request"}
46 as={"h2"}
47 className={"openapi-tabs__heading"}
48 children={"Request"}
49>
50</Heading>
51
52<ParamsDetails
53 parameters={undefined}
54>
55
56</ParamsDetails>
57
58<RequestSchema
59 title={"Body"}
60 body={{"description":"Embedding creation request parameters","content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"dimensions":{"type":["integer","null"],"format":"int32","description":"The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.","minimum":0},"encoding_format":{"oneOf":[{"type":"null"},{"description":"The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). Defaults to float","type":"string","enum":["float","base64"],"title":"EncodingFormat"}]},"input":{"description":"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 `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"integer","format":"int32","minimum":0}},{"type":"array","items":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}],"title":"EmbeddingInput"},"model":{"type":"string","description":"ID of the model to use. You can use the\n[List models](https://platform.openai.com/docs/api-reference/models/list)\nAPI to see all of your available models, or see our\n[Model overview](https://platform.openai.com/docs/models/overview)\nfor descriptions of them."},"user":{"type":["string","null"],"description":"A unique identifier representing your end-user, which will help OpenAI\n to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/usage-policies/end-user-ids)."}},"title":"CreateEmbeddingRequest"},"example":{"input":"The food was delicious and the waiter...","model":"text-embedding-ada-002","encoding_format":"float"}}},"required":true}}
61>
62
63</RequestSchema>
64
65<StatusCodes
66 id={undefined}
67 label={undefined}
68 responses={{"200":{"description":"Embedding created successfully","content":{"application/json":{"schema":{"type":"object","required":["object","model","data","usage"],"properties":{"data":{"type":"array","items":{"type":"object","description":"Represents an embedding vector returned by embedding endpoint.","required":["index","object","embedding"],"properties":{"embedding":{"description":"The embedding vector, which is a list of floats. The length of vector\ndepends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings).","oneOf":[{"type":"array","items":{"type":"number","format":"float"}},{"type":"string"}],"title":"EmbeddingVector"},"index":{"type":"integer","format":"int32","description":"The index of the embedding in the list of embeddings.","minimum":0},"object":{"type":"string","description":"The object type, which is always \"embedding\"."}},"title":"Embedding"},"description":"The list of embeddings generated by the model."},"model":{"type":"string","description":"The name of the model used to generate the embedding."},"object":{"type":"string"},"usage":{"description":"The usage information for the request.","type":"object","required":["prompt_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","format":"int32","description":"The number of tokens used by the prompt.","minimum":0},"total_tokens":{"type":"integer","format":"int32","description":"The total number of tokens used by the request.","minimum":0}},"title":"EmbeddingUsage"}},"title":"CreateEmbeddingResponse"},"example":{"object":"list","data":[{"object":"embedding","embedding":[0.0023064255,-0.009327292,-0.0028842222],"index":0}],"model":"text-embedding-ada-002","usage":{"prompt_tokens":8,"total_tokens":8}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"type":"string"},"example":{"error":"model not found"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"string"},"example":{"error":"Unexpected internal server error occurred"}}}}}}
69>
70
71</StatusCodes>
72
73
74