openapi: 3.0.0 info: title: Portkey Analytics > Graphs Vector Stores API description: The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details. version: 2.0.0 termsOfService: https://portkey.ai/terms contact: name: Portkey Developer Forum url: https://portkey.wiki/community license: name: MIT url: https://github.com/Portkey-AI/portkey-openapi/blob/master/LICENSE servers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint security: - Portkey-Key: [] tags: - name: Vector Stores paths: /vector_stores: get: operationId: listVectorStores tags: - Vector Stores summary: Returns a list of vector stores. parameters: - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: order in: query description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. ' schema: type: string default: desc enum: - asc - desc - name: after in: query description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. ' schema: type: string - name: before in: query description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. ' schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListVectorStoresResponse' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_stores = client.beta.vector_stores.list()\nprint(vector_stores)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStores = await client.beta.vectorStores.list();\n console.log(vectorStores);\n}\n\nmain();\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n },\n {\n \"id\": \"vs_abc456\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ v2\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n }\n ],\n \"first_id\": \"vs_abc123\",\n \"last_id\": \"vs_abc456\",\n \"has_more\": false\n}\n" post: operationId: createVectorStore tags: - Vector Stores summary: Create a vector store. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateVectorStoreRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n -d '{\n \"name\": \"Support FAQ\"\n}'\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store = client.beta.vector_stores.create(\n name=\"Support FAQ\"\n)\nprint(vector_store)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStore = await client.beta.vectorStores.create({\n name: \"Support FAQ\"\n });\n console.log(vectorStore);\n}\n\nmain();\n" response: "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n" /vector_stores/{vector_store_id}: get: operationId: getVectorStore tags: - Vector Stores summary: Retrieves a vector store. parameters: - in: path name: vector_store_id required: true schema: type: string description: The ID of the vector store to retrieve. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store = client.beta.vector_stores.retrieve(\n vector_store_id=\"vs_abc123\"\n)\nprint(vector_store)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStore = await client.beta.vectorStores.retrieve(\n \"vs_abc123\"\n );\n console.log(vectorStore);\n}\n\nmain();\n" response: "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776\n}\n" post: operationId: modifyVectorStore tags: - Vector Stores summary: Modifies a vector store. parameters: - in: path name: vector_store_id required: true schema: type: string description: The ID of the vector store to modify. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateVectorStoreRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n -d '{\n \"name\": \"Support FAQ\"\n }'\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store = client.beta.vector_stores.update(\n vector_store_id=\"vs_abc123\",\n name=\"Support FAQ\"\n)\nprint(vector_store)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStore = await client.beta.vectorStores.update(\n \"vs_abc123\",\n {\n name: \"Support FAQ\"\n }\n );\n console.log(vectorStore);\n}\n\nmain();\n" response: "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n" delete: operationId: deleteVectorStore tags: - Vector Stores summary: Delete a vector store. parameters: - in: path name: vector_store_id required: true schema: type: string description: The ID of the vector store to delete. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteVectorStoreResponse' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\ndeleted_vector_store = client.beta.vector_stores.delete(\n vector_store_id=\"vs_abc123\"\n)\nprint(deleted_vector_store)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const deletedVectorStore = await client.beta.vectorStores.del(\n \"vs_abc123\"\n );\n console.log(deletedVectorStore);\n}\n\nmain();\n" response: "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store.deleted\",\n \"deleted\": true\n}\n" /vector_stores/{vector_store_id}/files: get: operationId: listVectorStoreFiles tags: - Vector Stores summary: Returns a list of vector store files. parameters: - name: vector_store_id in: path description: The ID of the vector store that the files belong to. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: order in: query description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. ' schema: type: string default: desc enum: - asc - desc - name: after in: query description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. ' schema: type: string - name: before in: query description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. ' schema: type: string - name: filter in: query description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. schema: type: string enum: - in_progress - completed - failed - cancelled responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListVectorStoreFilesResponse' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_files = client.beta.vector_stores.files.list(\n vector_store_id=\"vs_abc123\"\n)\nprint(vector_store_files)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStoreFiles = await client.beta.vectorStores.files.list(\n \"vs_abc123\"\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n" post: operationId: createVectorStoreFile tags: - Vector Stores summary: Create a vector store file by attaching a [File](https://platform.openai.com/docs/api-reference/files) to a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). parameters: - in: path name: vector_store_id required: true schema: type: string example: vs_abc123 description: 'The ID of the vector store for which to create a File. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateVectorStoreFileRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"file_id\": \"file-abc123\"\n }'\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_file = client.beta.vector_stores.files.create(\n vector_store_id=\"vs_abc123\",\n file_id=\"file-abc123\"\n)\nprint(vector_store_file)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const myVectorStoreFile = await client.beta.vectorStores.files.create(\n \"vs_abc123\",\n {\n file_id: \"file-abc123\"\n }\n );\n console.log(myVectorStoreFile);\n}\n\nmain();\n" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"usage_bytes\": 1234,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n" /vector_stores/{vector_store_id}/files/{file_id}: get: operationId: getVectorStoreFile tags: - Vector Stores summary: Retrieves a vector store file. parameters: - in: path name: vector_store_id required: true schema: type: string example: vs_abc123 description: The ID of the vector store that the file belongs to. - in: path name: file_id required: true schema: type: string example: file-abc123 description: The ID of the file being retrieved. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_file = client.beta.vector_stores.files.retrieve(\n vector_store_id=\"vs_abc123\",\n file_id=\"file-abc123\"\n)\nprint(vector_store_file)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStoreFile = await client.beta.vectorStores.files.retrieve(\n \"vs_abc123\",\n \"file-abc123\"\n );\n console.log(vectorStoreFile);\n}\n\nmain();\n" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n" delete: operationId: deleteVectorStoreFile tags: - Vector Stores summary: Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](https://platform.openai.com/docs/api-reference/files/delete) endpoint. parameters: - in: path name: vector_store_id required: true schema: type: string description: The ID of the vector store that the file belongs to. - in: path name: file_id required: true schema: type: string description: The ID of the file to delete. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteVectorStoreFileResponse' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\ndeleted_vector_store_file = client.beta.vector_stores.files.delete(\n vector_store_id=\"vs_abc123\",\n file_id=\"file-abc123\"\n)\nprint(deleted_vector_store_file)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const deletedVectorStoreFile = await client.beta.vectorStores.files.del(\n \"vs_abc123\",\n \"file-abc123\"\n );\n console.log(deletedVectorStoreFile);\n}\n\nmain();\n" response: "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file.deleted\",\n \"deleted\": true\n}\n" /vector_stores/{vector_store_id}/file_batches: post: operationId: createVectorStoreFileBatch tags: - Vector Stores summary: Create a vector store file batch. parameters: - in: path name: vector_store_id required: true schema: type: string example: vs_abc123 description: 'The ID of the vector store for which to create a File Batch. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateVectorStoreFileBatchRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/file_batches \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"file_ids\": [\"file-abc123\", \"file-abc456\"]\n }'\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_file_batch = client.beta.vector_stores.file_batches.create(\n vector_store_id=\"vs_abc123\",\n file_ids=[\"file-abc123\", \"file-abc456\"]\n)\nprint(vector_store_file_batch)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const myVectorStoreFileBatch = await client.beta.vectorStores.fileBatches.create(\n \"vs_abc123\",\n {\n file_ids: [\"file-abc123\", \"file-abc456\"]\n }\n );\n console.log(myVectorStoreFileBatch);\n}\n\nmain();\n" response: "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n" /vector_stores/{vector_store_id}/file_batches/{batch_id}: get: operationId: getVectorStoreFileBatch tags: - Vector Stores summary: Retrieves a vector store file batch. parameters: - in: path name: vector_store_id required: true schema: type: string example: vs_abc123 description: The ID of the vector store that the file batch belongs to. - in: path name: batch_id required: true schema: type: string example: vsfb_abc123 description: The ID of the file batch being retrieved. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123 \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_file_batch = client.beta.vector_stores.file_batches.retrieve(\n vector_store_id=\"vs_abc123\",\n batch_id=\"vsfb_abc123\"\n)\nprint(vector_store_file_batch)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStoreFileBatch = await client.beta.vectorStores.fileBatches.retrieve(\n \"vs_abc123\",\n \"vsfb_abc123\"\n );\n console.log(vectorStoreFileBatch);\n}\n\nmain();\n" response: "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n" /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: post: operationId: cancelVectorStoreFileBatch tags: - Vector Stores summary: Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. parameters: - in: path name: vector_store_id required: true schema: type: string description: The ID of the vector store that the file batch belongs to. - in: path name: batch_id required: true schema: type: string description: The ID of the file batch to cancel. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X POST\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\ndeleted_vector_store_file_batch = client.beta.vector_stores.file_batches.cancel(\n vector_store_id=\"vs_abc123\",\n file_batch_id=\"vsfb_abc123\"\n)\nprint(deleted_vector_store_file_batch)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const deletedVectorStoreFileBatch = await client.vector_stores.fileBatches.cancel(\n \"vs_abc123\",\n \"vsfb_abc123\"\n );\n console.log(deletedVectorStoreFileBatch);\n}\n\nmain();\n" response: "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"cancelling\",\n \"file_counts\": {\n \"in_progress\": 12,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 15,\n }\n}\n" /vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: operationId: listFilesInVectorStoreBatch tags: - Vector Stores summary: Returns a list of vector store files in a batch. parameters: - name: vector_store_id in: path description: The ID of the vector store that the files belong to. required: true schema: type: string - name: batch_id in: path description: The ID of the file batch that the files belong to. required: true schema: type: string - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - name: order in: query description: 'Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. ' schema: type: string default: desc enum: - asc - desc - name: after in: query description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. ' schema: type: string - name: before in: query description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. ' schema: type: string - name: filter in: query description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. schema: type: string enum: - in_progress - completed - failed - cancelled responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListVectorStoreFilesResponse' security: - Portkey-Key: [] Virtual-Key: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] - Portkey-Key: [] Config: [] - Portkey-Key: [] Provider-Auth: [] Provider-Name: [] Custom-Host: [] x-code-samples: - lang: curl source: "curl https://api.portkey.ai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n" - lang: python source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nvector_store_files = client.beta.vector_stores.file_batches.list_files(\n vector_store_id=\"vs_abc123\",\n batch_id=\"vsfb_abc123\"\n)\nprint(vector_store_files)\n" - lang: javascript source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const vectorStoreFiles = await client.beta.vectorStores.fileBatches.listFiles(\n \"vs_abc123\",\n \"vsfb_abc123\"\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n" components: schemas: VectorStoreObject: type: object title: Vector store description: A vector store is a collection of processed files can be used by the `file_search` tool. properties: id: description: The identifier, which can be referenced in API endpoints. type: string object: description: The object type, which is always `vector_store`. type: string enum: - vector_store created_at: description: The Unix timestamp (in seconds) for when the vector store was created. type: integer name: description: The name of the vector store. type: string usage_bytes: description: The total number of bytes used by the files in the vector store. type: integer file_counts: type: object properties: in_progress: description: The number of files that are currently being processed. type: integer completed: description: The number of files that have been successfully processed. type: integer failed: description: The number of files that have failed to process. type: integer cancelled: description: The number of files that were cancelled. type: integer total: description: The total number of files. type: integer required: - in_progress - completed - failed - cancelled - total status: description: The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. type: string enum: - expired - in_progress - completed expires_after: $ref: '#/components/schemas/VectorStoreExpirationAfter' expires_at: description: The Unix timestamp (in seconds) for when the vector store will expire. type: integer nullable: true last_active_at: description: The Unix timestamp (in seconds) for when the vector store was last active. type: integer nullable: true metadata: description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. ' type: object x-oaiTypeLabel: map nullable: true required: - id - object - usage_bytes - created_at - status - last_active_at - name - file_counts - metadata x-code-samples: name: The vector store object beta: true example: "{\n \"id\": \"vs_123\",\n \"object\": \"vector_store\",\n \"created_at\": 1698107661,\n \"usage_bytes\": 123456,\n \"last_active_at\": 1698107661,\n \"name\": \"my_vector_store\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"cancelled\": 0,\n \"failed\": 0,\n \"total\": 100\n },\n \"metadata\": {},\n \"last_used_at\": 1698107661\n}\n" DeleteVectorStoreFileResponse: type: object properties: id: type: string deleted: type: boolean object: type: string enum: - vector_store.file.deleted required: - id - object - deleted ListVectorStoresResponse: properties: object: type: string example: list data: type: array items: $ref: '#/components/schemas/VectorStoreObject' first_id: type: string example: vs_abc123 last_id: type: string example: vs_abc456 has_more: type: boolean example: false required: - object - data - first_id - last_id - has_more VectorStoreExpirationAfter: type: object title: Vector store expiration policy description: The expiration policy for a vector store. properties: anchor: description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.' type: string enum: - last_active_at days: description: The number of days after the anchor time that the vector store will expire. type: integer minimum: 1 maximum: 365 required: - anchor - days StaticChunkingStrategyRequestParam: type: object title: Static Chunking Strategy additionalProperties: false properties: type: type: string description: Always `static`. enum: - static static: $ref: '#/components/schemas/StaticChunkingStrategy' required: - type - static CreateVectorStoreFileRequest: type: object additionalProperties: false properties: file_id: description: A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. type: string chunking_strategy: $ref: '#/components/schemas/ChunkingStrategyRequestParam' required: - file_id UpdateVectorStoreRequest: type: object additionalProperties: false properties: name: description: The name of the vector store. type: string nullable: true expires_after: $ref: '#/components/schemas/VectorStoreExpirationAfter' nullable: true metadata: description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. ' type: object x-oaiTypeLabel: map nullable: true OtherChunkingStrategyResponseParam: type: object title: Other Chunking Strategy description: This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API. additionalProperties: false properties: type: type: string description: Always `other`. enum: - other required: - type CreateVectorStoreFileBatchRequest: type: object additionalProperties: false properties: file_ids: description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. type: array minItems: 1 maxItems: 500 items: type: string chunking_strategy: $ref: '#/components/schemas/ChunkingStrategyRequestParam' required: - file_ids VectorStoreFileObject: type: object title: Vector store files description: A list of files attached to a vector store. properties: id: description: The identifier, which can be referenced in API endpoints. type: string object: description: The object type, which is always `vector_store.file`. type: string enum: - vector_store.file usage_bytes: description: The total vector store usage in bytes. Note that this may be different from the original file size. type: integer created_at: description: The Unix timestamp (in seconds) for when the vector store file was created. type: integer vector_store_id: description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. type: string status: description: The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. type: string enum: - in_progress - completed - cancelled - failed last_error: type: object description: The last error associated with this vector store file. Will be `null` if there are no errors. nullable: true properties: code: type: string description: One of `server_error` or `rate_limit_exceeded`. enum: - internal_error - file_not_found - parsing_error - unhandled_mime_type message: type: string description: A human-readable description of the error. required: - code - message chunking_strategy: type: object description: The strategy used to chunk the file. oneOf: - $ref: '#/components/schemas/StaticChunkingStrategyResponseParam' - $ref: '#/components/schemas/OtherChunkingStrategyResponseParam' x-oaiExpandable: true required: - id - object - usage_bytes - created_at - vector_store_id - status - last_error x-code-samples: name: The vector store file object beta: true example: "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"static\": {\n \"max_chunk_size_tokens\": 800,\n \"chunk_overlap_tokens\": 400\n }\n }\n}\n" StaticChunkingStrategyResponseParam: type: object title: Static Chunking Strategy additionalProperties: false properties: type: type: string description: Always `static`. enum: - static static: $ref: '#/components/schemas/StaticChunkingStrategy' required: - type - static AutoChunkingStrategyRequestParam: type: object title: Auto Chunking Strategy description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. additionalProperties: false properties: type: type: string description: Always `auto`. enum: - auto required: - type CreateVectorStoreRequest: type: object additionalProperties: false properties: file_ids: description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. type: array maxItems: 500 items: type: string name: description: The name of the vector store. type: string expires_after: $ref: '#/components/schemas/VectorStoreExpirationAfter' chunking_strategy: type: object description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty. oneOf: - $ref: '#/components/schemas/AutoChunkingStrategyRequestParam' - $ref: '#/components/schemas/StaticChunkingStrategyRequestParam' x-oaiExpandable: true metadata: description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. ' type: object x-oaiTypeLabel: map nullable: true ChunkingStrategyRequestParam: type: object description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. oneOf: - $ref: '#/components/schemas/AutoChunkingStrategyRequestParam' - $ref: '#/components/schemas/StaticChunkingStrategyRequestParam' x-oaiExpandable: true ListVectorStoreFilesResponse: properties: object: type: string example: list data: type: array items: $ref: '#/components/schemas/VectorStoreFileObject' first_id: type: string example: file-abc123 last_id: type: string example: file-abc456 has_more: type: boolean example: false required: - object - data - first_id - last_id - has_more VectorStoreFileBatchObject: type: object title: Vector store file batch description: A batch of files attached to a vector store. properties: id: description: The identifier, which can be referenced in API endpoints. type: string object: description: The object type, which is always `vector_store.file_batch`. type: string enum: - vector_store.files_batch created_at: description: The Unix timestamp (in seconds) for when the vector store files batch was created. type: integer vector_store_id: description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. type: string status: description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. type: string enum: - in_progress - completed - cancelled - failed file_counts: type: object properties: in_progress: description: The number of files that are currently being processed. type: integer completed: description: The number of files that have been processed. type: integer failed: description: The number of files that have failed to process. type: integer cancelled: description: The number of files that where cancelled. type: integer total: description: The total number of files. type: integer required: - in_progress - completed - cancelled - failed - total required: - id - object - created_at - vector_store_id - status - file_counts x-code-samples: name: The vector store files batch object beta: true example: "{\n \"id\": \"vsfb_123\",\n \"object\": \"vector_store.files_batch\",\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 100\n }\n}\n" StaticChunkingStrategy: type: object additionalProperties: false properties: max_chunk_size_tokens: type: integer minimum: 100 maximum: 4096 description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. chunk_overlap_tokens: type: integer description: 'The number of tokens that overlap between chunks. The default value is `400`. Note that the overlap must not exceed half of `max_chunk_size_tokens`. ' required: - max_chunk_size_tokens - chunk_overlap_tokens DeleteVectorStoreResponse: type: object properties: id: type: string deleted: type: boolean object: type: string enum: - vector_store.deleted required: - id - object - deleted securitySchemes: Portkey-Key: type: apiKey in: header name: x-portkey-api-key Virtual-Key: type: apiKey in: header name: x-portkey-virtual-key Provider-Auth: type: http scheme: bearer Provider-Name: type: apiKey in: header name: x-portkey-provider Config: type: apiKey in: header name: x-portkey-config Custom-Host: type: apiKey in: header name: x-portkey-custom-host x-server-groups: ControlPlaneServers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_CONTROL_PLANE_URL description: Self-Hosted Control Plane URL DataPlaneServers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_GATEWAY_URL description: Self-Hosted Gateway URL PublicServers: - url: https://api.portkey.ai description: Portkey Public API (no auth required) x-mint: mcp: enabled: true name: Portkey MCP description: Official MCP Server for Portkey Docs & APIs x-code-samples: navigationGroups: - id: endpoints title: Endpoints - id: assistants title: Assistants - id: legacy title: Legacy groups: - id: audio title: Audio description: 'Learn how to turn audio into text or text into audio. Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text) ' navigationGroup: endpoints sections: - type: endpoint key: createSpeech path: createSpeech - type: endpoint key: createTranscription path: createTranscription - type: endpoint key: createTranslation path: createTranslation - type: object key: CreateTranscriptionResponseJson path: json-object - type: object key: CreateTranscriptionResponseVerboseJson path: verbose-json-object - id: chat title: Chat description: 'Given a list of messages comprising a conversation, the model will return a response. Related guide: [Chat Completions](https://platform.openai.com/docs/guides/text-generation) ' navigationGroup: endpoints sections: - type: endpoint key: createChatCompletion path: create - type: object key: CreateChatCompletionResponse path: object - type: object key: CreateChatCompletionStreamResponse path: streaming - id: realtime title: Realtime description: 'WebSocket proxy for provider Realtime APIs (`GET` upgrade). Use `wss://` with the same `/v1` data-plane base as other gateway routes. Related guide: [OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime) ' navigationGroup: endpoints sections: - type: endpoint key: connectRealtime path: connect - id: embeddings title: Embeddings description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. Related guide: [Embeddings](https://platform.openai.com/docs/guides/embeddings) ' navigationGroup: endpoints sections: - type: endpoint key: createEmbedding path: create - type: object key: Embedding path: object - id: rerank title: Rerank description: 'Rerank a list of documents based on their relevance to a query. Reranking improves search results by scoring documents based on semantic relevance rather than keyword matching. Supported providers: Cohere, Voyage, Jina, Pinecone, Bedrock, Azure AI. ' navigationGroup: endpoints sections: - type: endpoint key: createRerank path: create - type: object key: CreateRerankResponse path: object - id: fine-tuning title: Fine-tuning description: 'Manage fine-tuning jobs to tailor a model to your specific training data. Related guide: [Fine-tune models](https://platform.openai.com/docs/guides/fine-tuning) ' navigationGroup: endpoints sections: - type: endpoint key: createFineTuningJob path: create - type: endpoint key: listPaginatedFineTuningJobs path: list - type: endpoint key: listFineTuningEvents path: list-events - type: endpoint key: listFineTuningJobCheckpoints path: list-checkpoints - type: endpoint key: retrieveFineTuningJob path: retrieve - type: endpoint key: cancelFineTuningJob path: cancel - type: object key: FinetuneChatRequestInput path: chat-input - type: object key: FinetuneCompletionRequestInput path: completions-input - type: object key: FineTuningJob path: object - type: object key: FineTuningJobEvent path: event-object - type: object key: FineTuningJobCheckpoint path: checkpoint-object - id: batch title: Batch description: 'Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount. Related guide: [Batch](https://platform.openai.com/docs/guides/batch) ' navigationGroup: endpoints sections: - type: endpoint key: createBatch path: create - type: endpoint key: retrieveBatch path: retrieve - type: endpoint key: cancelBatch path: cancel - type: endpoint key: listBatches path: list - type: object key: Batch path: object - type: object key: BatchRequestInput path: request-input - type: object key: BatchRequestOutput path: request-output - id: files title: Files description: 'Files are used to upload documents that can be used with features like [Assistants](https://platform.openai.com/docs/api-reference/assistants), [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning), and [Batch API](https://platform.openai.com/docs/guides/batch). ' navigationGroup: endpoints sections: - type: endpoint key: createFile path: create - type: endpoint key: listFiles path: list - type: endpoint key: retrieveFile path: retrieve - type: endpoint key: deleteFile path: delete - type: endpoint key: downloadFile path: retrieve-contents - type: object key: OpenAIFile path: object - id: images title: Images description: 'Given a prompt and/or an input image, the model will generate a new image. Related guide: [Image generation](https://platform.openai.com/docs/guides/images) ' navigationGroup: endpoints sections: - type: endpoint key: createImage path: create - type: endpoint key: createImageEdit path: createEdit - type: endpoint key: createImageVariation path: createVariation - type: object key: Image path: object - id: models title: Models description: 'List and describe the various models available in the API. You can refer to the [Models](https://platform.openai.com/docs/models) documentation to understand what models are available and the differences between them. ' navigationGroup: endpoints sections: - type: endpoint key: listModels path: list - type: endpoint key: retrieveModel path: retrieve - type: endpoint key: deleteModel path: delete - type: object key: Model path: object - id: moderations title: Moderations description: 'Given some input text, outputs if the model classifies it as potentially harmful across several categories. Related guide: [Moderations](https://platform.openai.com/docs/guides/moderation) ' navigationGroup: endpoints sections: - type: endpoint key: createModeration path: create - type: object key: CreateModerationResponse path: object - id: assistants title: Assistants beta: true description: 'Build assistants that can call models and use tools to perform tasks. [Get started with the Assistants API](https://platform.openai.com/docs/assistants) ' navigationGroup: assistants sections: - type: endpoint key: createAssistant path: createAssistant - type: endpoint key: listAssistants path: listAssistants - type: endpoint key: getAssistant path: getAssistant - type: endpoint key: modifyAssistant path: modifyAssistant - type: endpoint key: deleteAssistant path: deleteAssistant - type: object key: AssistantObject path: object - id: threads title: Threads beta: true description: 'Create threads that assistants can interact with. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createThread path: createThread - type: endpoint key: getThread path: getThread - type: endpoint key: modifyThread path: modifyThread - type: endpoint key: deleteThread path: deleteThread - type: object key: ThreadObject path: object - id: messages title: Messages beta: true description: 'Create messages within threads Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createMessage path: createMessage - type: endpoint key: listMessages path: listMessages - type: endpoint key: getMessage path: getMessage - type: endpoint key: modifyMessage path: modifyMessage - type: endpoint key: deleteMessage path: deleteMessage - type: object key: MessageObject path: object - id: runs title: Runs beta: true description: 'Represents an execution run on a thread. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createRun path: createRun - type: endpoint key: createThreadAndRun path: createThreadAndRun - type: endpoint key: listRuns path: listRuns - type: endpoint key: getRun path: getRun - type: endpoint key: modifyRun path: modifyRun - type: endpoint key: submitToolOuputsToRun path: submitToolOutputs - type: endpoint key: cancelRun path: cancelRun - type: object key: RunObject path: object - id: run-steps title: Run Steps beta: true description: 'Represents the steps (model and tool calls) taken during the run. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: listRunSteps path: listRunSteps - type: endpoint key: getRunStep path: getRunStep - type: object key: RunStepObject path: step-object - id: vector-stores title: Vector Stores beta: true description: 'Vector stores are used to store files for use by the `file_search` tool. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStore path: create - type: endpoint key: listVectorStores path: list - type: endpoint key: getVectorStore path: retrieve - type: endpoint key: modifyVectorStore path: modify - type: endpoint key: deleteVectorStore path: delete - type: object key: VectorStoreObject path: object - id: vector-stores-files title: Vector Store Files beta: true description: 'Vector store files represent files inside a vector store. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStoreFile path: createFile - type: endpoint key: listVectorStoreFiles path: listFiles - type: endpoint key: getVectorStoreFile path: getFile - type: endpoint key: deleteVectorStoreFile path: deleteFile - type: object key: VectorStoreFileObject path: file-object - id: vector-stores-file-batches title: Vector Store File Batches beta: true description: 'Vector store file batches represent operations to add multiple files to a vector store. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStoreFileBatch path: createBatch - type: endpoint key: getVectorStoreFileBatch path: getBatch - type: endpoint key: cancelVectorStoreFileBatch path: cancelBatch - type: endpoint key: listFilesInVectorStoreBatch path: listBatchFiles - type: object key: VectorStoreFileBatchObject path: batch-object - id: assistants-streaming title: Streaming beta: true description: 'Stream the result of executing a Run or resuming a Run after submitting tool outputs. You can stream events from the [Create Thread and Run](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun), [Create Run](https://platform.openai.com/docs/api-reference/runs/createRun), and [Submit Tool Outputs](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoints by passing `"stream": true`. The response will be a [Server-Sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) stream. Our Node and Python SDKs provide helpful utilities to make streaming easy. Reference the [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview) to learn more. ' navigationGroup: assistants sections: - type: object key: MessageDeltaObject path: message-delta-object - type: object key: RunStepDeltaObject path: run-step-delta-object - type: object key: AssistantStreamEvent path: events - id: completions title: Completions legacy: true navigationGroup: legacy description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](https://platform.openai.com/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. ' sections: - type: endpoint key: createCompletion path: create - type: object key: CreateCompletionResponse path: object