Portkey supports managing files in two ways:

  1. Uploading and managing files to any provider using the unified signature
  2. [Enterprise Only] Uploading files to Portkey and using them for batching/fine-tuning requests with any provider

1. Uploading and managing files to any provider using the unified signature

Please refer to the Provider Specific Files documentation for more details.

  1. OpenAI
  2. Bedrock
  3. Azure OpenAI

2. [Enterprise Only] Uploading files to Portkey and using them for batching/fine-tuning requests with any provider

With Portkey, you can upload files to Portkey and reuse them for batching inference with any provider and fine-tuning with supported providers.

In this way, you can test your data with different foundation models, perform A/B testing with different foundation models, and perform batch inference with different foundation models.

Uploading Files

  curl --location --request POST 'https://api.portkey.ai/v1/files' \
--header 'x-portkey-api-key: <portkey_api_key>' \
--form 'purpose="<purpose>"' \
--form 'file=@"<file_path>"'

Listing Files

curl -X GET https://api.portkey.ai/v1/files \
  -H "Authorization: Bearer $PORTKEY_API_KEY"

Get File

curl -X GET https://api.portkey.ai/v1/files/{file_id} \
  -H "Authorization: Bearer $PORTKEY_API_KEY"

Get File Content

curl -X GET https://api.portkey.ai/v1/files/{file_id}/content \
  -H "Authorization: Bearer $PORTKEY_API_KEY"