Documentation
Compute plans and streams
View .mdOpenAPI

Seal a stream

POSThttps://weights.fyi/run/v1/streams/{stage_id}/sealscope: submit
text
POST https://weights.fyi/run/v1/streams/{stage_id}/seal
Authorization: Bearer <token>                    scope: submit
Available since
2026-10-28: included in this build; see What is live for deployment status.
Answer time
synchronous state update; returns without waiting for unfinished packs.

Marks the end of a stream: no new pack identifiers may be registered. Register every intended pack first, including lazy pointers. Existing lazy registrations can still be promoted, and identical registration or completion replays remain valid after sealing.

Sealing does not cancel work or discard unfinished packs. The stream finishes when all registered packs are completed or otherwise settled under its incomplete-work policy and its dependencies allow completion. Repeating this call is safe; its returned state reflects current progress. On a continuous stream (workload.continuous: true) a later pack registration or consolidation lifts the seal; cancel the plan to end it.

Request

No body is required; the handler does not read one.

NameWhereRequiredMeaning
AuthorizationheaderyesBearer token with submit.
stage_idpathyesThe plan's stream_id, or an authored stage identifier.
plan_idquerynoDisambiguates an authored stage identifier; must agree with a qualified identifier.

For classifier and embedding streams, the sum of registered item_count values must equal total_items. An open stream initially declaring total_items: 0 adopts that sum on its first seal. Lazy packs count toward the sum.

Return value

200 OK:

FieldMeaning
plan_id, stage_id, stream_idPlan identifier, authored stage identifier and qualified plan_id~stage_id.
sealedAlways true on success. Backlog reads expose this as stream_sealed.
stateStage state after sealing; may already be completed.
total_itemsPresent for classifier and embedding streams, including an inferred total for an open stream.

The last pack's completion can finish a sealed stream later. Sealing an already drained stream may finish it immediately; an unsealed terminal stage is refused.

Errors

StatusCodeAction
400invalid_compute_planUse a stage that accepts stream packs.
401unauthorized, invalid_token, token_revoked, token_expiredSupply a valid token.
403scope_required, account_suspendedRestore submit scope or account access.
404compute_stage_not_foundCheck ownership and identifiers.
409ambiguous_compute_stageSupply plan_id or use stream_id.
409compute_plan_conflictMatch the declared item total, or inspect the terminal stage's result.
429rate_limitedWait Retry-After.

Examples

sh
curl -s -X POST 'https://weights.fyi/run/v1/streams/STAGE_ID/seal?plan_id=PLAN_ID' \
  -H "Authorization: Bearer $WEIGHTS_API_KEY"

A classifier stream whose registered packs have all completed:

json
{
  "plan_id": "PLAN_ID", "stage_id": "STAGE_ID", "stream_id": "PLAN_ID~STAGE_ID",
  "sealed": true, "state": "completed", "total_items": 100
}

History

  • 2026-10-28: documented end-of-stream, inferred totals and completion after draining.

See also