Dokumentacja API
Wyświetl listę plików
Wyświetl listę aktywnych plików w deterministycznej kolejności kursorowej.
Wyświetl listę aktywnych plików w deterministycznej kolejności kursorowej.
Punkt końcowy
- Bazowy URL
https://runapi.ai- Wersja API
v1- Uwierzytelnianie
Authorization: Bearer YOUR_API_KEY
02
Treść JSONŻądanie
Wysyłaj wartości wyłącznie w podanej lokalizacji żądania.
Parametry zapytania4 pola
afterstring
Opcjonalne
Zwróć pliki po tym kursorze identyfikatora pliku.
limitinteger
Opcjonalne
Maksymalna liczba zwracanych plików.
Domyślna wartość:10000
Zakres: 1 - 10000
orderstring
Opcjonalne
Sortuj według czasu utworzenia.
Dozwolone wartości:asc, desc
Domyślna wartość: desc
purposestring
Opcjonalne
Filtruj według przeznaczenia pliku (File purpose).
Dozwolone wartości:user_data, batch, batch_output
03
HTTP 200Odpowiedź sukcesu
GET /v1/files
JSON
{
"data": [
{
"bytes": 1048576,
"created_at": 1785196800,
"filename": "knowledge.pdf",
"id": "file_abc123",
"object": "file",
"purpose": "user_data"
}
],
"first_id": "file_abc123",
"has_more": false,
"last_id": "file_abc123",
"object": "list"
}
04
HTTP 401Odpowiedź błędu (401)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "authentication_error",
"message": "Missing API key",
"param": null,
"type": "authentication_error"
}
}
05
HTTP 400Odpowiedź błędu (400)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "invalid_request_error",
"message": "Malformed request",
"param": null,
"type": "invalid_request_error"
}
}
06
HTTP 404Odpowiedź błędu (404)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "not_found",
"message": "File not found",
"param": null,
"type": "invalid_request_error"
}
}
07
HTTP 409Odpowiedź błędu (409)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "upload_state_conflict",
"message": "Upload state conflict",
"param": null,
"type": "invalid_request_error"
}
}
08
HTTP 413Odpowiedź błędu (413)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "file_too_large",
"message": "File size exceeds the maximum allowed size",
"param": "file",
"type": "invalid_request_error"
}
}
09
HTTP 422Odpowiedź błędu (422)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "invalid_upload",
"message": "Upload request rejected",
"param": null,
"type": "invalid_request_error"
}
}
10
HTTP 502Odpowiedź błędu (502)
Schemat odpowiedzi
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Przykład odpowiedzi
JSON
{
"error": {
"code": "storage_write_failed",
"message": "File storage failed",
"param": null,
"type": "server_error"
}
}
11
Przykład cURL
CURL
curl -X GET https://runapi.ai/v1/files?order=desc&purpose=user_data \
-H 'Authorization: Bearer YOUR_API_KEY'