Documentation
Compute plans and streams
View .mdOpenAPI

Complete a harness stage

POSThttps://weights.fyi/run/v1/compute/plans/{plan_id}/stages/{stage_id}/completescope: submit
text
POST https://weights.fyi/run/v1/compute/plans/{plan_id}/stages/{stage_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 result commit, cost roll-up and dependency update.

Records successful completion of your active awow_harness_lease stage. This account-authenticated route accepts harness results; service-managed stages require their worker's separate completion authority and cannot be completed by adding lease fields to this body. The tenant grant must still be valid.

The JSON body is the result itself. The first success stores it, revokes the stage's scoped token, emits stage_completed and makes satisfied dependencies eligible for scheduling. Once all stages finish successfully, the plan becomes completed and emits plan_completed. An identical result can be retried; a different result after completion conflicts.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer token with submit; use the account token, not the stage's scoped chat token.
plan_id, stage_idpathyesYour plan and its stage identifiers.
Result objectbodyyesJSON object of at most 1 MiB; {} is valid for a harness result. Do not wrap it in result.
output_uri, output_checkpoint_uribodynoNon-null values must name this tenant's output, using r2://tenants/<tenant_id>/<path> or s3://<bucket>/tenants/<tenant_id>/<path>.
total_cost_usd_microsbodynoNonnegative integer, maximum 9,223,372,036,854,775,807. Null, fractions and booleans are invalid.
Additional result fieldsbodynoRetained in the durable result and compared on replay; not echoed in the plan receipt.

Return value

200 OK with the current plan receipt. The completed stage reports state: "completed"; other stages can remain pending or active.

For a harness stage, accrued cost includes charges already attached to its scoped token, never less than the existing accrued amount or reported total. Completion rolls those charges up without debiting them again. Replaying an identical result does not complete or charge the stage twice.

Errors

StatusCodeMeaning
400invalid_json, invalid_compute_planInvalid result object, output path or cost.
401unauthorized, invalid_token, token_revoked, token_expiredSupply a valid account token.
403scope_required, account_suspended, compute_tenancy_unauthorizedMissing scope, active account or tenant grant.
403—A service-managed stage requires worker completion authority.
404compute_plan_not_found, compute_stage_not_foundPlan or stage is absent or inaccessible to this account.
409compute_plan_conflictStage is not executing, stream work remains unsettled, or the result differs from its completed result.
413body_too_largeBody exceeds 1 MiB.
429rate_limitedWait for Retry-After before retrying.

Examples

After the harness finishes successfully:

sh
curl -s https://weights.fyi/run/v1/compute/plans/PLAN_ID/stages/STAGE_ID/complete \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{}'

Selected response fields:

json
{"plan_id":"example-plan","state":"completed","stages":[{"stage_id":"sessions","state":"completed","accrued_cost_usd_micros":1200}],"total_accrued_cost_usd_micros":1200,"last_event_seq":42}

History

  • 2026-10-28: documented harness completion and identical-result replay.

See also