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: eJzVWFlvGzkS/isFPo2BVktRnBlbb97EuzCQRYKMs8BAMiyqu6RmzCYZki1ZEPTfF0X2pSOJJ5uX9ZPFo46vvjqaO+b5yrHJlN3csYeE5egyK4wXWrEJe2uRe3TAFWC5wDwXagVrzLy2YNFYdKg8rfkCQShTefD47NOZmql/oQd+cpiTZNBL4LASa1TNrYJ7yLiCBQJyJ+QWMq1cVWIOiy2UPCuEQpDIrSJ9pc5Rkl05cLnSVviidClLmDZog467nE2Y0c4/tpY7ljCLXyt0/h8637LJ7sjd29bHjBwnS+vzYLjlJXq0JCTTyqPyJIAbI0UWzg6/OJKyYy4rsOT0n98aZBOmF18w87V2YTEnvIMLLGEBAILeWDLeC3TBMlGickIr1wmaMqE8rtCyhKlKSrq11Lbknk1o6/WYHUfwvkBQVblAS6B3QkPELLpKhvjpylMYOqjAFbqSORR8jSl8UHILrjJGW485CAVzivOgPT94PQ/BkNyjraND4SiFEmVVsslonzBUmabDj43NO6YVfliyybSFKri1T44jQ27EW+A1WPSVVcGFnsVCpfC2ppDwBVqYL6Xmfg7awnS+4A5/v5w//FZ4b9xkODRbI1JtV0NjNcVnaLbxzPAihXe45JX0jtQFKSxpTHTeCrVi5A95NmXNfrxNQfHCSzp6W3v8z+jw/mHfxPuEe3dt9pDK4FYCATHMgTvgEPWSM9xavqV4ev2EyqVwX9+AkuJpZJ2MhAldFGolsaFyAoa7kNKtmCjZnYqOP0lBm99l5Two7QGfM8Q8BKHkz00eB4MoVHGDiAC/Xb26Hve3jsnDcz4Yjcbzi4RqAAlfYKw5xm9r65KY7GpbmxjsWCCMR5dXfV5rCxKdS2F6+8xLguLj1hdaASHZBT/T+mmh9VOqDSou0kyXQ4wX3LDQm0evHzNdKf8Y7X7cCF88evEUfl4EN8J+qH4xDFR+jvlck4UYXa8E8ynvPZa93G5Pvu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dj074/Z62Icc1Sm1KVL42J4W3Wi3FqrII9GUC88GAJM7T0B4cZpUVfhv0cSMen5D+f6A9QuZT9wpy26HQf3IYnRuUwhzafsF2pbIhY7sQJ9ke1lTJQhDqpLL05VTi2Xx2RmSYQ3dEigwp4yY7RiWYRl/DswIH45QQ68bfw519wgjzKPhVep2OaYkCVXLVExYTHG778TqwateR7P/wRazmPVlB04tQofXY0PMiXads/apflEKDIE7S1m5HzxqfrdzvaflrhTZQKWFrbgV9LAViJaxAnlMIpjsW2MbeRtAG92QAHZdVmICOs5QmnHjjJsvQ+O+efejl3McPf97Ts0v9lkcIELX4hnoh37AJCw+CvnlEC2s7JrlaVaE4siiT/v4LVKRY4Q==
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: eJzVWFlvGzkS/isFPo2BVktRnBlbb97EuzCQRYKMs8BAMiyqu6RmzCYZki1ZEPTfF0X2pSOJJ5uX9ZPFo46vvjqaO+b5yrHJlN3csYeE5egyK4wXWrEJe2uRe3TAFWC5wDwXagVrzLy2YNFYdKg8rfkCQShTefD47NOZmql/oQd+cpiTZNBL4LASa1TNrYJ7yLiCBQJyJ+QWMq1cVWIOiy2UPCuEQpDIrSJ9pc5Rkl05cLnSVviidClLmDZog467nE2Y0c4/tpY7ljCLXyt0/h8637LJ7sjd29bHjBwnS+vzYLjlJXq0JCTTyqPyJIAbI0UWzg6/OJKyYy4rsOT0n98aZBOmF18w87V2YTEnvIMLLGEBAILeWDLeC3TBMlGickIr1wmaMqE8rtCyhKlKSrq11Lbknk1o6/WYHUfwvkBQVblAS6B3QkPELLpKhvjpylMYOqjAFbqSORR8jSl8UHILrjJGW485CAVzivOgPT94PQ/BkNyjraND4SiFEmV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1YmZx0iHNV9z/BPxbmC8L7RbX8FOFwuanHHQg1LA3EnZMnM14d5R9WfVIWzwId7EdSbvjWwawjw4wdlo7WaXL3VOyplbBCRZ8FkbJt3NO/0aXCHM1LPOxVlaMJSLfyD2EL8r8FyL7J3bNMD1sgVAwZfYg0I1U9xaXdPHq2XhirS9MML3RWey6bnyd5d3j6J7nTfWbUo15ApwY8ajihy4FZP6k3yPi+9h5oBwPSKaU+h5h8t1HFhnDUqZowM2JfU54p79uNrrb1S+BkOkpHo/Hr0e+X4zdvkgH9un49/mN8PY4/xldXl+PxePzQZvaICsAP21xLrqPYXh2DfrXfh9Z3Obo85WIceWgiX+pK5T/RzTq699BCa7Vlk+hFT3y05M25NnunPFrFJTi0a7QQRfxiez4rfDaYxU5wRh/oLKsspVgNWom+0M1LA0uY4b5gEzZcvxoePDtEIS4worIUOGook+FQ6ozLQjs/uRpdj074/Z62Icc1Sm1KVL42J4W3Wi3FqrII9GUC88GAJM7T0B4cZpUVfhv0cSMen5D+f6A9QuZT9wpy26HQf3IYnRuUwhzafsF2pbIhY7sQJ9ke1lTJQhDqpLL05VTi2Xx2RmSYQ3dEigwp4yY7RiWYRl/DswIH45QQ68bfw519wgjzKPhVep2OaYkCVXLVExYTHG778TqwateR7P/wRazmPVlB04tQofXY0PMiXads/apflEKDIE7S1m5HzxqfrdzvaflrhTZQKWFrbgV9LAViJaxAnlMIpjsW2MbeRtAG92QAHZdVmICOs5QmnHjjJsvQ+O+efejl3McPf97Ts0v9lkcIELX4hnoh37AJCw+CvnlEC2s7JrlaVaE4siiT/v4LVKRY4Q==
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