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>",
"file_name": "<string>"
}
'import requests
url = "https://api.getpique.ai/v1/judges/reference_content"
payload = {
"file_extension": "<string>",
"file_name": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_extension: '<string>', file_name: '<string>'})
};
fetch('https://api.getpique.ai/v1/judges/reference_content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getpique.ai/v1/judges/reference_content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_extension' => '<string>',
'file_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getpique.ai/v1/judges/reference_content"
payload := strings.NewReader("{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getpique.ai/v1/judges/reference_content")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getpique.ai/v1/judges/reference_content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"upload_url": "<string>",
"expires_at": "<string>",
"reference_content_uri": "<string>"
}Judges
Create Reference Content Upload URL
Generate a pre-signed upload URL for judge reference 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>",
"file_name": "<string>"
}
'import requests
url = "https://api.getpique.ai/v1/judges/reference_content"
payload = {
"file_extension": "<string>",
"file_name": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_extension: '<string>', file_name: '<string>'})
};
fetch('https://api.getpique.ai/v1/judges/reference_content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getpique.ai/v1/judges/reference_content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_extension' => '<string>',
'file_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getpique.ai/v1/judges/reference_content"
payload := strings.NewReader("{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getpique.ai/v1/judges/reference_content")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getpique.ai/v1/judges/reference_content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_extension\": \"<string>\",\n \"file_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"upload_url": "<string>",
"expires_at": "<string>",
"reference_content_uri": "<string>"
}Authentication
Required: API Key authentication viaX-API-Key header
Request Body
The file extension of the content to upload. Must be between 1-10 characters.Examples:
mp4, jpg, png, wav, pdfOptional display name for the file (without extension). Max 50 characters. The name is sanitized to lowercase alphanumeric characters, hyphens, and underscores. If omitted, a random identifier is generated.Examples:
episode_1, intro_segmentRequest 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",
"file_name": "episode_1"
}'
JSON Body
{
"file_extension": "mp4",
"file_name": "episode_1"
}
Response
A pre-signed GCS (Google Cloud Storage) URL for uploading the reference content.This URL is valid for a limited time (15 minutes) and should be used with a PUT request to upload the file directly.
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/fileResponse Example
{
"upload_url": "https://storage.googleapis.com/judge-artifacts/org_123/reference_uploads/abc123/episode_1.mp4?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=...",
"expires_at": "2024-01-15T11:30:00Z",
"reference_content_uri": "gs://judge-artifacts/org_123/reference_uploads/abc123/episode_1.mp4"
}
How to Upload Content
After receiving the response, use theupload_url to upload your file:
curl -X PUT "<UPLOAD_URL_FROM_RESPONSE>" \
-H "Content-Type: video/mp4" \
-T your-file.mp4 \
Important Notes
- The upload URL expires after 15 minutes (see
expires_atfield) - The file must be uploaded using a PUT request
- Set the appropriate
Content-Typeheader when uploading - The
reference_content_urireturned should be used to reference this content when creating a judge