Skip to main content
POST
Declare a model upload, or resume the one in flight

Authorizations

Authorization
string
header
required

An Earnie API key, sent as Authorization: Bearer sk_earnie_.... Create one under Settings > API keys. The key's scopes decide which operations it may call.

Path Parameters

projectId
string<uuid>
required

Body

application/json
filename
string
required

The file's name. A model weights file (.safetensors, .gguf, .bin, .pt, .pth, .onnx, .tflite, .mlmodel, .h5, .keras, .pb, .pkl), or a Hugging Face snapshot as .tar, .tar.gz or .tgz.

size_bytes
integer<int64>
required

The exact size of the file. Every window names it as its total.

Required range: x >= 1
head_sha256
string
required

Lowercase hex SHA-256 of the first min(16 MiB, size_bytes) bytes. With the size it is the resume key: declaring the same file again while its upload is in flight answers that upload and its offset.

Pattern: ^[0-9a-f]{64}$

Response

The upload of this file already in flight, at its offset.

id
string<uuid>
required
filename
string
required
size_bytes
integer<int64>
required
offset
integer<int64>
required

Bytes the server holds. The next window starts here.

Required range: x >= 0
expires_at
string<date-time>
required

When an upload that receives no more bytes is discarded. Every accepted window moves it forward.

created_at
string<date-time>
required
model_id
string<uuid> | null

The Model the bytes sealed into, once the last window landed. When the same bytes were uploaded before, this is the existing Model.