With Portkey, you can upload files to Portkey and reuse the content in your requests.

In that 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"