Rend Developers

Endpoints

Files

Every picture and video the API makes is saved as a file in your Rend Library, with a permanent file id. List your API files, get a fresh link to one, download it or delete it.

GEThttps://rend.ai/api/v1/files

GEThttps://rend.ai/api/v1/files/{id}

GEThttps://rend.ai/api/v1/files/{id}/content

DELETEhttps://rend.ai/api/v1/files/{id}

Where results go

  • Your Library. Each result lands in a Library folder named API, or the folder you send, and shows in the app like any file. Its tags include api and any tags you send; its description is the prompt. Folders are one level deep, so "folder": "Clients/Acme" makes a folder named Clients/Acme.
  • A project, if you name one. Send project with one of your project ids and the file is also added to that project’s media. Projects shared with you are refused before anything is charged.
  • Links last 24 hours. Every url is a signed link that works for 24 hours (url_expires_at). Get the file again for a fresh one; the file_id never changes.
  • How long files are kept. On a paid plan, or with storage added (a storage pack or pay-as-you-go storage), API files stay until you delete them and count toward your storage like any file. On the free plan they are deleted 24 hours after they are made. Send "store": false to have any file deleted after 24 hours. If your storage is full, the result is still delivered, kept for 24 hours, and the reply says so in storage_note.
  • expires_at is when the file will be deleted, or null while you keep it.

List files

GEThttps://rend.ai/api/v1/files

Your API files, newest first. Files you deleted, here or in the app, are left out.

Query Type Description
limit integer 1 to 100. Default 20.
after string A file id from the last page, for the next page.
type string image or video.
project string Only files added to this project.
folder string Only files in this Library folder.

has_more says whether another page follows; pass last_id as after to get it.

GET/v1/files
curl "https://api.rend.ai/v1/files?type=image&limit=10" \
-H "Authorization: Bearer $REND_API_KEY"
ResponseJSON
{
  "object": "list",
  "data": [{
    "id": "file_3f9a0c1d2b7e4a6f8c0d1e2f",
    "object": "file",
    "type": "image",
    "status": "stored",
    "filename": "a-red-bicycle-against-a-yellow-wall.png",
    "bytes": 1843210,
    "content_type": "image/png",
    "model": "rend-image",
    "prompt": "A red bicycle against a yellow wall",
    "size": "1024x1536",
    "tags": ["bicycle"],
    "project": null,
    "folder": "API",
    "source": "api",
    "request_id": "img-6c1f...",
    "key": "Production",
    "created_at": 1796500000,
    "expires_at": null,
    "url": "https://rend.ai/api/media/...?grant=...",
    "url_expires_at": 1796586400,
    "library_url": "https://rend.ai/studio/library/folder%3A..."
  }],
  "first_id": "file_3f9a0c1d2b7e4a6f8c0d1e2f",
  "last_id": "file_3f9a0c1d2b7e4a6f8c0d1e2f",
  "has_more": false
}

Get a file

GEThttps://rend.ai/api/v1/files/{id}

The file’s details and a fresh 24-hour url. A video’s file also has seconds and video_id. A deleted file has status: "deleted" and no url.

Download a file

GEThttps://rend.ai/api/v1/files/{id}/content

Redirects to the file. A deleted file returns a 410 with code file_deleted.

Delete a file

DELETEhttps://rend.ai/api/v1/files/{id}

Moves the file to Recently deleted in the app, where it can be restored for 7 days, and takes it out of any project it was added to. A file placed in an edit is refused with a 409 (file_in_use); remove it from the edit first.

curl -L https://api.rend.ai/v1/files/file_3f9a0c1d2b7e4a6f8c0d1e2f/content \
-H "Authorization: Bearer $REND_API_KEY" -o picture.png

curl -X DELETE https://api.rend.ai/v1/files/file_3f9a0c1d2b7e4a6f8c0d1e2f \
-H "Authorization: Bearer $REND_API_KEY"
DELETE responseJSON
{ "id": "file_3f9a0c1d2b7e4a6f8c0d1e2f", "object": "file", "deleted": true }

Errors

Status Code Why
400 (none) A bad limit, type or after. The message says which.
404 file_not_found No file with that id on your account.
409 file_in_use The file is placed in an edit, so it can’t be deleted yet.
410 file_deleted /content for a file that was deleted.
503 (none) Files are briefly unavailable. Try again shortly.