Documentation
Compute plans and streams
View .mdOpenAPI

Complete a harness pack

POSThttps://weights.fyi/run/v1/streams/{stage_id}/packs/{pack_id}/completescope: submit
text
POST https://weights.fyi/run/v1/streams/{stage_id}/packs/{pack_id}/complete
Authorization: Bearer <token>                    scope: submit
Content-Type: application/json
Available since
2026-10-28: included in this build; see What is live for deployment status.
Answer time
synchronous receipt validation and commit; does not download or verify output bytes.

Records the durable output receipt for an already leased pack owned by an awow_harness_lease stage. Current plan admission assigns every stream kind to managed execution, so those streams return 403 here; adding lease fields to the body cannot grant completion authority. Clients register inputs, seal and poll while the runtime reports completion. The harness receipt contract below applies only if a harness-owned pack already exists.

The output must be in the plan tenant's namespace and under the stage's output_prefix_uri. The completed item count must equal the registration's count. An identical normalized receipt is safe to repeat: it returns the stored receipt without charging or counting the pack again. A conflicting receipt is refused.

Request

JSON object, at most 1 MiB.

NameWhereRequiredMeaning
AuthorizationheaderyesAccount bearer token with submit.
stage_id, pack_idpathyesStream identifier or authored stage identifier, and registered pack identifier.
plan_idquerynoDisambiguates an authored stage identifier.
output_pack_uribodyyesDurable output URI within the tenant and stage output prefix.
output_pack_sha256bodyyes64 hexadecimal digits identifying the output bytes.
items_materializedbodyyesNonnegative signed 64-bit integer; must equal the registered positive item_count.
model_sha256bodyconditionalNonempty string required for classifier and embedding work, or whenever supplied; must match a checkpoint digest recorded by the lease when present.
seat_modelbodyconditionalMust match the leased model when executing through an agent seat.
plan_id, stage_id, pack_id, ordinalbodynoFilled from registration; if supplied, must match it. The body stage identifier is authored, not qualified.

Return value

200 OK with the normalized receipt, including its four identity fields. Additional submitted receipt fields are retained and participate in replay comparison.

A first completion increments pack and item progress, records charges and emits a completion event. It may prepare more work. A sealed stream whose packs are settled can finish and release dependent stages; an unsealed stream remains open.

Errors

StatusCode or causeAction
400invalid_json, invalid_compute_planCorrect the receipt identity, output location, digest, model or item count.
401unauthorized, invalid_token, token_revoked, token_expiredSupply a valid token.
403scope_required, account_suspended, compute_tenancy_unauthorizedRestore submit scope, account or tenant access.
403Execution authorization refusalLet managed execution report its own completion; this route requires a harness-owned stage.
404compute_stage_not_found, compute_pack_not_foundCheck ownership and identifiers.
409ambiguous_compute_stageSupply plan_id or use stream_id.
409compute_plan_conflictPack is unleased, stage is terminal, or receipt differs from the stored completion.
413body_too_largeKeep JSON within 1 MiB.
429rate_limitedWait Retry-After.

Examples

Receipt form for an already leased, one-record harness pack whose output prefix is r2://tenants/TENANT_ID/results/. Current plan admission does not create such streams:

sh
curl -s -X POST 'https://weights.fyi/run/v1/streams/STAGE_ID/packs/PACK_ID/complete?plan_id=PLAN_ID' \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{"output_pack_uri":"r2://tenants/TENANT_ID/results/p0.jsonl","output_pack_sha256":"ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356","items_materialized":1}'
json
{
  "plan_id": "PLAN_ID", "stage_id": "STAGE_ID", "pack_id": "PACK_ID", "ordinal": 0,
  "output_pack_uri": "r2://tenants/TENANT_ID/results/p0.jsonl",
  "output_pack_sha256": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356",
  "items_materialized": 1
}

History

  • 2026-10-28: documented receipt validation, completion authority and idempotent replay.

See also