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: eJzVWF1v2zgW/SsXnJcJIMuKk86mfst2sosAHbTopgsM7CChpWuLE4pkScqOYfi/Ly6pL9tpm+nOy+QpFsnLe88590PaMc9Xjk1n7PqW3SesQJdbYbzQik3ZO4vcowOuAKsFFoVQK1hj7rUFi8aiQ+XpmS8RhDK1B4/PPp2rufo3euAnmzlZBr0EDiuxRtWeKrmHnCtYICB3Qm4h18rVFRaw2ELF81IoBIncKrqv0gVK8qsALlfaCl9WLmUJ0wZtuOO2YFNmtPMPneeOJczilxqd/6cutmy6Owr3posxp8DJ02Y/GG55hR4tGcm18qg8GeDGSJGHveM/HFnZMZeXWHH6z28NsinTiz8w983twmJBeIcQWMICAAS9seS8F+iCZ6JC5YRWrjc0Y0J5XKFlCVO1lHRqqW3FPZvS0sWEHTN4VyKoulqgJdB7o4Exi66WgT9de6KhhwpcqWtZQMnXmMIHJbfgamO09ViAUPBIPI+6/aOLx0CG5B5tww7RUQklqrpi02yfMFS5ps0Prc87phV+WLLprIMqhLVPjpmhMOIp8Bos+tqqEMLAY6FSeNdISPgSLTwupeb+EbSF2eOCO/zl8vH+59J746bjsdkakWq7GhuriZ+x2cY94zNyvXHIeSvUipH3FMeMBZssYXEvUeCFl7T1ponvXzG8/f2+ZfdEabddrlA8IYgEAj5YAHfAId5LrnNr+ZbY8/oJlUvhrjkBFbFnZJN6hAAdFGolca4a5SZguAsZ3NmJpt2p7fiTbujSuaqdB6U94HOOWATMK/48V03eBpeImrhCxMPPV+dvJ8MlLuWgfkR1nCWU72R5gbG+GL9tXEtIS3PF1bZxMHixQJhkl1dDEWsLEp1LYXbzzCtC4uPWl1rNA5I91bnWTwutn1JtUHGR5roaYzzhxqXePHj9kOta+Yfo9cNG+PLBi6fw8ywEEdZDrYs0zNWtAl4UItQJrwMABu1ogAxIUQmfHAHQVi9US21zBE6IU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E/nxU+G8xjJ3jhPtB5XltKsQa0Cn2p268dLGGG+5JN2Xh9Pj749BGNuKCI2hJx1FCm47HUOZeldn56lb3NTvT9npahwDVKbSpUvnEnhXdaLcWqtgj0vgSPoxFZfExDe3CY11b4bbiPG/HwhPT/Pa0RMp/6LzE3PQrDzx7ZS4NSmEm79+q+VLZi7B7EqXaANVWyQEKTVJbe5yp8MZ+dETkW0G+RIkfKuOmOUQmmMdjwvMTRJCXE+lH4cGWfMMI8Gj5Pz8/TbFQr52nEp0WirOJqYDamOtwMmTvwb9fL7W/4fa7JAPKC5hihQhOyoftF4c7Y+nxYnkKrIHXS0m5Hn10+W7nf0+MvNdogqoStuRUBVZJYwkrkBZEx27GgO/Yugja6Iwdou6zDLHScrzTrxBPXeY7Gf3Pv/SD7Pn74zx19Fmq+LBICJDK+oa7IN2zKwudJ337SC892THK1qkOZZNEm/f0PMw6Mog==
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/).","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\nrequest, pass an array of strings or array of token arrays. The input must not exceed the max\ninput tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and\nany array must be 2048 dimensions or less. [Example Python\ncode](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\nIn addition to the per-input token limit, all embedding models enforce a maximum of 300,000\ntokens summed across all inputs in a single request.","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 [List models](https://platform.openai.com/docs/api-reference/models/list)\nAPI to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models)\nfor descriptions of them."},"user":{"type":["string","null"],"description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.\n[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#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: eJzVWF1v2zgW/SsXnJcJIMuKk86mfst2sosAHbTopgsM7CChpWuLE4pkScqOYfi/Ly6pL9tpm+nOy+QpFsnLe88590PaMc9Xjk1n7PqW3SesQJdbYbzQik3ZO4vcowOuAKsFFoVQK1hj7rUFi8aiQ+XpmS8RhDK1B4/PPp2rufo3euAnmzlZBr0EDiuxRtWeKrmHnCtYICB3Qm4h18rVFRaw2ELF81IoBIncKrqv0gVK8qsALlfaCl9WLmUJ0wZtuOO2YFNmtPMPneeOJczilxqd/6cutmy6Owr3posxp8DJ02Y/GG55hR4tGcm18qg8GeDGSJGHveM/HFnZMZeXWHH6z28NsinTiz8w983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K+oa7IN2zKwudJ337SC892THK1qkOZZNEm/f0PMw6Mog==
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/).","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\nrequest, pass an array of strings or array of token arrays. The input must not exceed the max\ninput tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and\nany array must be 2048 dimensions or less. [Example Python\ncode](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\nIn addition to the per-input token limit, all embedding models enforce a maximum of 300,000\ntokens summed across all inputs in a single request.","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 [List models](https://platform.openai.com/docs/api-reference/models/list)\nAPI to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models)\nfor descriptions of them."},"user":{"type":["string","null"],"description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.\n[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#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