With Portkey, you can upload the file in OpenAI format and portkey will upload the file to OpenAI!

This is the most efficient way to

  • Test your data with different foundation models
  • Perform A/B testing with different foundation models
  • 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>"'

List Files

curl --location 'https://api.portkey.ai/v1/files' \
--header 'x-portkey-api-key: <portkey_api_key>'

Get File

curl --location 'https://api.portkey.ai/v1/files/<file_id>' \
--header 'x-portkey-api-key: <portkey_api_key>'

Get File Content

curl --location 'https://api.portkey.ai/v1/files/<file_id>/content' \
--header 'x-portkey-api-key: <portkey_api_key>'

Delete File

curl --location --request DELETE 'https://api.portkey.ai/v1/files/<file_id>' \
--header 'x-portkey-api-key: <portkey_api_key>'