openapi: 3.0.0 info: title: Portkey Analytics > Graphs Api-Keys 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: Api-Keys description: Create, List, Retrieve, Update, and Delete your Portkey API keys. paths: /api-keys/{type}/{sub-type}: servers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_CONTROL_PLANE_URL description: Self-Hosted Control Plane URL post: tags: - Api-Keys summary: Create API Keys description: 'Creates a new API key. ' parameters: - name: type in: path schema: type: string enum: - organisation - workspace required: true - name: sub-type in: path schema: type: string enum: - user - service required: true requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateApiKeyObject' examples: create_basic: summary: Create a basic service API key value: name: API_KEY_NAME_0909 scopes: - completions.write create_with_rotation: summary: Create an API key with automatic monthly rotation value: name: Auto-rotating Key scopes: - completions.write rotation_policy: rotation_period: monthly key_transition_period_ms: 3600000 create_with_usage_limits: summary: Create an API key with usage limits and alert emails value: name: Budget-limited Key scopes: - completions.write usage_limits: type: cost credit_limit: 100 alert_threshold: 80 periodic_reset: monthly alert_emails: - admin@example.com responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: type: object properties: id: type: string format: uuid example: 183f497a-2a7f-4f47-992e-26213fa863we key: type: string example: abssofjosfjs object: type: string enum: - api-key example: api-key x-code-samples: - lang: python label: Default source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n)\n\n# Create a new API key\napi_key = portkey.api_keys.create(\n name=\"API_KEY_NAME_0909\",\n type=\"organisation\",\n sub_type=\"service\",\n workspace_id=\"WORKSPACE_ID\",\n scopes=[\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n)\n\nprint(api_key)\n" - lang: javascript label: Default source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n})\n\nconst apiKey=await portkey.apiKeys.create({\n name:\"API_KEY_NAME_0909\",\n type:\"organisation\",\n \"sub-type\":\"service\",\n workspace_id:\"WORKSPACE_ID\",\n \"scopes\": [\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n})\nconsole.log(apiKey);\n" - lang: curl label: Default source: "curl -X POST https://api.portkey.ai/v1/api-keys/organisation/service\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\":\"API_KEY_NAME_0909\",\n \"type\":\"organisation\",\n \"sub-type\":\"service\",\n \"workspace_id\":\"WORKSPACE_ID\",\n \"scopes\":[\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n }'\n" - lang: curl label: Self-Hosted source: "curl -X POST SELF_HOSTED_CONTROL_PLANE_URL/api-keys/organisation/service\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\":\"API_KEY_NAME_0909\",\n \"type\":\"organisation\",\n \"sub-type\":\"service\",\n \"workspace_id\":\"WORKSPACE_ID\",\n \"scopes\":[\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n }'\n" - lang: javascript label: Self-Hosted source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n baseUrl: \"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nconst apiKey = await portkey.admin.apiKeys.create({\n name: \"API_KEY_NAME_0909\",\n type: \"organisation\",\n subType: \"service\",\n workspaceId: \"WORKSPACE_ID\",\n scopes: [\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n})\nconsole.log(apiKey);\n" - lang: python label: Self-Hosted source: "from portkey import Portkey\n\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\napi_key = portkey.admin.api_keys.create(\n name=\"API_KEY_NAME_0909\",\n type=\"organisation\",\n sub_type=\"service\",\n workspace_id=\"WORKSPACE_ID\",\n scopes=[\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\"\n ]\n)\nprint(api_key)\n" - lang: python label: User API Key source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n)\n\n# Create a user API key (requires user_id)\napi_key = portkey.api_keys.create(\n name=\"User API Key\",\n type=\"workspace\",\n sub_type=\"user\",\n workspace_id=\"WORKSPACE_ID\",\n user_id=\"USER_ID\", # Required for user API keys\n scopes=[\n \"completions.write\",\n \"logs.view\"\n ]\n)\n\nprint(api_key)\n" - lang: javascript label: User API Key source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n})\n\nconst apiKey = await portkey.apiKeys.create({\n name: \"User API Key\",\n type: \"workspace\",\n \"sub-type\": \"user\",\n workspace_id: \"WORKSPACE_ID\",\n user_id: \"USER_ID\", // Required for user API keys\n \"scopes\": [\n \"completions.write\",\n \"logs.view\"\n ]\n})\nconsole.log(apiKey);\n" - lang: curl label: User API Key source: "curl -X POST https://api.portkey.ai/v1/api-keys/workspace/user\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\":\"User API Key\",\n \"type\":\"workspace\",\n \"sub-type\":\"user\",\n \"workspace_id\":\"WORKSPACE_ID\",\n \"user_id\":\"USER_ID\",\n \"scopes\":[\n \"completions.write\",\n \"logs.view\"\n ]\n }'\n" /api-keys: servers: - url: https://api.portkey.ai/v1 - url: https://SELF_HOSTED_CONTROL_PLANE_URL get: tags: - Api-Keys summary: Get All parameters: - name: page_size in: query schema: type: integer example: '1' - name: current_page in: query schema: type: integer example: '0' - name: workspace_id in: query schema: type: string example: ws-shared-123 responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: $ref: '#/components/schemas/ApiKeyObjectList' x-code-samples: - lang: python label: Default source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\"\n)\n\napi_keys = portkey.api_keys.list(\n workspace_id=\"WORKSPACE_SLUG\"\n)\n\nprint(api_keys)\n" - lang: javascript label: Default source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\"\n})\n\nconst apiKey=await portkey.apiKeys.list({\n workspaceId:\"WORKSPACE_SLUG\"\n})\n\nconsole.log(apiKey);\n" - lang: curl label: Default source: "curl -X GET \"https://api.portkey.ai/v1/api-keys?workspace_id=WORKSPACE_SLUG\"\n -H \"x-portkey-api-key: PORTKEY_API_KEY\"\n" - lang: curl label: Self-Hosted source: "curl -X GET \"SELF_HOSTED_CONTROL_PLANE_URL/api-keys?workspace_id=WORKSPACE_SLUG\"\n -H \"x-portkey-api-key: PORTKEY_API_KEY\"\n" - lang: python label: Self-Hosted source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\napi_keys = portkey.api_keys.list(\n workspace_id=\"WORKSPACE_SLUG\"\n)\n\nprint(api_keys)\n" - lang: javascript label: Self-Hosted source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n baseUrl: \"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nconst apiKey=await portkey.apiKeys.list({\n workspaceId:\"WORKSPACE_SLUG\"\n})\n\nconsole.log(apiKey);\n" /api-keys/{id}: servers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_CONTROL_PLANE_URL description: Self-Hosted Control Plane URL put: tags: - Api-Keys summary: Update API Keys description: 'Updates an existing API key. The API key type (user vs service) and associated user_id cannot be changed after creation. ' requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateApiKeyObject' examples: update_api_key: summary: Update key metadata and limits value: name: API_KEY_NAME_0909 rate_limits: - type: requests unit: rpm value: 100 reset_usage: summary: Reset accumulated usage for this key value: reset_usage: true set_rotation_policy: summary: Set automatic monthly rotation on an existing key value: rotation_policy: rotation_period: monthly key_transition_period_ms: 3600000 update_usage_limits: summary: Update usage limits and alert emails value: usage_limits: type: cost credit_limit: 100 alert_threshold: 80 periodic_reset: monthly alert_emails: - admin@example.com parameters: - name: id in: path schema: type: string format: uuid required: true responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: type: object example: {} x-code-samples: - lang: python label: Default source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n)\n\n# Update the API key\nupdated_api_key = portkey.api_keys.update(\n id=\"API_KEY_ID\",\n name=\"API_KEY_NAME_0909\",\n rate_limits=[\n {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }\n ],\n scopes=[\n \"organisation_users.create\", \"organisation_users.read\", \"organisation_users.update\",\n \"organisation_users.delete\", \"organisation_users.list\",\n \"organisation_service_api_keys.create\", \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\", \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\", \"workspaces.delete\", \"workspaces.create\",\n \"workspaces.read\", \"workspaces.update\", \"workspaces.list\", \"logs.export\",\n \"logs.list\", \"logs.view\", \"configs.create\", \"configs.update\", \"configs.delete\",\n \"configs.read\", \"configs.list\", \"virtual_keys.create\", \"virtual_keys.update\",\n \"virtual_keys.delete\", \"virtual_keys.duplicate\", \"virtual_keys.read\",\n \"virtual_keys.list\", \"virtual_keys.copy\", \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\", \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\", \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\", \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\", \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\", \"workspace_users.create\", \"workspace_users.read\",\n \"workspace_users.update\", \"workspace_users.delete\", \"workspace_users.list\",\n \"analytics.view\"\n ]\n)\n\nprint(updated_api_key)\n" - lang: javascript label: Default source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n})\n\nconst apiKey=await portkey.apiKeys.update({\n id:\"API_KEY_ID\",\n name:\"API_KEY_NAME_0909\",\n rate_limits:[ {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }],\n \"scopes\": [\n \"organisation_users.create\",\n \"organisation_users.read\",\n \"organisation_users.update\",\n \"organisation_users.delete\",\n \"organisation_users.list\",\n \"organisation_service_api_keys.create\",\n \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\",\n \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\",\n \"workspaces.delete\",\n \"workspaces.create\",\n \"workspaces.read\",\n \"workspaces.update\",\n \"workspaces.list\",\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.duplicate\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\",\n \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\",\n \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\",\n \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\",\n \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\",\n \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\",\n \"workspace_users.create\",\n \"workspace_users.read\",\n \"workspace_users.update\",\n \"workspace_users.delete\",\n \"workspace_users.list\",\n \"analytics.view\"\n ],\n\n})\nconsole.log(apiKey);\n" - lang: curl label: Default source: "curl -X PUT \"https://api.portkey.ai/v1/api-keys/{id}\" \\\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\":\"API_KEY_NAME_0909\",\n \"rate_limits\":[\n {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }\n ],\n \"scopes\": [\n \"organisation_users.create\",\n \"organisation_users.read\",\n \"organisation_users.update\",\n \"organisation_users.delete\",\n \"organisation_users.list\",\n \"organisation_service_api_keys.create\",\n \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\",\n \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\",\n \"workspaces.delete\",\n \"workspaces.create\",\n \"workspaces.read\",\n \"workspaces.update\",\n \"workspaces.list\",\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.duplicate\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\",\n \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\",\n \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\",\n \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\",\n \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\",\n \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\",\n \"workspace_users.create\",\n \"workspace_users.read\",\n \"workspace_users.update\",\n \"workspace_users.delete\",\n \"workspace_users.list\",\n \"analytics.view\"\n ]\n}'\n" - lang: curl label: Self-Hosted source: "curl -X PUT \"SELF_HOSTED_CONTROL_PLANE_URL/api-keys/{id}\" \\\n-H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"name\":\"API_KEY_NAME_0909\",\n \"rate_limits\":[\n {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }\n ],\n \"scopes\":[\n \"organisation_users.create\",\n \"organisation_users.read\",\n \"organisation_users.update\",\n \"organisation_users.delete\",\n \"organisation_users.list\",\n \"organisation_service_api_keys.create\",\n \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\",\n \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\",\n \"workspaces.delete\",\n \"workspaces.create\",\n \"workspaces.read\",\n \"workspaces.update\",\n \"workspaces.list\",\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.duplicate\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\",\n \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\",\n \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\",\n \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\",\n \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\",\n \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\",\n \"workspace_users.create\",\n \"workspace_users.read\",\n \"workspace_users.update\",\n \"workspace_users.delete\",\n \"workspace_users.list\",\n \"analytics.view\"\n ]\n}'\n" - lang: python label: Self-Hosted source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\n# Update the API key\nupdated_api_key = portkey.api_keys.update(\n id=\"API_KEY_ID\",\n name=\"API_KEY_NAME_0909\",\n rate_limits=[\n {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }\n ],\n scopes=[\n \"organisation_users.create\", \"organisation_users.read\", \"organisation_users.update\",\n \"organisation_users.delete\", \"organisation_users.list\",\n \"organisation_service_api_keys.create\", \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\", \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\", \"workspaces.delete\", \"workspaces.create\",\n \"workspaces.read\", \"workspaces.update\", \"workspaces.list\", \"logs.export\",\n \"logs.list\", \"logs.view\", \"configs.create\", \"configs.update\", \"configs.delete\",\n \"configs.read\", \"configs.list\", \"virtual_keys.create\", \"virtual_keys.update\",\n \"virtual_keys.delete\", \"virtual_keys.duplicate\", \"virtual_keys.read\",\n \"virtual_keys.list\", \"virtual_keys.copy\", \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\", \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\", \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\", \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\", \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\", \"workspace_users.create\", \"workspace_users.read\",\n \"workspace_users.update\", \"workspace_users.delete\", \"workspace_users.list\",\n \"analytics.view\"\n ]\n)\n\nprint(updated_api_key)\n" - lang: javascript label: Self-Hosted source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n baseUrl: \"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nconst apiKey=await portkey.apiKeys.update({\n id:\"API_KEY_ID\",\n name:\"API_KEY_NAME_0909\",\n rate_limits:[ {\n \"type\": \"requests\",\n \"unit\": \"rpm\",\n \"value\": 100\n }],\n \"scopes\": [\n \"organisation_users.create\",\n \"organisation_users.read\",\n \"organisation_users.update\",\n \"organisation_users.delete\",\n \"organisation_users.list\",\n \"organisation_service_api_keys.create\",\n \"organisation_service_api_keys.update\",\n \"organisation_service_api_keys.read\",\n \"organisation_service_api_keys.delete\",\n \"organisation_service_api_keys.list\",\n \"workspaces.delete\",\n \"workspaces.create\",\n \"workspaces.read\",\n \"workspaces.update\",\n \"workspaces.list\",\n \"logs.export\",\n \"logs.list\",\n \"logs.view\",\n \"configs.create\",\n \"configs.update\",\n \"configs.delete\",\n \"configs.read\",\n \"configs.list\",\n \"virtual_keys.create\",\n \"virtual_keys.update\",\n \"virtual_keys.delete\",\n \"virtual_keys.duplicate\",\n \"virtual_keys.read\",\n \"virtual_keys.list\",\n \"virtual_keys.copy\",\n \"workspace_service_api_keys.create\",\n \"workspace_service_api_keys.delete\",\n \"workspace_service_api_keys.update\",\n \"workspace_service_api_keys.read\",\n \"workspace_service_api_keys.list\",\n \"workspace_user_api_keys.create\",\n \"workspace_user_api_keys.delete\",\n \"workspace_user_api_keys.update\",\n \"workspace_user_api_keys.read\",\n \"workspace_user_api_keys.list\",\n \"workspace_users.create\",\n \"workspace_users.read\",\n \"workspace_users.update\",\n \"workspace_users.delete\",\n \"workspace_users.list\",\n \"analytics.view\"\n ],\n\n})\nconsole.log(apiKey);\n" get: tags: - Api-Keys summary: Get API Keys parameters: - name: id in: path schema: type: string format: uuid required: true responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: $ref: '#/components/schemas/ApiKeyObject' x-code-samples: - lang: python label: Default source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n)\n\n# Get API keys\napi_keys = portkey.api_keys.retrieve(\n id=\"API_KEY_ID\"\n)\n\nprint(api_keys)\n" - lang: javascript label: Default source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n})\n\nconst apiKey=await portkey.apiKeys.retrieve({\n id:\"API_KEY_ID\"\n})\n\nconsole.log(apiKey);\n" - lang: curl label: Default source: 'curl -X GET "https://api.portkey.ai/v1/api_keys/{id}" \ -H "x-portkey-api-key: PORTKEY_API_KEY" ' - lang: curl label: Self-Hosted source: 'curl -X GET "SELF_HOSTED_CONTROL_PLANE_URL/api_keys/{id}" \ -H "x-portkey-api-key: PORTKEY_API_KEY" ' - lang: python label: Self-Hosted source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\n# Get API keys\napi_keys = portkey.api_keys.retrieve(\n id=\"API_KEY_ID\"\n)\n\nprint(api_keys)\n" - lang: javascript label: Self-Hosted source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n baseUrl: \"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nconst apiKey=await portkey.apiKeys.retrieve({\n id:\"API_KEY_ID\"\n})\n\nconsole.log(apiKey);\n" delete: tags: - Api-Keys summary: Remove an API Key parameters: - name: id in: path schema: type: string format: uuid required: true responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: type: object example: {} x-code-samples: - lang: python label: Default source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n)\n\n# Delete the API key\nresult = portkey.api_keys.delete(\n id=\"API_KEY_ID\"\n)\n\nprint(result)\n" - lang: javascript label: Default source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n})\n\nconst apiKey=await portkey.apiKeys.delete({\n id:\"API_KEY_ID\"\n})\nconsole.log(apiKey);\n" - lang: curl label: Default source: 'curl -X DELETE "https://api.portkey.ai/v1/api_keys/{id}" \ -H "x-portkey-api-key: PORTKEY_API_KEY" ' - lang: curl label: Self-Hosted source: 'curl -X DELETE "SELF_HOSTED_CONTROL_PLANE_URL/api_keys/{id}" \ -H "x-portkey-api-key: PORTKEY_API_KEY" ' - lang: python label: Self-Hosted source: "from portkey_ai import Portkey\n\n# Initialize the Portkey client\nportkey = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\n# Delete the API key\nresult = portkey.api_keys.delete(\n id=\"API_KEY_ID\"\n)\n\nprint(result)\n" - lang: javascript label: Self-Hosted source: "import { Portkey } from \"portkey-ai\";\n\nconst portkey = new Portkey({\n apiKey: \"PORTKEY_API_KEY\",\n baseUrl: \"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nconst apiKey=await portkey.apiKeys.delete({\n id:\"API_KEY_ID\"\n})\nconsole.log(apiKey);\n" /api-keys/{id}/rotate: servers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_CONTROL_PLANE_URL description: Self-Hosted Control Plane URL post: tags: - Api-Keys summary: Rotate API Key description: 'Rotates an existing API key and returns a newly generated key value. The previous key remains valid during the transition period and expires at `key_transition_expires_at`. ' requestBody: content: application/json: schema: $ref: '#/components/schemas/RotateApiKeyRequest' examples: default: summary: Rotate with a custom transition period value: key_transition_period_ms: 3600000 parameters: - name: id in: path schema: type: string format: uuid required: true responses: '200': description: OK headers: Content-Type: schema: type: string example: application/json content: application/json: schema: $ref: '#/components/schemas/RotateApiKeyResponse' x-code-samples: - lang: python label: Default source: "import requests\n\nresponse = requests.post(\n \"https://api.portkey.ai/v1/api-keys/API_KEY_ID/rotate\",\n headers={\n \"x-portkey-api-key\": \"PORTKEY_API_KEY\",\n \"Content-Type\": \"application/json\",\n },\n json={\n \"key_transition_period_ms\": 3600000\n }\n)\n\nprint(response.json())\n" - lang: javascript label: Default source: "const response = await fetch(\"https://api.portkey.ai/v1/api-keys/API_KEY_ID/rotate\", {\n method: \"POST\",\n headers: {\n \"x-portkey-api-key\": \"PORTKEY_API_KEY\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n key_transition_period_ms: 3600000\n }),\n});\n\nconst rotatedApiKey = await response.json();\nconsole.log(rotatedApiKey);\n" - lang: curl label: Default source: "curl -X POST \"https://api.portkey.ai/v1/api-keys/{id}/rotate\" \\\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"key_transition_period_ms\": 3600000\n }'\n" - lang: python label: Self-Hosted source: "import requests\n\nresponse = requests.post(\n \"SELF_HOSTED_CONTROL_PLANE_URL/api-keys/API_KEY_ID/rotate\",\n headers={\n \"x-portkey-api-key\": \"PORTKEY_API_KEY\",\n \"Content-Type\": \"application/json\",\n },\n json={\n \"key_transition_period_ms\": 3600000\n }\n)\n\nprint(response.json())\n" - lang: javascript label: Self-Hosted source: "const response = await fetch(\"SELF_HOSTED_CONTROL_PLANE_URL/api-keys/API_KEY_ID/rotate\", {\n method: \"POST\",\n headers: {\n \"x-portkey-api-key\": \"PORTKEY_API_KEY\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n key_transition_period_ms: 3600000\n }),\n});\n\nconst rotatedApiKey = await response.json();\nconsole.log(rotatedApiKey);\n" - lang: curl label: Self-Hosted source: "curl -X POST \"SELF_HOSTED_CONTROL_PLANE_URL/api-keys/{id}/rotate\" \\\n -H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"key_transition_period_ms\": 3600000\n }'\n" components: schemas: UpdateApiKeyObject: type: object properties: name: type: string example: Development API Key description: type: string example: API key for development environment rate_limits: type: array nullable: true items: type: object required: - type - unit - value properties: type: type: string enum: - requests - tokens example: requests unit: type: string enum: - rpd - rph - rpm - rps - rpw description: 'Rate limit unit: requests/tokens per day, hour, minute, second, or week.' example: rpm value: type: integer minimum: 0 example: 100 usage_limits: $ref: '#/components/schemas/UsageLimits' reset_usage: type: boolean description: Whether to reset current usage. If the current status is exhausted, this will change it back to active. example: true scopes: type: array items: type: string example: - completions.write defaults: type: object properties: metadata: type: object additionalProperties: true example: environment: development team: backend config_id: type: string example: config-abc allow_config_override: type: boolean default: true description: When false, the pinned config_id cannot be overridden at request time. example: false alert_emails: type: array items: type: string format: email example: foo@bar.com expires_at: type: string format: date-time nullable: true description: ISO 8601 datetime at which this key expires. example: '2026-12-31T23:59:59Z' rotation_policy: type: object nullable: true description: Update or replace the automatic key rotation configuration. Requires either rotation_period or next_rotation_at. properties: rotation_period: type: string enum: - weekly - monthly nullable: true description: How often to automatically rotate the key. example: monthly next_rotation_at: type: string format: date-time nullable: true description: Explicit datetime for the next rotation. Mutually exclusive with rotation_period. example: '2026-06-01T00:00:00Z' key_transition_period_ms: type: integer minimum: 1800000 description: Duration in milliseconds during which the previous key remains valid after rotation. Minimum 30 minutes (1800000). Must be less than the full rotation period. example: 3600000 RotateApiKeyRequest: type: object properties: key_transition_period_ms: type: integer minimum: 1800000 description: Optional transition period in milliseconds during which the previous key remains valid. example: 3600000 ApiKeyObjectList: type: object properties: total: type: integer example: 2 object: type: string enum: - list data: type: array items: $ref: '#/components/schemas/ApiKeyObject' ApiKeyObject: type: object properties: id: type: string format: uuid example: f47ac10b-58cc-4372-a567-0e02b2c3d479 key: type: string example: Xk*******S4 name: type: string example: Development API Key description: type: string example: API key for development environment type: type: string enum: - organisation-service - workspace-service - workspace-user example: organisation-service organisation_id: type: string format: uuid example: a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d workspace_id: type: string example: ws-myworkspace user_id: type: string format: uuid example: c3d4e5f6-a7b8-6c7d-0e1f-2a3b4c5d6e7f status: type: string enum: - active - exhausted example: active created_at: type: string format: date-time example: '2023-09-15T10:30:00Z' last_updated_at: type: string format: date-time example: '2023-09-15T10:30:00Z' creation_mode: type: string enum: - ui - api - auto example: ui rate_limits: type: array items: type: object properties: type: type: string example: requests unit: type: string example: rpm value: type: integer example: 100 usage_limits: $ref: '#/components/schemas/UsageLimits' reset_usage: type: number example: 0 scopes: type: array items: type: string example: - completions.write defaults: type: object properties: metadata: type: object additionalProperties: true example: environment: development team: backend config_id: type: string example: config-abc alert_emails: type: array items: type: string format: email example: foo@bar.com expires_at: type: string format: date-time object: type: string enum: - api-key example: api-key CreateApiKeyObject: type: object required: - name - scopes properties: name: type: string example: Development API Key description: type: string example: API key for development environment organisation_id: type: string format: uuid description: Organisation ID. Optional when calling via an org-level API key (picked from auth context). example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 workspace_id: type: string example: ws-myworkspace user_id: type: string format: uuid description: '**Required** when sub-type path parameter is ''user''. Not required when sub-type is ''service''.' example: c3d4e5f6-a7b8-6c7d-0e1f-2a3b4c5d6e7f rate_limits: type: array nullable: true items: type: object required: - type - unit - value properties: type: type: string enum: - requests - tokens example: requests unit: type: string enum: - rpd - rph - rpm - rps - rpw description: 'Rate limit unit: requests/tokens per day, hour, minute, second, or week.' example: rpm value: type: integer minimum: 0 example: 100 usage_limits: $ref: '#/components/schemas/UsageLimits' scopes: type: array items: type: string example: - completions.write defaults: type: object properties: metadata: type: object additionalProperties: true example: environment: development team: backend config_id: type: string example: config-abc allow_config_override: type: boolean default: true description: When false, the pinned config_id cannot be overridden at request time. example: false alert_emails: type: array items: type: string format: email example: foo@bar.com expires_at: type: string format: date-time nullable: true description: ISO 8601 datetime at which this key expires. Must not exceed the org/workspace maximum TTL if configured. example: '2026-12-31T23:59:59Z' rotation_policy: type: object nullable: true description: Automatic key rotation configuration. Requires either rotation_period or next_rotation_at. properties: rotation_period: type: string enum: - weekly - monthly nullable: true description: How often to automatically rotate the key. example: monthly next_rotation_at: type: string format: date-time nullable: true description: Explicit datetime for the next rotation. Mutually exclusive with rotation_period. example: '2026-06-01T00:00:00Z' key_transition_period_ms: type: integer minimum: 1800000 description: Duration in milliseconds during which the previous key remains valid after rotation. Minimum 30 minutes (1800000). Must be less than the full rotation period. example: 3600000 RotateApiKeyResponse: type: object properties: id: type: string format: uuid example: 550e8400-e29b-41d4-a716-446655440000 key: type: string description: Newly rotated API key value. example: pk_live_new_rotated_key_value key_transition_expires_at: type: string format: date-time description: Timestamp when the previous key version stops being accepted. example: '2026-01-15T10:30:00.000Z' UsageLimits: type: object properties: credit_limit: type: integer description: Credit Limit. Used for tracking usage minimum: 1 default: null type: type: string description: Type of credit limit enum: - cost - tokens alert_threshold: type: integer description: Alert Threshold. Used for alerting when usage reaches more than this minimum: 1 default: null periodic_reset: type: string description: Reset the usage periodically. enum: - monthly - weekly nullable: true example: monthly periodic_reset_days: type: integer description: Reset the usage counter every N days (1-365). Mutually exclusive with periodic_reset. minimum: 1 maximum: 365 nullable: true example: 30 next_usage_reset_at: type: string format: date-time description: ISO 8601 datetime for the next scheduled usage reset. Auto-computed from periodic_reset or periodic_reset_days if not provided. nullable: true example: '2026-05-01T00:00:00Z' example: credit_limit: 10 periodic_reset: monthly alert_threshold: 8 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