Janvia

API reference

File uploads

Turn local images into URLs for image_urls, instead of sending base64 every time.

Upload local files such as reference images or images to edit, then put the returned URL in a task's image_urls. Requests stay small, and upstreams fetch the image faster than they decode base64.

Upload

POST /v1/files with multipart/form-data, the file in a field named file:

curl https://janvia.io/v1/files \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@./photo.png"

The response is HTTP 201:

{
  "id": "file_Qm9vX...",
  "object": "file",
  "url": "https://janvia.io/v1/files/file_Qm9vX.../content",
  "mime_type": "image/png",
  "bytes": 482113,
  "created_at": "2026-10-22T08:00:00.000Z",
  "expires_at": "2026-10-25T08:00:00.000Z"
}

Then use it in a task:

{
  "model": "gpt-image-2",
  "input": {
    "prompt": "change the background to a beach",
    "image_urls": ["https://janvia.io/v1/files/file_Qm9vX.../content"]
  }
}

Limits

  • PNG, JPEG and WebP images only. The type is read from the file's content, not its name.
  • Up to 10 MB per file, one file per upload.
  • Files are kept for 72 hours, then deleted. Submit your tasks before that.
  • Each account keeps at most 200 files at a time and uploads at most 60 per minute.

The URL is public

The url works without a key, because upstream providers fetch it. File IDs are random and can't be guessed, but don't share the URLs publicly.

Fetch and delete

curl https://janvia.io/v1/files/FILE_ID -H "Authorization: Bearer $API_KEY"
curl -X DELETE https://janvia.io/v1/files/FILE_ID -H "Authorization: Bearer $API_KEY"

You can only see and delete your own files. A missing or expired file returns 404 file_not_found.