Delete a file
curl --request DELETE \
--url https://api.zerogpu.ai/v1/files/{file_id} \
--header 'x-api-key: <api-key>' \
--header 'x-project-id: <api-key>'import requests
url = "https://api.zerogpu.ai/v1/files/{file_id}"
headers = {
"x-api-key": "<api-key>",
"x-project-id": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-project-id': '<api-key>'}
};
fetch('https://api.zerogpu.ai/v1/files/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/files/{file_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-project-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["x-project-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "file",
"deleted": true
}Batch API
Delete file
Interactive playground for DELETE /v1/files/.
DELETE
/
v1
/
files
/
{file_id}
Delete a file
curl --request DELETE \
--url https://api.zerogpu.ai/v1/files/{file_id} \
--header 'x-api-key: <api-key>' \
--header 'x-project-id: <api-key>'import requests
url = "https://api.zerogpu.ai/v1/files/{file_id}"
headers = {
"x-api-key": "<api-key>",
"x-project-id": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-project-id': '<api-key>'}
};
fetch('https://api.zerogpu.ai/v1/files/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/files/{file_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-project-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["x-project-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "file",
"deleted": true
}Soft-delete a file. It is removed from storage immediately and returns
404 on list, retrieve, and download afterward. Deleting an input file does not stop an active batch.
Full reference: Files API.
