---
title: "Mark an in-flight run terminal"
method: POST
path: "/api/funko/run/end"
tags: ["funko", "browser-session"]
---

# Mark an in-flight run terminal

`POST /api/funko/run/end`

## Request

- Base URL: `https://www.immersivecommons.com`
- URL: `https://www.immersivecommons.com/api/funko/run/end`
- Auth: API key in cookie `__session`

Clerk-session only, ownership-gated, idempotent. Frees the caller's in-flight claim so a dead run stops reporting 'your figure is already being made' for the rest of the claim TTL. It is NOT a refund: `generationsUsed` is never decremented, because refund-on-failure is the loop that turns one bug into an overnight bill.

## Request body

- FunkoRunEndRequest
  - `runId` string, required
  - `reason` string: Free text, for the run record.

## Response `200`

The run is now terminal.

- FunkoRunEndResponse
  - `ok` boolean, required
  - `status` 'failed' | 'cancelled', required

## Other responses

- `400`: Missing runId.
- `401`: Not signed in.
- `403`: Unknown, forged, or already-terminal runId - one indistinguishable refusal.
- `500`: KV write failed.

---

[API](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api.md) · [All operations](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/revisions/be67c1f67c27?raw)
