> ## 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 authoring accounting and terminal state



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/runners/me/authoring-leases/{lease_id}/reports
openapi: 3.1.0
info:
  title: agentsfleet Control Plane 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/authoring-leases/{lease_id}/reports:
    post:
      tags:
        - Runners
      summary: Record authoring accounting and terminal state
      operationId: runner_authoring_report
      parameters:
        - name: lease_id
          in: path
          description: '`UUIDv7` of the lease.'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
        required: true
      responses:
        '200':
          description: Durable acknowledgement
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reported'
        '400':
          description: Invalid request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '402':
          description: Wallet coverage insufficient
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: Lease unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: Lost lease or replay conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: Envelope too large
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: Too many requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: Internal failure
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: Dependency unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - RunnerBearerAuth: []
components:
  schemas:
    Report:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/Accounting'
              description: Common accounting fields are flat on the wire.
            - type: object
              properties:
                answer:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Optional bounded answer; never accepted after private
                    fencing.
            - type: object
              description: Ordinary final answer plus the independent accounting identity.
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - terminal
          description: Ordinary final answer plus the independent accounting identity.
        - allOf:
            - $ref: '#/components/schemas/Accounting'
              description: Same accounting identity as the original terminal report.
            - type: object
              description: >-
                Metadata-only recovery after private spool expiry or draft
                deletion.
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - accounting
          description: Metadata-only recovery after private spool expiry or draft deletion.
      description: The accounting variant cannot carry private text or its digest.
    Reported:
      type: object
      description: >-
        Immutable content-free acknowledgement, replayable after private
        deletion.
      required:
        - settled
        - replayed
        - sequence
        - state
      properties:
        replayed:
          type: boolean
          description: Whether this report identity was already acknowledged.
        sequence:
          type: string
          description: Decimal request sequence, never a private answer.
        settled:
          type: boolean
          description: False while an authoritative provider obligation remains unresolved.
        state:
          $ref: '#/components/schemas/AuthoringOutcome'
          description: Recorded terminal message outcome.
    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:
            - integer
            - 'null'
          format: int64
          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.
    Accounting:
      type: object
      description: Shared accounting fields; the answer is deliberately absent.
      required:
        - fence
        - deletion_generation
        - report_id
        - outcome
        - usage
      properties:
        deletion_generation:
          type: string
          description: Decimal generation originally issued with the attempt.
        failure_reason:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FailureReason'
              description: Required for `failed`/`timed_out` and absent otherwise.
        fence:
          type: string
          description: Decimal fence originally issued with the attempt.
        outcome:
          $ref: '#/components/schemas/AuthoringOutcome'
          description: Bounded terminal verdict.
        report_id:
          type: string
          description: Stable UUID version 7 report identity, never a content digest.
        usage:
          $ref: '#/components/schemas/Meter'
          description: Cumulative observations checked against daemon dispatch receipts.
    AuthoringOutcome:
      type: string
      description: Terminal attempt outcome, distinct from the draft lifecycle.
      enum:
        - completed
        - failed
        - timed_out
        - cancelled
    FailureReason:
      type: string
      description: >-
        Bounded daemon-owned failure vocabulary, without caller diagnostics or
        links.
      enum:
        - insufficient_balance
        - model_unavailable
        - context_too_large
        - provider_failed
        - provider_usage_unknown
        - attempt_timed_out
        - policy_changed
    Meter:
      type: object
      description: >-
        Bounded cumulative observations supplied on renewal and terminal
        reports.
      required:
        - knowledge
        - calls
        - runtime_ms
      properties:
        calls:
          type: integer
          format: int32
          description: Number of physical dispatches observed by the runner.
          minimum: 0
        input_tokens:
          type:
            - integer
            - 'null'
          format: int64
          description: Known cumulative input tokens, when available.
          minimum: 0
        knowledge:
          $ref: '#/components/schemas/Knowledge'
          description: Unknown is never converted to known using a local estimate.
        output_tokens:
          type:
            - integer
            - 'null'
          format: int64
          description: Known cumulative output tokens, when available.
          minimum: 0
        provider_cost_nanos:
          type:
            - string
            - 'null'
          description: Canonical decimal nanos, checked against daemon receipts.
        runtime_ms:
          type: integer
          format: int64
          description: Runtime from the attempt's monotonic timer.
          minimum: 0
      additionalProperties: false
    Knowledge:
      type: string
      description: Whether all reported provider usage is known.
      enum:
        - known
        - unknown
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: The opaque agt_r token minted when the runner enrols (POST /v1/runners)

````

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