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

# Say what one fire of this schedule may spend

> Records the dollars ONE fire of this schedule may spend. It is a hard stop rather than a price: the turn that fire opens carries this number, and it ends on the first supplier round that reaches it, keeping whatever text arrived and running none of the tool calls that round was still asking for. The honest limit is one supplier round of overshoot, because a round's price is known only once it has ended, and it bounds only what narya itself meters — a tool that reaches a paid service of its own bills somewhere this host never looks.
Zero is zero and never "unlimited": a schedule with nothing to spend does not fire, and records that on its own row rather than going quiet. The number takes effect on the NEXT fire; one already running keeps the ceiling it started under.
A second ceiling bounds what one owner's whole UTC day may be charged across every schedule they have. That one is operator configuration rather than part of any schedule, and either being reached stops the fire instead of warning about it.
Setting what a schedule already holds is not an error.



## OpenAPI

````yaml /en/openapi/v3-current/narya.yaml put /v1/schedules/{scheduleId}/budget
openapi: 3.1.0
info:
  title: Narya Host API
  version: 1.0.0
  description: >-
    The contract between the Narya host and every client. One long-lived host
    runs on your machine and serves this API over a Unix socket in your Narya
    home. Narya creates the socket owner-only, and file permissions are the
    whole authorization. There is no password, no token and no TLS. The terminal
    client and the one-shot command that Lerian ships drive this API, and a
    client you write drives the same one.


    Results never arrive on the response of the request that caused them.
    Submitting a message returns 202 with a turn id. Everything the turn
    produces streams over GET /v1/events as server-sent events with a typed
    envelope, and a stream resumes from a Last-Event-ID header.


    One error envelope: code, title, message, and fields on 422. Codes are NRY-
    followed by four digits. A paged list answers items, limit and a nextCursor
    when more remains. Cursors are opaque.
servers: []
security: []
tags:
  - name: host
    description: The host process itself — version, uptime, mode, store.
  - name: sessions
    description: Durable conversation containers. Archive, never destroy.
  - name: messages
    description: Submitting work into a session and interrupting it.
  - name: events
    description: The server-sent event stream every client consumes.
  - name: lanes
    description: Parallel tracks inside a session — main, subagent, side.
  - name: agents
    description: Named recipes — instructions, tools, model, policy. Read-only in v1.
  - name: ladder
    description: >-
      What a person can type: the skills and command files in force for one
      repository, and expanding one into text. Five origins merged, nearest
      winning a name, the repository's own rungs gated on trust.
  - name: permissions
    description: Pending permission asks, decisions, and the decision audit.
  - name: intercom
    description: Sessions on one machine finding and messaging each other.
  - name: packages
    description: The one thing a user installs — resources, Go code, or both.
  - name: workflows
    description: Deterministic multi-agent orchestration runs.
  - name: providers
    description: Model suppliers, their auth state, and the model catalogue.
  - name: monitors
    description: >-
      Long-running watchers a session keeps beside its conversation — a test
      runner in watch mode, a build, a log being followed. Started by the model
      or by the person, always listed, always killable.
  - name: records
    description: The queryable local record of everything that happened.
  - name: schedules
    description: >-
      Work the host's own clock starts with nobody present — a repository, a
      prompt, a rule and what one fire may spend. Cancel, never destroy.
paths:
  /v1/schedules/{scheduleId}/budget:
    parameters:
      - $ref: '#/components/parameters/ScheduleIdParam'
    put:
      tags:
        - schedules
      summary: Say what one fire of this schedule may spend
      description: >-
        Records the dollars ONE fire of this schedule may spend. It is a hard
        stop rather than a price: the turn that fire opens carries this number,
        and it ends on the first supplier round that reaches it, keeping
        whatever text arrived and running none of the tool calls that round was
        still asking for. The honest limit is one supplier round of overshoot,
        because a round's price is known only once it has ended, and it bounds
        only what narya itself meters — a tool that reaches a paid service of
        its own bills somewhere this host never looks.

        Zero is zero and never "unlimited": a schedule with nothing to spend
        does not fire, and records that on its own row rather than going quiet.
        The number takes effect on the NEXT fire; one already running keeps the
        ceiling it started under.

        A second ceiling bounds what one owner's whole UTC day may be charged
        across every schedule they have. That one is operator configuration
        rather than part of any schedule, and either being reached stops the
        fire instead of warning about it.

        Setting what a schedule already holds is not an error.
      operationId: setScheduleBudget
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleBudget'
      responses:
        '200':
          description: The schedule, under the ceiling it now holds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    ScheduleIdParam:
      name: scheduleId
      in: path
      required: true
      description: The schedule's id.
      schema:
        type: string
        format: uuid
  schemas:
    ScheduleBudget:
      type: object
      description: >-
        What one fire of a schedule may spend. One number, because a schedule
        has no separate on-and-off: zero is a schedule that does not fire.
      required:
        - ceilingUsd
      properties:
        ceilingUsd:
          type: number
          format: double
          minimum: 0
      examples:
        - ceilingUsd: 2.5
    Schedule:
      type: object
      description: >-
        Work the host's own clock starts, with nobody present.

        A schedule is durable configuration, never swept: what a fire produces
        is a session, governed by the rules sessions already have, while the
        schedule itself stays until somebody cancels it. The owner is written
        from the host's own identity and is never something a caller names — a
        fire has to be attributable to somebody who is not there, and an
        attribution the reader cannot check reads exactly like a true one.
      required:
        - id
        - owner
        - repository
        - prompt
        - rule
        - status
        - ceilingUsd
        - createdAt
        - runCount
      properties:
        id:
          type: string
          format: uuid
        owner:
          type: string
          description: Who this schedule's fires are billed to and attributed to.
        repository:
          type: string
          description: >-
            The directory a fired session runs in. Somebody has vouched for it —
            creation refuses one nobody has — and the host reads that answer
            again at every fire, because trust is revocable.
        prompt:
          type: string
          description: What the fired session is asked to do.
        agent:
          type: string
          description: The agent recipe a fire runs under. Absent runs the host's default.
        rule:
          $ref: '#/components/schemas/ScheduleRule'
        status:
          type: string
          description: >-
            active fires; completed is what a single-instant schedule becomes
            once that instant is spent; cancelled is what a person does to one,
            and it stops the fires without removing the record; paused keeps the
            row and stops the fires, which is the difference between changing
            your mind and changing it back.
          enum:
            - active
            - paused
            - completed
            - cancelled
        ceilingUsd:
          type: number
          format: double
          minimum: 0
          description: >-
            What ONE fire may spend. A hard stop on the turn rather than a price
            — see setScheduleBudget for what it does and does not bound. Zero
            means this schedule does not fire.
        createdAt:
          type: string
          format: date-time
        nextRunAt:
          type: string
          format: date-time
          description: >-
            The instant a fire is owed at. Absent once a single instant has been
            spent. A cancelled schedule KEEPS the instant it was going to run at
            — its status is what stops the fire, and the instant is what
            somebody reads when they wonder whether they stopped the right one.
            It is advanced from the moment of the fire rather than from the
            instant that was missed, which is why a host that was off for three
            days fires once rather than three times.
        lastRunAt:
          type: string
          format: date-time
          description: >-
            When this schedule last CLAIMED an instant. Absent until it has. It
            is stamped at the claim, before the fire's session exists, so it
            says when the host last acted on this schedule rather than when work
            last started: a fire refused for a missing repository or an
            unpriceable model moves it too, and lastError says which.
        lastFiredSessionId:
          type: string
          format: uuid
          description: >-
            The session the last fire created, which is where the morning's
            reading starts. It may name a session that has since been purged.
        lastSkippedAt:
          type: string
          format: date-time
          description: >-
            When a due fire was refused, with lastSkipReason saying which
            refusal it was. Recorded rather than silent: a skip nobody can read
            is indistinguishable from a scheduler that stopped working. Written
            once while the refusal lasts, so it answers "since when", and
            cleared by any fire that gets through.
        lastSkipReason:
          type: string
        lastError:
          type: string
          description: >-
            How a fire that had already claimed its instant failed to reach a
            session. The instant stays spent, so this is what the morning reads
            instead of an unexplained gap.
        runCount:
          type: integer
          minimum: 0
          description: >-
            How many instants this schedule has CLAIMED, including fires that
            never reached a session. The count is incremented inside the same
            transaction that spends the instant, which is what makes a fire
            unrepeatable across a crash — so a fire refused after the claim, or
            a host that died in the gap before the session existed, is counted
            here and explained in lastError. A consumer counting SESSIONS wants
            the sessions themselves, not this.
      examples:
        - id: 8f2c1a4e-6b0d-4e2f-9a3c-5d7e1f0b2a4c
          owner: local
          repository: /Users/dana/repos/midaz
          prompt: read yesterday's failed builds and write the summary
          rule:
            kind: every
            everySeconds: 86400
          status: active
          ceilingUsd: 5
          createdAt: '2026-09-03T09:00:00.000Z'
          nextRunAt: '2026-09-04T09:00:00.000Z'
          runCount: 0
    ScheduleRule:
      type: object
      description: >-
        When a schedule fires: a kind and the one parameter that kind takes.
        Exactly one parameter is ever set.

        There is no cron expression here and the absence is a decision, not a
        gap: a cron expression drags a timezone, a daylight-saving policy and a
        no-match semantics behind it, and an agent turn costs money and takes
        minutes, so the units that matter are hours and days.
      required:
        - kind
      properties:
        kind:
          type: string
          enum:
            - every
            - at
          x-enum-varnames:
            - ScheduleRuleKindEvery
            - ScheduleRuleKindAt
        everySeconds:
          type: integer
          minimum: 1
          description: >-
            The gap between fires, present only when kind is every. Seconds
            rather than the duration a person typed, because the only arithmetic
            anybody does with it is addition.
        at:
          type: string
          format: date-time
          description: >-
            The single instant, present only when kind is at. It is what the
            person asked for and stays put after the fire, while nextRunAt is
            what the clock did.
    Error:
      type: object
      description: >-
        The single error envelope every operation returns. Codes are NRY-
        followed by four digits and are catalogued in the top-level
        x-error-catalog extension. fields appears only on 422 validation errors,
        mapping each offending property to its problem.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          pattern: ^NRY-[0-9]{4}$
          description: Machine-readable error code from the NRY catalogue.
        title:
          type: string
          maxLength: 256
          description: Short human-readable summary of the error class.
        message:
          type: string
          maxLength: 4096
          description: Specific, actionable description of what went wrong.
        fields:
          type: object
          description: Per-field validation problems. Present on 422 only.
          additionalProperties:
            type: string
      examples:
        - code: NRY-0002
          title: Session not found
          message: >-
            No session with id 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d exists on
            this host.
  responses:
    BadRequest:
      description: Malformed request — invalid parameter, cursor, or JSON body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The addressed resource does not exist on this host.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: >-
        The request was well-formed but failed validation. The error's fields
        map names each offending property.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The host failed — including a store that refuses writes (NRY-0012).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````