List uploaded files
curl --request GET \
--url https://api.infery.ai/v1/files \
--header 'Authorization: <api-key>'import requests
url = "https://api.infery.ai/v1/files"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.infery.ai/v1/files', 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.infery.ai/v1/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://api.infery.ai/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.infery.ai/v1/files")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "file_1hR9xTPZqK4mVLc2nJ7fY5wB",
"object": "file",
"bytes": 245192,
"created_at": 1713204900,
"filename": "report.pdf",
"purpose": "assistants",
"status": "processed"
}
],
"has_more": false,
"last_id": "file_1hR9xTPZqK4mVLc2nJ7fY5wB"
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}Files
List files
GET /v1/files — list uploaded files in the current workspace.
GET
/
v1
/
files
List uploaded files
curl --request GET \
--url https://api.infery.ai/v1/files \
--header 'Authorization: <api-key>'import requests
url = "https://api.infery.ai/v1/files"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.infery.ai/v1/files', 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.infery.ai/v1/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://api.infery.ai/v1/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.infery.ai/v1/files")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "file_1hR9xTPZqK4mVLc2nJ7fY5wB",
"object": "file",
"bytes": 245192,
"created_at": 1713204900,
"filename": "report.pdf",
"purpose": "assistants",
"status": "processed"
}
],
"has_more": false,
"last_id": "file_1hR9xTPZqK4mVLc2nJ7fY5wB"
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}curl https://api.infery.ai/v1/files \
-H "Authorization: Bearer $INFERY_API_KEY"
Authorizations
API key in format: Bearer inf_***
Query Parameters
Filter by intended purpose. All SIX stored purposes are accepted — parsePurpose below validates against the full ApiFilePurpose enum, not the four OpenAI-compatible ones this parameter used to declare. pipeline_artifact and media_artifact are stamped on files our own pipeline and media-job workers produce, and a listing legitimately contains them, so filtering for them has always worked and was simply undocumented.
Available options:
assistants, vision, user_data, batch, pipeline_artifact, media_artifact Max items to return (default server-side)
Required range:
1 <= x <= 100Pagination cursor — pass the previous response's last_id