Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API Reference
Using the Ag.dev API
List files and directories in a drive
cURL
curl --request GET \ --url https://api.ag.dev/v0.1/drives/{driveId}/items \ --header 'X-API-Key: <api-key>'
import requests url = "https://api.ag.dev/v0.1/drives/{driveId}/items" headers = {"X-API-Key": "<api-key>"} response = requests.get(url, headers=headers) print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}}; fetch('https://api.ag.dev/v0.1/drives/{driveId}/items', 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.ag.dev/v0.1/drives/{driveId}/items", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "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" "net/http" "io" ) func main() { url := "https://api.ag.dev/v0.1/drives/{driveId}/items" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-Key", "<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.ag.dev/v0.1/drives/{driveId}/items") .header("X-API-Key", "<api-key>") .asString();
require 'uri' require 'net/http' url = URI("https://api.ag.dev/v0.1/drives/{driveId}/items") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-Key"] = '<api-key>' response = http.request(request) puts response.read_body
{ "kind": "file", "id": "<string>", "name": "<string>", "path": "<string>", "status": "processing", "modifiedAt": "2023-11-07T05:31:56Z", "size": 123, "contentType": "<string>", "description": "<string>", "summary": "<string>", "metadata": {} }
Provide either X-API-Key: or Authorization: Bearer
Drive ID
Path to list items from. Must start with "/" and must not include ".." segments
^/(?!.*(?:^|/)\.\.(?:/|$)).*$
Whether to list items recursively
Drive items
Item type
file
File ID
File name
File path
File processing status
processing
ready
error
Last modified timestamp
File size
File content type
File description
File summary
Additional file metadata