runs

Update Run

Update run status and result fields (used by agents to report outcomes).

Model Sweep result contract (PRD-016, requires SWEEPS_ENABLED): report which model served the run plus token counts and Badge computes the cost axis for your Hiring Frontier — no SDK, plain curl:

curl -X PATCH "$API/api/v1/runs/$RUN_ID" \
  -H "Content-Type: application/json" -b "$COOKIES" \
  -d '{
    "status": "completed", "success": true,
    "model": "claude-haiku-4-5",
    "input_tokens": 18234, "output_tokens": 2101,
    "unit_cost_override_usd": 0.021
  }'

Cost resolution for non-metered runs: known model in the pricing table → computed from tokens; else unit_cost_override_usd (total $ for this run, 0–100) when given; else cost stays null. Any self-report marks the run self_reported — it plots amber on the frontier and can never mint a verified cert. Metered runs (Badge dispatched on a customer key) reject these fields with 409 run_is_metered; while the flag is off they return 400 sweeps_disabled.

patch/api/v1/runs/{run_id}

Request

  • Base URL: https://api.badgeia.com
  • URL: https://api.badgeia.com/api/v1/runs/{run_id}
  • Auth: none declared

Path parameters

run_idstring uuid required

Request body

status'pending' | 'running' | 'completed' | 'failed' | 'timeout' required
successboolean nullable
outputstring nullable
error_messagestring nullable
latency_msinteger nullable
input_tokensinteger nullable
output_tokensinteger nullable
total_cost_usdnumber nullable
retry_countinteger nullable
modelstring nullable
unit_cost_override_usdnumber nullable

Per-task TOTAL cost for the run in USD. Sanity-capped at 100.

Response

Successful Response

idstring uuid required
agent_idstring uuid required
agent_display_namestring nullable
agent_identity_state'active' | 'deactivated' | 'unavailable' nullable
task_idstring uuid required
status'pending' | 'running' | 'completed' | 'failed' | 'timeout' required
started_atstring date-time nullable required
completed_atstring date-time nullable required
latency_msinteger nullable required
successboolean nullable required
outputstring nullable required
output_withheldboolean
error_messagestring nullable required
input_tokensinteger nullable required
output_tokensinteger nullable required
total_cost_usdnumber nullable required
evidence_cost_usdnumber nullable
evidence_cost_sourcestring
evidence_cost_partialboolean
evidence_priced_call_countinteger
evidence_unpriced_call_countinteger
evidence_total_call_countinteger
retry_countinteger required
created_atstring date-time required
answer_exposedboolean
provider_cost_authoritystring nullable
screening_session_idstring uuid nullable
repeat_indexinteger nullable
repeat_totalinteger nullable
architecture_hashstring nullable
previous_architecture_hashstring nullable
architecture_changedboolean nullable
architecture_comparableboolean
architecture_change_summaryobject nullable
architecture_span_countinteger
certification_idstring uuid nullable
certification_sequenceinteger nullable
requested_modelstring nullable
returned_modelstring nullable
llm_providerstring nullable
usage_sourcestring nullable
model_pricing_idstring uuid nullable
pricing_input_cost_per_millionnumber nullable
pricing_output_cost_per_millionnumber nullable
pricing_effective_datestring date nullable
error_classstring nullable
response_statusinteger nullable
error_body_excerptstring nullable
execution_modestring nullable
verification_hashstring nullable
signed_atstring date-time nullable
key_idstring nullable
public_certificate_state'verified' | 'simulated' | 'unsigned' | 'invalid'
suite_idstring nullable
suite_versioninteger nullable
modelstring nullable
cost_provenancestring nullable
cost_basis'metered' | 'traced' | 'traced_partial' | 'self_reported' | 'unavailable' nullable
scored_cost_usdnumber nullable
provenance_levelstring nullable
manifest_hashstring nullable
provenance_flagsstring[] required

Changes

No recorded changes to this operation across all 1 revision of this API.