openapi: 3.0.0
info:
title: Portkey Analytics > Graphs Batch 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: Batch
description: Create large batches of API requests to run asynchronously.
paths:
/batches:
servers:
- url: https://api.portkey.ai/v1
description: Portkey API Public Endpoint
- url: SELF_HOSTED_GATEWAY_URL
description: Self-Hosted Gateway URL
post:
summary: Creates and executes a batch from an uploaded file of requests
operationId: createBatch
tags:
- Batch
requestBody:
required: true
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/OpenAIBatchJob'
- $ref: '#/components/schemas/BedrockBatchJob'
- $ref: '#/components/schemas/VertexBatchJob'
- $ref: '#/components/schemas/PortkeyBatchJob'
responses:
'200':
description: Batch created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Batch'
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
label: Default
source: "curl https://api.portkey.ai/v1/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 -d '{\n \"input_file_id\": \"file-abc123\",\n \"endpoint\": \"/v1/chat/completions\",\n \"completion_window\": \"24h\"\n }'\n"
- lang: python
label: Default
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.create(\n input_file_id=\"file-abc123\",\n endpoint=\"/v1/chat/completions\",\n completion_window=\"24h\"\n)\n"
- lang: javascript
label: Default
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 batch = await client.batches.create({\n input_file_id: \"file-abc123\",\n endpoint: \"/v1/chat/completions\",\n completion_window: \"24h\"\n });\n\n console.log(batch);\n}\n\nmain();\n"
- lang: curl
label: Self-Hosted
source: "curl SELF_HOSTED_GATEWAY_URL/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 -d '{\n \"input_file_id\": \"file-abc123\",\n \"endpoint\": \"/v1/chat/completions\",\n \"completion_window\": \"24h\"\n }'\n"
- lang: python
label: Self-Hosted
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n base_url = \"SELF_HOSTED_GATEWAY_URL\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.create(\n input_file_id=\"file-abc123\",\n endpoint=\"/v1/chat/completions\",\n completion_window=\"24h\"\n)\n"
- lang: javascript
label: Self-Hosted
source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const batch = await client.batches.create({\n input_file_id: \"file-abc123\",\n endpoint: \"/v1/chat/completions\",\n completion_window: \"24h\"\n });\n\n console.log(batch);\n}\n\nmain();\n"
get:
operationId: listBatches
tags:
- Batch
summary: List your organization's batches.
parameters:
- in: query
name: after
required: false
schema:
type: string
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.
'
- 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
responses:
'200':
description: Batch listed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ListBatchesResponse'
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
label: Default
source: "curl https://api.portkey.ai/v1/batches?limit=2 \\\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"
- lang: python
label: Default
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.list()\n"
- lang: javascript
label: Default
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 list = await client.batches.list();\n\n for await (const batch of list) {\n console.log(batch);\n }\n}\n\nmain();\n"
- lang: curl
label: Self-Hosted
source: "curl SELF_HOSTED_GATEWAY_URL/batches?limit=2 \\\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"
- lang: python
label: Self-Hosted
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n base_url = \"SELF_HOSTED_GATEWAY_URL\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.list()\n"
- lang: javascript
label: Self-Hosted
source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const list = await client.batches.list();\n\n for await (const batch of list) {\n console.log(batch);\n }\n}\n\nmain();\n"
/batches/{batch_id}/output:
servers:
- url: https://api.portkey.ai/v1
description: Portkey API Public Endpoint
- url: SELF_HOSTED_GATEWAY_URL
description: Self-Hosted Gateway URL
get:
operationId: getBatchOutput
tags:
- Batch
summary: Returns batch output as stream.
parameters:
- in: path
name: batch_id
required: true
schema:
type: string
description: The ID of the batch to retrieve output for.
responses:
'200':
description: Batch output returned successfully.
content:
application/octet-stream:
schema:
type: string
format: binary
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
label: Default
source: "curl https://api.portkey.ai/v1/batches/batch_abc123/output \\\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"
- lang: python
label: Default
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.output(\"batch_abc123\")\n"
- lang: javascript
label: Default
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 batch = await client.batches.output(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
- lang: curl
label: Self-Hosted
source: "curl SELF_HOSTED_GATEWAY_URL/batches/batch_abc123/output \\\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"
- lang: python
label: Self-Hosted
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n base_url = \"SELF_HOSTED_GATEWAY_URL\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.output(\"batch_abc123\")\n"
- lang: javascript
label: Self-Hosted
source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const batch = await client.batches.output(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
/batches/{batch_id}:
servers:
- url: https://api.portkey.ai/v1
description: Portkey API Public Endpoint
- url: SELF_HOSTED_GATEWAY_URL
description: Self-Hosted Gateway URL
get:
operationId: retrieveBatch
tags:
- Batch
summary: Retrieves a batch.
parameters:
- in: path
name: batch_id
required: true
schema:
type: string
description: The ID of the batch to retrieve.
responses:
'200':
description: Batch retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Batch'
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
label: Default
source: "curl https://api.portkey.ai/v1/batches/batch_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"
- lang: python
label: Default
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.retrieve(\"batch_abc123\")\n"
- lang: javascript
label: Default
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 batch = await client.batches.retrieve(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
- lang: curl
label: Self-Hosted
source: "curl SELF_HOSTED_GATEWAY_URL/batches/batch_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"
- lang: python
label: Self-Hosted
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n base_url = \"SELF_HOSTED_GATEWAY_URL\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.retrieve(\"batch_abc123\")\n"
- lang: javascript
label: Self-Hosted
source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const batch = await client.batches.retrieve(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
/batches/{batch_id}/cancel:
servers:
- url: https://api.portkey.ai/v1
description: Portkey API Public Endpoint
- url: SELF_HOSTED_GATEWAY_URL
description: Self-Hosted Gateway URL
post:
operationId: cancelBatch
tags:
- Batch
summary: Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file.
parameters:
- in: path
name: batch_id
required: true
schema:
type: string
description: The ID of the batch to cancel.
responses:
'200':
description: Batch is cancelling. Returns the cancelling batch's details.
content:
application/json:
schema:
$ref: '#/components/schemas/Batch'
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
label: Default
source: "curl https://api.portkey.ai/v1/batches/batch_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 -X POST\n"
- lang: python
label: Default
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.cancel(\"batch_abc123\")\n"
- lang: javascript
label: Default
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 batch = await client.batches.cancel(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
- lang: curl
label: Self-Hosted
source: "curl SELF_HOSTED_GATEWAY_URL/batches/batch_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 -X POST\n"
- lang: python
label: Self-Hosted
source: "from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n base_url = \"SELF_HOSTED_GATEWAY_URL\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nclient.batches.cancel(\"batch_abc123\")\n"
- lang: javascript
label: Self-Hosted
source: "import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const batch = await client.batches.cancel(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n"
components:
schemas:
PortkeyBatchJob:
type: object
required:
- model
properties:
job_name:
type: string
description: Job name for the batch job
output_data_config:
type: string
description: Batch job's output storage location, will be constructed based on `input_file_id` if not provided
model:
type: string
description: Model to start batch job with
role_arn:
type: string
description: Role ARN for the bedrock batch job
portkey_options:
allOf:
- $ref: '#/components/schemas/PortkeyBatchOptions'
description: Portkey Gateway Provider specific headers to be passed to the provider, if portkey is used as a provider
provider_options:
anyOf:
- type: object
title: Bedrock Options
properties:
job_name:
type: string
description: Job name for the batch job
output_data_config:
type: string
description: Batch job's output storage location, will be constructed based on `input_file_id` if not provided
model:
type: string
description: Model to start batch job with
role_arn:
type: string
description: Role ARN for the bedrock batch job
required:
- model
- role_arn
- type: object
title: Vertex Options
properties:
job_name:
type: string
description: Job name for the batch job
output_data_config:
type: string
description: Batch job's output storage location, will be constructed based on `input_file_id` if not provided
model:
type: string
description: Model to start batch job with
required:
- model
description: Provider specific options to be passed to the provider, optional can be passed directly as well.
allOf:
- $ref: '#/components/schemas/OpenAIBatchJob'
description: Gateway supported body params for portkey managed batching.
title: Portkey Params
OpenAIBatchJob:
type: object
required:
- input_file_id
- completion_window
- endpoint
properties:
input_file_id:
type: string
description: The input file to use for the batch job
completion_window:
type: string
enum:
- immediate
- 24h
description: Completion window for the batch job, `immediate` is only supported with Portkey Managed Batching.
endpoint:
type: string
enum:
- /v1/chat/completions
- /v1/completions
- /v1/embeddings
description: Inference endpoint
metadata:
description: metadata related for the batch job
type: object
additionalProperties: true
nullable: true
description: Gateway supported body params for OpenAI, Azure OpenAI and VertexAI.
title: OpenAI Params
VertexBatchJob:
type: object
required:
- model
properties:
job_name:
type: string
description: Job name for the batch job
output_data_config:
type: string
description: Batch job's output storage location, will be constructed based on `input_file_id` if not provided
model:
type: string
description: Model to start batch job with
allOf:
- $ref: '#/components/schemas/OpenAIBatchJob'
description: Gateway supported body params for Vertext fine-tuning.
title: Vertex Params
Batch:
type: object
properties:
id:
type: string
object:
type: string
enum:
- batch
description: The object type, which is always `batch`.
endpoint:
type: string
description: The Portkey API endpoint used by the batch.
errors:
type: object
properties:
object:
type: string
description: The object type, which is always `list`.
data:
type: array
items:
type: object
properties:
code:
type: string
description: An error code identifying the error type.
message:
type: string
description: A human-readable message providing more details about the error.
param:
type: string
description: The name of the parameter that caused the error, if applicable.
nullable: true
line:
type: integer
description: The line number of the input file where the error occurred, if applicable.
nullable: true
input_file_id:
type: string
description: The ID of the input file for the batch.
completion_window:
type: string
description: The time frame within which the batch should be processed.
status:
type: string
description: The current status of the batch.
enum:
- validating
- failed
- in_progress
- finalizing
- completed
- expired
- cancelling
- cancelled
output_file_id:
type: string
description: The ID of the file containing the outputs of successfully executed requests.
error_file_id:
type: string
description: The ID of the file containing the outputs of requests with errors.
created_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch was created.
in_progress_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch started processing.
expires_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch will expire.
finalizing_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch started finalizing.
completed_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch was completed.
failed_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch failed.
expired_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch expired.
cancelling_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch started cancelling.
cancelled_at:
type: integer
description: The Unix timestamp (in seconds) for when the batch was cancelled.
request_counts:
type: object
properties:
total:
type: integer
description: Total number of requests in the batch.
completed:
type: integer
description: Number of requests that have been completed successfully.
failed:
type: integer
description: Number of requests that have failed.
required:
- total
- completed
- failed
description: The request counts for different statuses within the batch.
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
- endpoint
- input_file_id
- completion_window
- status
- created_at
PortkeyBatchOptions:
type: object
required:
- x-portkey-virtual-key
properties:
x-portkey-virtual-key:
type: string
description: The virtual key to communicate with the provider
x-portkey-aws-s3-bucket:
type: string
description: The AWS S3 bucket to use for file upload during finetune
x-portkey-vertex-storage-bucket-name:
type: string
description: Google Storage bucket to use for file upload during finetune
x-portkey-provider-model:
type: string
description: Model to use for the batch job also for file transformation for model specific inference input.
example:
x-portkey-virtual-key: vkey-1234567890
x-portkey-aws-s3-bucket: my-bucket
x-portkey-provider-model: meta.llama3-1-8b-instruct-v1:0
x-portkey-vertex-storage-bucket-name: my-bucket
description: Options to be passed to the provider, supports all options supported by the provider from gateway.
ListBatchesResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Batch'
first_id:
type: string
example: batch_abc123
last_id:
type: string
example: batch_abc456
has_more:
type: boolean
object:
type: string
enum:
- list
required:
- object
- data
- has_more
BedrockBatchJob:
type: object
required:
- model
- role_arn
properties:
job_name:
type: string
description: Job name for the batch job
output_data_config:
type: string
description: Batch job's output storage location, will be constructed based on `input_file_id` if not provided
model:
type: string
description: Model to start batch job with
role_arn:
type: string
description: Role ARN for the bedrock batch job
allOf:
- $ref: '#/components/schemas/OpenAIBatchJob'
description: Gateway supported body params for bedrock fine-tuning.
title: Bedrock Params
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
p
# --- truncated at 32 KB (40 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/portkey/refs/heads/main/openapi/portkey-batch-api-openapi.yml