Skip to main content
Create Reference Content Upload URL
curl --request POST \
  --url https://api.getpique.ai/v1/judges/reference_content \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "file_extension": "<string>"
}
'
{
  "upload_url": "<string>",
  "reference_content_uri": "<string>"
}

Authentication

Required: API Key authentication via X-API-Key header

Request Body

file_extension
string
required
The file extension of the content to upload. Must be between 1-10 characters.Examples: mp4, jpg, png, wav, pdf

Request Example

cURL

curl -X POST "https://api.getpique.ai/v1/judges/reference_content" \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "file_extension": "mp4"
  }'

JSON Body

{
  "file_extension": "mp4"
}

Response

upload_url
string
A pre-signed GCS (Google Cloud Storage) URL for uploading the reference content.This URL is valid for a limited time (typically 5 minutes) and should be used with a PUT request to upload the file directly.
reference_content_uri
string
The GCS URI where the file will be stored. This can be used to reference the file in subsequent API call to create a judge.Format: gs://bucket-name/path/to/file

Response Example

{
  "upload_url": "https://storage.googleapis.com/judge-artifacts/org_123/reference_uploads/abc123/xyz789.mp4?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=...",
  "reference_content_uri": "gs://judge-artifacts/org_123/reference_uploads/abc123/xyz789.mp4"
}

How to Upload Content

After receiving the response, use the upload_url to upload your file:
curl -X PUT "<UPLOAD_URL_FROM_RESPONSE>" \
  -H "Content-Type: video/mp4" \
  -T your-file.mp4 \

Important Notes

  1. The upload URL expires after a limited time (typically 5 minutes)
  2. The file must be uploaded using a PUT request
  3. Set the appropriate Content-Type header when uploading
  4. The reference_content_uri returned should be used to reference this content when creating a judge

Error Responses

400 Bad Request

Invalid file extension or request format

401 Unauthorized

Missing or invalid API key

403 Forbidden

Organization does not have permission to upload reference content

500 Internal Server Error

Failed to generate upload URL due to server error