Documentation
Compute plans and streams
View .mdOpenAPI

Upload a pack's content

PUThttps://weights.fyi/run/v1/streams/{stage_id}/packs/{pack_id}/contentscope: submit
text
PUT https://weights.fyi/run/v1/streams/{stage_id}/packs/{pack_id}/content?item_count=<n>
Authorization: Bearer <token>                    scope: submit
X-Content-SHA256: <the body's SHA-256, optional>

<the pack's bytes>
Available since
2026-11-01: included in this build; see What is live for deployment status.
Answer time
synchronous: the answer comes when the last byte has been read, checked and stored and the pack is registered, so the time is mostly the time your connection takes to carry the body.

Send one input pack's bytes with your API key alone and register the pack runnable on its stream. You need no storage credential: the service streams the body into your workspace's custody in parts of 64 MiB, hashes it on the way, and registers the pack with the stored object's r2_input_uri, sha256 and compressed_bytes. A jsonl_zst body must start with a Zstandard frame. Nothing is registered until the whole body has arrived and matched its digest.

One upload can feed several stages of the same plan: register the receipt's r2_input_uri, sha256 and compressed_bytes on another stream with POST .../packs, with est_input_tokens and est_output_tokens. Sending the same bytes to the same pack again answers its registration and stores nothing twice; other bytes for a registered pack are refused. A pack registered lazily is promoted by its upload.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer token with submit scope.
stage_idpathyesPlan-qualified stream ID, or the authored stage ID with plan_id.
pack_idpathyesLetters, digits and ._:-, at most 128 characters.
plan_idquerynoThe plan, when stage_id is the authored stage ID.
item_countqueryyesItems in the pack, at least 1.
formatquerynojsonl_zst (default; jsonl.zst is accepted), jsonl, parquet, arrow_ipc, lance or safetensors.
ordinalquerynoPosition in the stream; the next free one when omitted.
est_input_tokens, est_output_tokensquerynoToken estimates; 0 when omitted.
max_pending_packsquerynoThis call's backlog limit instead of the stage's.
sha256 or X-Content-SHA256query or headernoExpected SHA-256 of the body; both must agree when both are given.
Content-LengthheadernoOver the limit refuses the call before a byte is read; a chunked body is read up to the limit.
the bodybodyyesThe pack's bytes, at most 512 MiB (max_record_pack_bytes in capabilities).

Return value

201 Created for a new or promoted pack, 200 OK for an identical replay, with a Location header naming the pack. The body is the registration: plan_id, authored stage_id, stream_id, pack_id, ordinal, item_count, format, r2_input_uri, sha256, compressed_bytes, the token estimates and replayed.

Errors

StatusCodeMeaning
400invalid_compute_planA missing or bad query value, an empty body, or a stage that takes no packs.
400source_format_mismatchA jsonl_zst body without a Zstandard frame.
400content_sha256_mismatchThe body's digest is not the one given; expected and actual show both.
401unauthorizedSupply a valid token.
403scope_required, compute_tenancy_unauthorizedSubmit access is unavailable.
404compute_stage_not_foundAbsent or inaccessible stream.
409compute_plan_conflictOther bytes for a registered pack, or a sealed or finished stream.
413body_too_largeThe body is over the limit; limit_bytes gives it.
429stream_backpressureThe stream's backlog is full; wait for packs to finish.
502storage_unavailableStorage refused a part; nothing is registered, so send the pack again.
503stream_store_not_configuredUploads are not switched on for this service.

Examples

sh
curl -s -T pack-0001.jsonl.zst "https://weights.fyi/run/v1/streams/STREAM_ID/packs/PACK_ID/content?item_count=500" -H "Authorization: Bearer $WEIGHTS_API_KEY"

History

  • 2026-11-01: added uploads with the API key alone, digest checks and identical replays.

See also

See list completed outputs, read a pack's output and register a pack.