> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentsfleet.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a physical task decision receipt

> Accounts usage under the original runner, lease and fence, even after live work is removed. Known charges and unknown reservations are independent of answer usability. Canonical retries do not charge twice.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json patch /v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}
openapi: 3.1.0
info:
  title: agentsfleet API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}:
    patch:
      tags:
        - Runners
      summary: Record a physical task decision receipt
      description: >-
        Accounts usage under the original runner, lease and fence, even after
        live work is removed. Known charges and unknown reservations are
        independent of answer usability. Canonical retries do not charge twice.
      operationId: runner_record_task_decision
      parameters:
        - name: lease_id
          in: path
          description: Original lease UUIDv7.
          required: true
          schema:
            type: string
        - name: call_id
          in: path
          description: Native physical decision call UUIDv7.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionReceiptInput'
        required: true
      responses:
        '200':
          description: Current accounting and answer disposition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionReceiptResult'
        '400':
          description: The request is invalid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: Authentication is missing, invalid, or not accepted by this endpoint
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: You do not have permission for this action
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: The resource was not found or is not accessible to you
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: The request conflicts with the resource's current state
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The request body exceeds this endpoint's size limit
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: A request or capacity limit has been reached
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: An internal server error occurred
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A required service is unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - RunnerBearerAuth: []
components:
  schemas:
    DecisionReceiptInput:
      type: object
      description: PATCH and late renew/report receipts share the same native recorder.
      required:
        - fencing_token
        - receipt
      properties:
        fencing_token:
          type: integer
          format: int64
          description: The original call's fence, not permission to advance a later task.
          minimum: 0
        receipt:
          $ref: '#/components/schemas/DecisionReceipt'
          description: Canonical physical result or explicit uncertainty.
      additionalProperties: false
    DecisionReceiptResult:
      type: object
      description: Confirms receipt accounting without claiming goal completion.
      required:
        - call_id
        - state
        - replayed
        - disposition
        - reserved_nanos
      properties:
        call_id:
          type: string
          description: Original native call identity, even after lease deletion.
        charged_nanos:
          type:
            - string
            - 'null'
          description: >-
            Exact native charge when priced or proved unsent; absent while
            unknown.
        disposition:
          $ref: '#/components/schemas/DecisionRecordDisposition'
          description: Current semantic usability; never an authority grant.
        overage_nanos:
          type:
            - string
            - 'null'
          description: >-
            Known cost above this call's provisional credit; related paid work
            stops.
        replayed:
          type: boolean
          description: Identical saved receipt, with no new charge or counter movement.
        reserved_nanos:
          type: string
          description: >-
            Remaining provisional credit, without claiming an unknown cost is
            zero.
        state:
          $ref: '#/components/schemas/DecisionCallState'
          description: Current durable accounting state.
        usage:
          oneOf:
            - $ref: '#/components/schemas/DecisionUsage'
              description: >-
                Normalized provider categories, including known usage awaiting
                pricing.
            - type: 'null'
      additionalProperties: false
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    DecisionReceipt:
      oneOf:
        - type: object
          description: >-
            A decoded provider result, including refused/invalid semantic
            answers.
          required:
            - result
            - outcome
          properties:
            outcome:
              type: string
              enum:
                - provider
            result:
              $ref: '#/components/schemas/DecisionResult'
              description: Known usage is preserved independently of semantic acceptance.
        - type: object
          description: The physical outcome remains unknown; no zero-cost line is inserted.
          required:
            - cause
            - outcome
          properties:
            cause:
              $ref: '#/components/schemas/DecisionUnavailableCause'
              description: Bounded cause, never raw provider text or endpoint data.
            outcome:
              type: string
              enum:
                - unknown
        - type: object
          description: The supervisor proved that no provider request was sent.
          required:
            - cause
            - outcome
          properties:
            cause:
              $ref: '#/components/schemas/DecisionNotSentCause'
              description: >-
                Unknown transport outcomes cannot inhabit this proved-unsent
                type.
            outcome:
              type: string
              enum:
                - not_sent
      description: Usage remains accountable when semantics or current task authority fail.
    DecisionRecordDisposition:
      type: string
      description: >-
        Semantic usability is separate from a recorded charge and native
        authority.
      enum:
        - current
        - stale
        - unusable
    DecisionCallState:
      type: string
      description: >-
        Native physical-call lifecycle; unresolved calls retain their
        reservation.
      enum:
        - reserved
        - issued
        - known
        - unknown
        - not_sent
    DecisionUsage:
      type: object
      description: >-
        Measured provider token categories, without multiplying per-question
        totals.
      required:
        - input_tokens
        - output_tokens
        - cached_input_tokens
        - cache_write_tokens
      properties:
        cache_write_tokens:
          type: integer
          format: int32
          description: Cache writes, already included in `input_tokens`.
          minimum: 0
        cached_input_tokens:
          type: integer
          format: int32
          description: Input tokens served from cache, already included in `input_tokens`.
          minimum: 0
        input_tokens:
          type: integer
          format: int32
          description: Complete input total, including cache reads and writes.
          minimum: 0
        output_tokens:
          type: integer
          format: int32
          description: Completion tokens, including any provider-reported reasoning.
          minimum: 0
      additionalProperties: false
    DecisionResult:
      type: object
      description: Usage is retained even when the semantic result is refused or stale.
      required:
        - result
      properties:
        reported_model:
          type:
            - string
            - 'null'
          description: >-
            Provider-reported name, without claiming an observable serving
            revision.
        result:
          $ref: '#/components/schemas/DecisionOutcome'
          description: Native interpretation of this physical response.
        usage:
          oneOf:
            - $ref: '#/components/schemas/DecisionUsage'
              description: Measured usage, or an unknown reservation when unavailable.
            - type: 'null'
      additionalProperties: false
    DecisionUnavailableCause:
      oneOf:
        - type: object
          description: The physical deadline elapsed without complete usage.
          required:
            - reason
          properties:
            reason:
              type: string
              enum:
                - timeout
        - type: object
          description: The transport failed after native issuance.
          required:
            - reason
          properties:
            reason:
              type: string
              enum:
                - transport
        - type: object
          description: An HTTP refusal carried no normalized usage.
          required:
            - status
            - retry_delay
            - reason
          properties:
            reason:
              type: string
              enum:
                - provider_status
            retry_delay:
              $ref: '#/components/schemas/DecisionRetryDelay'
              description: >-
                A long delay remains evidence and cannot become an immediate
                retry.
            status:
              type: integer
              format: int32
              description: Status is recorded independently of any untrusted error body.
              minimum: 0
        - type: object
          description: Reply size, JSON or response shape prevented complete accounting.
          required:
            - reason
          properties:
            reason:
              type: string
              enum:
                - response
      description: >-
        Value-free physical failure; only recorded 429/529 evidence permits
        retry.
    DecisionNotSentCause:
      type: string
      description: Failures that prove the SDK never sent a physical provider request.
      enum:
        - preflight
        - build
    DecisionOutcome:
      oneOf:
        - type: object
          description: >-
            Complete typed evidence, still subject to native thresholds and
            authority.
          required:
            - answers
            - outcome
          properties:
            answers:
              type: object
              description: Exact reviewed question-key coverage.
              additionalProperties:
                $ref: '#/components/schemas/DecisionAnswer'
              propertyNames:
                type: string
            outcome:
              type: string
              enum:
                - answered
        - type: object
          description: The provider declined at least one required question.
          required:
            - outcome
          properties:
            outcome:
              type: string
              enum:
                - refused
        - type: object
          description: The response cannot authorize a semantic transition.
          required:
            - reason
            - outcome
          properties:
            outcome:
              type: string
              enum:
                - invalid
            reason:
              $ref: '#/components/schemas/DecisionInvalid'
              description: Bounded native diagnostic, without provider text.
      description: A readable physical result, separately from whether it may advance work.
    DecisionRetryDelay:
      oneOf:
        - type: object
          description: No provider delay; the caller still applies bounded jitter.
          required:
            - kind
          properties:
            kind:
              type: string
              enum:
                - unspecified
        - type: object
          description: Delay fits the approved two-second retry budget.
          required:
            - milliseconds
            - kind
          properties:
            kind:
              type: string
              enum:
                - within_budget
            milliseconds:
              type: integer
              format: int32
              description: Earliest retry, relative to the recorded failure.
              minimum: 0
        - type: object
          description: The provider requested more time than this logical decision permits.
          required:
            - kind
          properties:
            kind:
              type: string
              enum:
                - too_long
      description: Provider delay evidence without retaining raw headers or private text.
    DecisionAnswer:
      oneOf:
        - type: object
          description: Probability of yes; thresholds remain native policy.
          required:
            - noul
            - type
          properties:
            noul:
              type: number
              format: double
              description: Probability from zero to one.
            type:
              type: string
              enum:
                - noul
        - type: object
          description: Categorical choice with its complete probability distribution.
          required:
            - choice
            - probabilities
            - type
          properties:
            choice:
              type: string
              description: Selected option identity.
            confidence:
              type:
                - number
                - 'null'
              format: double
              description: Provider-native confidence, absent when unavailable.
            probabilities:
              type: object
              description: Probability of every allowed option.
              additionalProperties:
                type: number
                format: double
              propertyNames:
                type: string
            type:
              type: string
              enum:
                - choice
        - type: object
          description: Probability-weighted ordered rubric.
          required:
            - score
            - probabilities
            - type
          properties:
            confidence:
              type:
                - number
                - 'null'
              format: double
              description: Provider-native confidence, absent when unavailable.
            probabilities:
              type: object
              description: Distribution over zero-based levels.
              additionalProperties:
                type: number
                format: double
              propertyNames:
                type: string
            score:
              type: number
              format: double
              description: Expected zero-based level.
            type:
              type: string
              enum:
                - score
      description: Native probability answers after exact question/type/option validation.
    DecisionInvalid:
      type: string
      description: Why a readable provider response cannot drive a native transition.
      enum:
        - model
        - usage
        - answers
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: >-
        Runner token beginning with agt_r, returned once by POST
        /v1/admin/runners

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.