Upload an asset
curl --request POST \
--url https://api.protoface.com/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'modality=<string>'import requests
url = "https://api.protoface.com/v1/assets"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "modality": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('modality', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.protoface.com/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"byte_size": 123,
"created_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"download_url": "<string>",
"duration_ms": 123,
"height": 123,
"id": "<string>",
"media_type": "<string>",
"modality": "<string>",
"schema_uri": "<string>",
"scope": "<string>",
"status": "<string>",
"width": 123,
"object": "asset"
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}Assets
Upload an asset
Upload an asset
curl --request POST \
--url https://api.protoface.com/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'modality=<string>'import requests
url = "https://api.protoface.com/v1/assets"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "modality": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('modality', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.protoface.com/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"byte_size": 123,
"created_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"download_url": "<string>",
"duration_ms": 123,
"height": 123,
"id": "<string>",
"media_type": "<string>",
"modality": "<string>",
"schema_uri": "<string>",
"scope": "<string>",
"status": "<string>",
"width": 123,
"object": "asset"
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}Authorizations
Live API key minted in the dashboard. Pass as Authorization: Bearer sk_live_…. Keys are scoped to a single environment (staging / prod).
Body
multipart/form-data
Response
Successful Response
Allowed value:
"asset"
