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

# Export AI credit usage to CSV

> Writes a CSV of one view of the app's AI Usage page: `users` (usage by person; admins only, needs settings:update as well), `flows` (usage by flow) or `log` (every call, newest first, a person by id), up to 10,000 rows (`truncated` says when more matched). Covers the current contract period unless `start` or `end` sets a window of its own; `tier` keeps one billing tier. The answer is a signed `url` that downloads the file for an hour (anyone holding it can: give it only to the person who asked), and the first rows as `preview`.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/credits/export
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/credits/export:
    post:
      tags:
        - credits
      summary: Export AI credit usage to CSV
      description: >-
        Writes a CSV of one view of the app's AI Usage page: `users` (usage by
        person; admins only, needs settings:update as well), `flows` (usage by
        flow) or `log` (every call, newest first, a person by id), up to 10,000
        rows (`truncated` says when more matched). Covers the current contract
        period unless `start` or `end` sets a window of its own; `tier` keeps
        one billing tier. The answer is a signed `url` that downloads the file
        for an hour (anyone holding it can: give it only to the person who
        asked), and the first rows as `preview`.
      operationId: credits_export
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                end:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Exclusive. With `start` or alone, replaces the contract
                    period; no offset is UTC
                  title: End
                start:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Inclusive. With `end` or alone, replaces the contract
                    period; no offset is UTC
                  title: Start
                tier:
                  anyOf:
                    - maximum: 3
                      minimum: 1
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    Only calls billed at this tier: 1 (LLM workflows), 2
                    (agents), 3 (documents)
                  title: Tier
                view:
                  description: >-
                    What the file lists: `users` (usage by person; needs
                    settings:update), `flows` (usage by flow) or `log` (every
                    call, newest first)
                  enum:
                    - users
                    - flows
                    - log
                  title: View
                  type: string
              required:
                - view
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportFile'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    ExportFile:
      properties:
        column_count:
          description: How many columns the file has
          title: Column Count
          type: integer
        columns:
          description: >-
            The file's columns: the record's standard keys, then its custom
            field keys. An MCP answer lists the first ones that fit it; the file
            always has every column
          items:
            type: string
          title: Columns
          type: array
        expires_at:
          description: When the link stops working, ISO 8601 UTC
          title: Expires At
          type: string
        file_name:
          title: File Name
          type: string
        object:
          description: The records exported, e.g. accounts
          title: Object
          type: string
        preview:
          description: >-
            The first rows (up to 10), each with only its non-empty cells, as
            the file has them; an MCP answer holds as many as fit it
          items:
            additionalProperties:
              type: string
            type: object
          title: Preview
          type: array
        rows:
          description: Records in the file
          title: Rows
          type: integer
        truncated:
          description: >-
            More records matched than the file holds (at most `max_rows`, 10,000
            at most): narrow the filter or the view to export the rest
          title: Truncated
          type: boolean
        url:
          description: >-
            A signed link that downloads the CSV with a plain GET for 60
            minutes; anyone holding it can, so treat it as a secret and give it
            only to the person who asked
          title: Url
          type: string
      required:
        - object
        - rows
        - truncated
        - column_count
        - columns
        - file_name
        - url
        - expires_at
      title: ExportFile
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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