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: eJzVWFlvG0cS/iuFfoqA4ZCm5azMN62jBAIc2PDKCwSkIDVnipyOerrHfZAiCP73RXXPRQ5tK968RE9iH3V89dUxvWeOry2bzdn1LbtPWI42M6JyQis2Y+8McocWuAIsl5jnQq1hg5nTBgxWBi0qR2uuQBCq8g4cPrt0oRbqN3TAB4c5SQa9Ag5rsUHV3Cq4g4wrWCIgt0LuINPK+hJzWO6g5FkhFIJEbhTpK3WOkuzKgcu1NsIVpU1ZwnSFJui4zdmMVdq6h9ZyyxJm8ItH6/6t8x2b7U/cvWl9zMhxsrQ+DxU3vESHhoRkWjlUjgTwqpIiC2fHf1qSsmc2K7Dk9J/bVchmTC//xMzV2oXBnPAOLrCEBQAI+sqQ8U6gDZaJEpUVWtlO0JwJ5XCNhiVMeSnp1kqbkjs2o63XU3YawbsCQflyiYZA74SGiBm0Xob4ae8oDB1UYAvtZQ4F32AKH5TcgfVVpY3DHISCR4rzqD0/ev0YgiG5Q1NHh8JRCiVKX7LZ5JAwVJmmww+NzXumFX5Ysdm8hSq4dUhOI0NuxFvgNBh03qjgQs9ioVJ4V1NIuAINPK6k5u4RtIH545Jb/Pny8f6nwrnKzsbjaleJVJv1uDKa4jOudvHM+CKFX3DFvXSW1AUpLGlMtM4ItWbkD3k2Z81+vE1BccJJOnpTe/xrdPhwf2jiPeDebZs9pDK4lUBADHPgFjhEveQMN4bvKJ5OP6GyKdzVN6CkeFayTkbChC4KtZbYUDmBituQ0q2YKNkORcefpKDN79JbB0o7wOcMMQ9BKPlzk8fBIApV3CAiwE9Xr95O+1un5OE5H00m08eLhGoACV9irDmV29XWJTHZ1a42MdixRJhOLq/6vNYGJFqbwvzmmZcExcedK7QCQrILfqb101Lrp1RXqLhIM12OMV6w40JvH5x+yLRX7iHa/bAVrnhw4in8vAhuhP1Q/WIYqPyc8rkmC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rGBEd5Q4KihzMZjqTMuC23d7GrydjLg93vahhw3KHVVonK1OSm802ol1t4g0JcJPI5GJPExDe3BYuaNcLugj1fi4Qnp/3vaI2Q+da8gN8Npqy2BDck6zKgiBTDr5DD0BVTi2by0lcgwh+6IFBlS5sz2jEopjbAVzwocTVPyvBtjj3cOCSPsouBX6WVcIsBLrnrCYqLCTR/3I6v2HVn+gS9bNX/JCppChAotxITeFWk3Z5tX/eISCj1xi7b2e3qe+Gzk4UDLXzyaQImEbbgR9NETCJKwAnlOIZjvWWANexdBG92RAXRc+jDJnGYbTSrxxnWWYeW+efa+lzsfP/znjp5P6jc5QoCoxbfU0/iWzVh42HPNY1hY2zPJ1dqHIseiTPr7H82WRas=
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: eJzVWFlvG0cS/iuFfoqA4ZCm5azMN62jBAIc2PDKCwSkIDVnipyOerrHfZAiCP73RXXPRQ5tK968RE9iH3V89dUxvWeOry2bzdn1LbtPWI42M6JyQis2Y+8McocWuAIsl5jnQq1hg5nTBgxWBi0qR2uuQBCq8g4cPrt0oRbqN3TAB4c5SQa9Ag5rsUHV3Cq4g4wrWCIgt0LuINPK+hJzWO6g5FkhFIJEbhTpK3WOkuzKgcu1NsIVpU1ZwnSFJui4zdmMVdq6h9ZyyxJm8ItH6/6t8x2b7U/cvWl9zMhxsrQ+DxU3vESHhoRkWjlUjgTwqpIiC2fHf1qSsmc2K7Dk9J/bVchmTC//xMzV2oXBnPAOLrCEBQAI+sqQ8U6gDZaJEpUVWtlO0JwJ5XCNhiVMeSnp1kqbkjs2o63XU3YawbsCQflyiYZA74SGiBm0Xob4ae8oDB1UYAvtZQ4F32AKH5TcgfVVpY3DHISCR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Yifwnzwzk77uaRi7P94GuRiDNav+A2rEwGHeJc1f1v8I+F+YLwflEtHyIcLjf1uAOhhqWBuHNyMOPVUf5u1Sdl8SzQwX4k5ZbvLCw6MizYcelonSZ3h2KHVsIaFX0WRMq2cU//QpcKczQv8bhXeUsTkG7lH8MW5H8NkEOTu2eZHrZAqBgy+hBpRqp6iku7efRsvaiMLqtmeKGz2nHZ/Bzk3fHpH+RO95lRj3oBnRrwqGFAlyOzflBvkPFt7T3QjgakIaU+h5h8s1HFhnDSqZowM2JfU54p79uNrrb1S+BsPkknk+nryc+X0zdvkhH9evt6+q/p22n8Mb26upxOp9P7NrMnVAC+2+Zacp3E9uoU9KvDIbS+y8nlkItx5KGJfKW9yn+gm3V076GFxmjDZtGLnvhoyZtzbfZWOTSKS7BoNmggivib7fms8LnCLHaCM/pAZ5k3lGI1aCW6QjcvDSxhFXcFm7Hx5tX46NkhCrGBEd5Q4KihzMZjqTMuC23d7GrydjLg93vahhw3KHVVonK1OSm802ol1t4g0JcJPI5GJPExDe3BYuaNcLugj1fi4Qnp/3vaI2Q+da8gN8Npqy2BDck6zKgiBTDr5DD0BVTi2by0lcgwh+6IFBlS5sz2jEopjbAVzwocTVPyvBtjj3cOCSPsouBX6WVcIsBLrnrCYqLCTR/3I6v2HVn+gS9bNX/JCppChAotxITeFWk3Z5tX/eISCj1xi7b2e3qe+Gzk4UDLXzyaQImEbbgR9NETCJKwAnlOIZjvWWANexdBG92RAXRc+jDJnGYbTSrxxnWWYeW+efa+lzsfP/znjp5P6jc5QoCoxbfU0/iWzVh42HPNY1hY2zPJ1dqHIseiTPr7H82WRas=
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