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

> ## Agent Instructions
> To set up offstage cloud from a coding agent, read https://api.offstage.cloud/SKILL.md and follow it. The whole API guide is one file at https://api.offstage.cloud/llms.txt.

# Remove the card

> Removes the card on file and returns the billing object. Without a card, new work must fit in the remaining free credit. Owners only. Console session only: an API key gets 403 `console-only`.



## OpenAPI

````yaml /openapi.json delete /v1/billing/card
openapi: 3.1.0
info:
  title: offstage cloud API
  version: 0.1.0
  summary: Real Macs for AI agents and CI, over HTTP.
  description: >-
    macOS sandboxes driven one call at a time, and fire-and-forget CI tasks, on
    Apple silicon Macs running macOS 27.


    - **Auth.** `Authorization: Bearer sk_offstage_…` (a team API key; one made
    before 2026-10-29 starts with `oc_live_` and still works), or the console's
    `oc_session` cookie. Operations marked `x-console-only: true` take only the
    cookie; an API key gets 403 `console-only`. A cookie request that changes
    something must come from this origin.

    - **Errors.** Every failure is `{"error": {"code", "message", "fix"?,
    "requestId"}}`. Switch on `code`; `fix`, when present, says what to do. Any
    operation can also answer 500 `internal` (a bug; quote the `requestId`), and
    an unknown route is 404 `no-such-route`.

    - **Request ids.** Every response carries an `x-request-id` header, repeated
    as `requestId` in error bodies.

    - **Units.** Times are Unix milliseconds, and durations end in `Ms`. Money
    is US dollars as numbers, exact to the micro-dollar (`costUsd`).

    - **Ids** are prefixed: `sbx_` sandbox, `cmd_` command, `run_` agent run,
    `task_` task, `key_` API key, `req_` request, `team_`, `usr_`, `box_` (a
    fleet Mac), `inv_`.

    - **Lists** are newest first. Pass the previous page's `nextCursor` as
    `cursor`; it is null on the last page.

    - **Bodies.** JSON, except file writes, which send raw bytes. Request
    schemas with `additionalProperties: false` refuse an unknown field with 400
    `unknown-field`.

    - **Limits.** A team may send 120 requests a minute, whatever key or session
    it uses. Every request also counts against its client address: 600 a minute,
    and far fewer on the routes that need no credential (5 sign-ups an hour, 20
    sign-ins and 20 verifications a minute). Over a window is 429 `rate-limit`
    with a `Retry-After` header.

    - **Verification.** A new account's team can sign in and look around, but
    cannot create sandboxes, tasks or API keys (403 `email-unverified`) until
    its owner opens the link emailed at signup.

    - **Holds.** No request is held longer than about 50 s, so default client
    timeouts and 60 s proxy idle timeouts are fine, except large files: a write
    answers once its upload is done, and a read streams for as long as the Mac
    takes to send it.


    The prose reference, with examples, is
    `https://api.offstage.cloud/llms.txt`. The agent setup guide is
    `https://api.offstage.cloud/SKILL.md`.
servers:
  - url: https://api.offstage.cloud
security:
  - apiKey: []
  - consoleSession: []
tags:
  - name: Sandboxes
    description: >-
      A Mac slot (a macOS user account) held for you: run commands, move files,
      take screenshots.
  - name: Tasks
    description: >-
      Fire-and-forget macOS work: clone a public repo, run a command, collect
      artifacts.
  - name: Recordings
    description: >-
      What a gui sandbox or gui task showed and did, kept by the plane: live
      while it runs, a replay after. Open one in the console at `/r/{id}`.
  - name: Capacity
    description: What the fleet can take right now, and whether the plane is up.
  - name: Billing
    description: The price, usage, the bill, the budget and the card.
  - name: Account
    description: Signing in, the team, its members and its API keys.
  - name: GitHub
    description: >-
      GitHub Actions jobs on offstage Macs: connect an organization in the
      console, then `runs-on: offstage-macos`.
  - name: Secrets
    description: Write-only team credentials selected by workload name.
paths:
  /v1/billing/card:
    delete:
      tags:
        - Billing
      summary: Remove the card
      description: >-
        Removes the card on file and returns the billing object. Without a card,
        new work must fit in the remaining free credit. Owners only. Console
        session only: an API key gets 403 `console-only`.
      operationId: removeCard
      responses:
        '200':
          description: The billing object, without a card.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Billing'
        '401':
          description: >-
            `unauthorized`: no credential, an `Authorization` header that is not
            `Bearer …`, a value that is not an `sk_offstage_` (or older
            `oc_live_`) key, a revoked or unknown key, or a box token. The
            message says which.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `console-only`: an API key may not do this; only a signed-in console
            session may. `forbidden`: the signed-in user is not an owner of the
            team, or the request came from another origin.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`no-card`: there is no card on file.'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - consoleSession: []
components:
  headers:
    RequestId:
      description: This request's id, `req_…`. Quote it when asking for help.
      required: true
      schema:
        type: string
        pattern: ^req_
  schemas:
    Billing:
      type: object
      properties:
        mode:
          type: string
          enum:
            - test
            - live
            - 'off'
          description: >-
            `test`: the built-in test checkout or a Stripe test key. `live`: a
            live Stripe key. `off`: card payments are not open yet, so every
            team runs on its free credit.
        plan:
          type: object
          properties:
            id:
              const: payg
            name:
              type: string
            usdPerHour:
              $ref: '#/components/schemas/Usd'
          required:
            - id
            - name
            - usdPerHour
          additionalProperties: false
        card:
          oneOf:
            - $ref: '#/components/schemas/Card'
            - type: 'null'
          description: Null until a card is added.
        credit:
          type: object
          properties:
            grantedUsd:
              $ref: '#/components/schemas/Usd'
            usedUsd:
              $ref: '#/components/schemas/Usd'
            remainingUsd:
              $ref: '#/components/schemas/Usd'
            expiresAt:
              oneOf:
                - $ref: '#/components/schemas/Millis'
                - type: 'null'
              description: >-
                When the soonest active grant with credit left expires; null
                when none of them does.
            grants:
              type: array
              description: >-
                Every grant, newest first, expired and revoked ones included
                (`active` false, nothing remaining).
              items:
                $ref: '#/components/schemas/CreditGrant'
          required:
            - grantedUsd
            - usedUsd
            - remainingUsd
            - expiresAt
            - grants
          additionalProperties: false
          description: >-
            Credit is what a team spends before its card is charged. It comes as
            grants: the sign-up credit, and any offstage gives (the YC deal),
            each with its own expiry or none. The sums count the grants still
            active. Work draws on the grants that were active when it was
            admitted, the soonest to expire first.
        period:
          type: object
          properties:
            id:
              type: string
              description: This month, `YYYY-MM` (UTC).
            start:
              $ref: '#/components/schemas/Millis'
            end:
              $ref: '#/components/schemas/Millis'
            spentUsd:
              $ref: '#/components/schemas/Usd'
              description: Booked this month, plus what running work has used so far.
            reservedUsd:
              $ref: '#/components/schemas/Usd'
              description: What in-flight work holds beyond what it has already used.
            estimatedInvoiceUsd:
              $ref: '#/components/schemas/Usd'
              description: >-
                This month's spend minus the credit it uses, plus anything
                carried over.
          required:
            - id
            - start
            - end
            - spentUsd
            - reservedUsd
            - estimatedInvoiceUsd
          additionalProperties: false
        budget:
          type: object
          properties:
            limitUsd:
              type:
                - number
                - 'null'
              description: The monthly budget; null for none.
            enforce:
              type: boolean
              description: >-
                When true, work that could take this month's spend beyond the
                credit past the budget is refused with 402 `budget-exceeded`.
            spentUsd:
              $ref: '#/components/schemas/Usd'
              description: >-
                What counts against the budget this month: spend beyond the
                credit, booked and accrued. Credit never counts against a
                budget.
            alertThresholds:
              type: array
              items:
                type: integer
              description: >-
                Percentages of the budget at which an alert fires, once a month
                each.
            alerts:
              type: array
              description: This month's alerts.
              items:
                type: object
                properties:
                  threshold:
                    type: integer
                  at:
                    $ref: '#/components/schemas/Millis'
                  spentUsd:
                    $ref: '#/components/schemas/Usd'
                required:
                  - threshold
                  - at
                  - spentUsd
                additionalProperties: false
          required:
            - limitUsd
            - enforce
            - spentUsd
            - alertThresholds
            - alerts
          additionalProperties: false
        ceiling:
          type: object
          description: >-
            The credit ceiling: the most a card on file is trusted with at once
            beyond the free credit, set by offstage ($100 unless offstage set
            this team's own). While a card is on file, work that could pass it
            is refused with 402 `credit-ceiling`, whatever the budget says; the
            budget can only refuse sooner. Without a card the free credit is the
            limit.
          properties:
            limitUsd:
              $ref: '#/components/schemas/Usd'
            usedUsd:
              $ref: '#/components/schemas/Usd'
              description: >-
                What counts against it now, beyond the free credit: invoices not
                paid yet and amounts carried, usage not invoiced yet (this
                month's included), and what in-flight work could still cost at
                its timeout.
            remainingUsd:
              $ref: '#/components/schemas/Usd'
          required:
            - limitUsd
            - usedUsd
            - remainingUsd
          additionalProperties: false
        status:
          type: string
          enum:
            - active
            - past_due
          description: >-
            `past_due`: the last charge failed and new work is refused with 402
            `payment-failed` until the card is fixed.
        failureMessage:
          type: string
          description: 'Present when `past_due`: why the charge failed.'
        portal:
          type: boolean
          description: Whether `openBillingPortal` works (false in test mode).
        postpaid:
          type: boolean
          description: >-
            Legacy month-end invoicing: usage beyond the credit is invoiced on
            the 1st, under the credit ceiling. False for every team made since
            prepaid credit, and for good once a postpaid team buys credit or
            turns auto-reload on.
        autoReload:
          $ref: '#/components/schemas/AutoReload'
      required:
        - mode
        - plan
        - card
        - credit
        - period
        - budget
        - ceiling
        - postpaid
        - autoReload
        - status
        - portal
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Stable and machine-readable, like `sandbox-closed`. Switch on
                this, not on the message.
            message:
              type: string
              description: What went wrong, for a person.
            fix:
              type: string
              description: What to do about it, when there is something to do.
            requestId:
              type: string
              description: >-
                The same as the `x-request-id` header. Quote it when asking for
                help.
              pattern: ^req_
          required:
            - code
            - message
            - requestId
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: >-
        The one error envelope: every 4xx and 5xx the plane itself sends. A
        proxy in front of it may send a 5xx whose body is not JSON.
      examples:
        - error:
            code: sandbox-closed
            message: sandbox sbx_mh3k2f9aQ1xYz0aBcDeFgHiJ is closed (idle)
            fix: create a new sandbox
            requestId: req_mh3k2f9aQ1xYz0aBcDeFgHiJ
    Usd:
      type: number
      description: US dollars, exact to the micro-dollar (six decimal places).
    Card:
      type: object
      properties:
        brand:
          type: string
        last4:
          type: string
        expMonth:
          type: integer
          minimum: 1
          maximum: 12
        expYear:
          type: integer
      required:
        - brand
        - last4
        - expMonth
        - expYear
      additionalProperties: false
    Millis:
      type: integer
      minimum: 0
      description: A time, in Unix milliseconds.
    CreditGrant:
      type: object
      properties:
        id:
          type: string
          description: '`grant_…`'
        reason:
          type: string
          description: >-
            What it is for: `free` for the sign-up credit, `yc` for the YC deal,
            or another short slug.
        grantedAt:
          $ref: '#/components/schemas/Millis'
        expiresAt:
          oneOf:
            - $ref: '#/components/schemas/Millis'
            - type: 'null'
          description: When it stops covering new work; null for never.
        active:
          type: boolean
          description: 'Still covers new work: not expired, not revoked.'
        grantedUsd:
          $ref: '#/components/schemas/Usd'
        usedUsd:
          $ref: '#/components/schemas/Usd'
        remainingUsd:
          $ref: '#/components/schemas/Usd'
          description: What it has left for new work; 0 once it is no longer active.
      required:
        - id
        - reason
        - grantedAt
        - expiresAt
        - active
        - grantedUsd
        - usedUsd
        - remainingUsd
      additionalProperties: false
    AutoReload:
      type: object
      description: >-
        Auto-reload: when the balance (credit left, less what work in flight
        holds) falls below `thresholdUsd`, the card on file is charged for what
        brings it back to `targetUsd`.
      properties:
        enabled:
          type: boolean
        status:
          type: string
          enum:
            - 'off'
            - 'on'
            - reloading
            - failed
          description: >-
            `reloading`: a charge is in flight. `failed`: the last reload's
            charge did not go through; nothing is charged until an owner saves
            auto-reload again or changes the card.
        thresholdUsd:
          $ref: '#/components/schemas/Usd'
        targetUsd:
          $ref: '#/components/schemas/Usd'
        reloadsToday:
          type: integer
          minimum: 0
          description: Reloads started today (UTC).
        maxReloadsPerDay:
          type: integer
          minimum: 1
        reloadedThisMonthUsd:
          $ref: '#/components/schemas/Usd'
          description: >-
            What auto-reload charged this month (UTC), and what it is charging
            now.
        failureMessage:
          type: string
          description: 'Present when `failed`: why the card did not pay.'
        failedAt:
          $ref: '#/components/schemas/Millis'
        skipped:
          type: object
          description: >-
            Present when a reload was due and not made: the day's 5 were used
            (`daily-cap`), it would pass the enforced monthly budget (`budget`),
            or there is no card (`no-card`).
          properties:
            reason:
              type: string
              enum:
                - daily-cap
                - budget
                - no-card
            message:
              type: string
            at:
              $ref: '#/components/schemas/Millis'
          required:
            - reason
            - message
            - at
          additionalProperties: false
      required:
        - enabled
        - status
        - thresholdUsd
        - targetUsd
        - reloadsToday
        - maxReloadsPerDay
        - reloadedThisMonthUsd
      additionalProperties: false
  responses:
    RateLimited:
      description: >-
        `rate-limit`: this team has sent more than 120 requests in the last 60
        s, or this client address more than 600 (fewer on the routes that need
        no credential). The `Retry-After` header gives the seconds left in the
        window.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          schema:
            type: string
          description: Seconds until the window opens again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A team API key, `sk_offstage_…`, created in the console. Everything it
        touches belongs to its team.
    consoleSession:
      type: apiKey
      in: cookie
      name: oc_session
      description: >-
        The console's session cookie (httpOnly, SameSite=Lax, 30 days), set by
        `signup` and `login`.

````

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