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

# Create a cost usage export

> Start an asynchronous export of an organization's cost usage data. Only one export can run at a time and only a limited number of exports can be triggered per hour. The generated file is kept for two days.




## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2026-07/admin_2026-07.oas.yaml post /admin/cost-usage-exports
openapi: 3.0.3
info:
  title: Pinecone Admin API
  description: >
    Provides an API for managing a Pinecone organization and its resources,
    including projects, API keys, organization users and invites, service
    accounts, role bindings, and cost usage exports.
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 2026-07
servers:
  - url: https://api.pinecone.io
    description: Production API endpoints
security:
  - BearerAuth: []
tags:
  - name: API Keys
    description: Actions that manage API Keys.
  - name: Organizations
    description: Actions that manage organizations.
  - name: Projects
    description: Actions that manage projects.
  - name: Users
    description: >-
      Actions that manage users. Role bindings are not included in user
      responses; use the Role Bindings endpoints to view them.
  - name: Invites
    description: >-
      Actions that manage invites. An invite's role bindings are first-class and
      appear in the Role Bindings endpoints with `principal_type=invite`.
  - name: Service Accounts
    description: >-
      Actions that manage service accounts. Role bindings are not included in
      service account responses; use the Role Bindings endpoints to view them.
  - name: Role Bindings
    description: Actions that manage role bindings.
  - name: Cost Usage Exports
    description: Actions that export an organization's cost and usage records as a file.
paths:
  /admin/cost-usage-exports:
    post:
      tags:
        - Cost Usage Exports
      summary: Create a cost usage export
      description: >
        Start an asynchronous export of an organization's cost usage data. Only
        one export can run at a time and only a limited number of exports can be
        triggered per hour. The generated file is kept for two days.
      operationId: create_cost_usage_export
      parameters:
        - in: header
          name: X-Pinecone-Api-Version
          description: Required date-based version header
          required: true
          schema:
            default: 2026-07
            type: string
          style: simple
      requestBody:
        description: >-
          The window of usage to cover. Omit the body to export the trailing 30
          complete days.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCostUsageExportRequest'
            examples:
              default-window:
                summary: Trailing 30 complete days
                value: {}
              explicit-window:
                summary: A single calendar month
                value:
                  period_end: '2026-09-01T00:00:00.000Z'
                  period_start: '2026-08-01T00:00:00.000Z'
      responses:
        '202':
          description: The export was accepted and durably recorded. It has not run yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostUsageExport'
              examples:
                accepted:
                  summary: Export accepted
                  value:
                    created_at: '2026-09-02T14:31:07.000Z'
                    data_available_through: null
                    download_url: null
                    download_url_expires_at: null
                    error: null
                    file_expired: false
                    file_expires_at: null
                    finished_at: null
                    format: zip
                    id: 9f2c1a4e-8b3d-4c5f-a1b2-c3d4e5f6a7b8
                    period_end: '2026-09-01T00:00:00.000Z'
                    period_start: '2026-08-01T00:00:00.000Z'
                    row_count: null
                    size_bytes: null
                    started_at: null
                    status: Pending
                    updated_at: '2026-09-02T14:31:07.000Z'
        '400':
          description: >-
            Bad request. The body could not be read, or the window was
            malformed, half-specified, or outside the range that can be
            exported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unreadable-body:
                  summary: Body is not valid JSON for this endpoint
                  value:
                    error:
                      code: INVALID_ARGUMENT
                      message: >-
                        Supply period_start and period_end as YYYY-MM-DD dates,
                        or omit the body to export the trailing 30 days.
                    status: 400
                half-specified-window:
                  summary: Only one bound supplied
                  value:
                    error:
                      code: INVALID_ARGUMENT
                      message: >-
                        period_start was provided without period_end. Provide
                        both dates, or omit both to export the trailing 30 days.
                    status: 400
                inverted-window:
                  summary: Start date is not earlier than the end date
                  value:
                    error:
                      code: INVALID_ARGUMENT
                      message: >-
                        period_start 2026-09-01 must be earlier than period_end
                        2026-08-01. period_end is exclusive.
                    status: 400
                window-too-old:
                  summary: Start date beyond the lookback limit
                  value:
                    error:
                      code: OUT_OF_RANGE
                      message: >-
                        period_start 2025-01-01 is earlier than the 365-day
                        lookback limit. The earliest available date is
                        2025-09-02.
                    status: 400
                window-in-the-future:
                  summary: End date later than today
                  value:
                    error:
                      code: OUT_OF_RANGE
                      message: >-
                        period_end 2027-01-01 is in the future. period_end is
                        exclusive, so the latest value it can take is today,
                        2026-10-01.
                    status: 400
        '401':
          description: 'Unauthorized. Possible causes: Invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Unauthorized
                  value:
                    error:
                      code: UNAUTHENTICATED
                      message: Invalid API key.
                    status: 401
        '403':
          description: >-
            Forbidden. Either the service account lacks the permission, or the
            organization's plan does not include this feature. Both carry
            `PERMISSION_DENIED`, so the message is what tells them apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing-permission:
                  summary: Service account lacks the permission
                  value:
                    error:
                      code: PERMISSION_DENIED
                      message: >-
                        This service account cannot create cost usage exports.
                        Grant it the OrgOwner or OrgBillingAdmin role.
                    status: 403
                plan-not-entitled:
                  summary: Plan does not include cost usage exports
                  value:
                    error:
                      code: PERMISSION_DENIED
                      message: >-
                        Cost usage exports are available to organizations on the
                        Enterprise plan.
                    status: 403
        '409':
          description: >-
            Conflict. The organization already has an export running. Poll that
            one instead of starting another.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                export-already-running:
                  summary: An export is already running
                  value:
                    error:
                      code: ALREADY_EXISTS
                      message: >-
                        Export 9f2c1a4e-8b3d-4c5f-a1b2-c3d4e5f6a7b8 is already
                        running for this organization.
                    status: 409
        '429':
          description: >-
            Rate limit exceeded. The organization has started the maximum number
            of exports for the trailing hour.
          headers:
            Retry-After:
              description: Seconds to wait before creating another export.
              style: simple
              schema:
                example: 3600
                type: integer
                format: int32
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                rate-limited:
                  summary: Hourly creation limit reached
                  value:
                    error:
                      code: RESOURCE_EXHAUSTED
                      message: >-
                        Export creation is limited to 5 per hour per
                        organization. Retry after 3600 seconds.
                    status: 429
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal-server-error:
                  summary: Internal server error
                  value:
                    error:
                      code: UNKNOWN
                      message: Internal server error
                    status: 500
        4XX:
          description: Unexpected error on request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateCostUsageExportRequest:
      description: >-
        The window of usage to cover, given as a half-open range of UTC calendar
        days.
      type: object
      properties:
        period_start:
          example: '2026-08-01T00:00:00.000Z'
          description: >-
            First day of usage to cover, as a UTC calendar day. This bound is
            inclusive, and may be no earlier than 365 days before today.
          type: string
          format: date
        period_end:
          example: '2026-09-01T00:00:00.000Z'
          description: >-
            Day after the last day of usage to cover, as a UTC calendar day.
            This bound is exclusive.
          type: string
          format: date
    CostUsageExport:
      description: >-
        The CostUsageExport describes an asynchronous job that produces a cost
        and usage file for an organization, together with the link used to
        download that file. The file holds cost records that follow the FOCUS
        v1.4 Cost and Usage dataset.
      type: object
      properties:
        id:
          example: 9f2c1a4e-8b3d-4c5f-a1b2-c3d4e5f6a7b8
          description: >-
            Unique identifier for the export. Use it to poll for completion, and
            to identify the export when contacting Pinecone Support.
          type: string
          format: uuid
        status:
          example: Completed
          description: >-
            Status of a cost usage export. `Pending` and `InProgress` mean the
            job is still running; `Completed` and `Failed` are terminal and
            never change afterwards.

            Possible values: `Pending`, `InProgress`, `Completed`, or `Failed`.
          x-enum:
            - Pending
            - InProgress
            - Completed
            - Failed
          type: string
        format:
          example: zip
          description: >-
            Encoding of the generated file. `zip` is a zip archive holding the
            cost records as one or more CSV files whose columns follow the FOCUS
            v1.4 Cost and Usage dataset, alongside a `manifest.json` describing
            the archive. Each CSV starts with a header line and holds at most
            800,000 rows, so larger exports are split across several files,
            named `part-1-of-3.csv` through `part-3-of-3.csv` and ordered by
            those names.

            Every CSV carries these 45 columns, in this order:
            `x_OrganizationId`, `SubAccountId`, `ResourceName`, `ResourceType`,
            `ChargePeriodStart`, `ChargePeriodEnd`, `BillingPeriodStart`,
            `BillingPeriodEnd`, `SkuId`, `ServiceName`, `PricingQuantity`,
            `PricingUnit`, `ConsumedQuantity`, `ConsumedUnit`, `ListUnitPrice`,
            `ListCost`, `ContractedUnitPrice`, `ContractedCost`,
            `EffectiveCost`, `BilledCost`, `BillingCurrency`, `PricingCategory`,
            `ChargeCategory`, `ChargeClass`, `ChargeFrequency`,
            `ServiceCategory`, `ServiceSubcategory`, `RegionId`, `RegionName`,
            `HostProviderName`, `ServiceProviderName`, `InvoiceIssuerName`,
            `InvoiceId`, `BillingAccountId`, `BillingAccountName`,
            `BillingAccountType`, `SubAccountName`, `SubAccountType`,
            `ResourceId`, `SkuPriceId`, `SkuMeter`, `ChargeDescription`,
            `x_CloudId`, `Tags`, `x_ProjectMetadata`.

            Columns prefixed with `x_` are Pinecone extensions, which is how
            FOCUS requires a provider to name a column the specification does
            not define. `SubAccountId` and `SubAccountName` identify the
            Pinecone project, and `BillingAccountId` identifies the organization
            that is invoiced.

            Rows are ordered by `ChargePeriodStart`, `SubAccountName`,
            `ResourceName`, `ChargeDescription`, `SkuId`, `ResourceId`, across
            the archive as a whole rather than within each file. `InvoiceId` is
            provisional while its billing period is still open, so it may change
            for a period that has not yet closed.

            Possible values: `zip`.
          x-enum:
            - zip
          type: string
        period_start:
          example: '2026-08-01T00:00:00.000Z'
          description: >-
            First day of usage covered by the export, as a UTC calendar day.
            This bound is inclusive.
          type: string
          format: date
        period_end:
          example: '2026-09-01T00:00:00.000Z'
          description: >-
            Day after the last day of usage covered by the export, as a UTC
            calendar day. This bound is exclusive.
          type: string
          format: date
        data_available_through:
          nullable: true
          example: '2026-08-31T00:00:00.000Z'
          description: >-
            Last day for which the billing warehouse holds complete data,
            recorded when the export runs to describe the contents of the
            generated file. `null` until then. Cost data lags by roughly two
            days.
          type: string
          format: date
        row_count:
          nullable: true
          example: 48213
          description: >-
            Number of line items across all CSV files in the archive, excluding
            header lines.
          type: integer
          format: int64
        size_bytes:
          nullable: true
          example: 4183902
          description: Length of the zip archive, in bytes.
          type: integer
          format: int64
        download_url:
          nullable: true
          example: >-
            https://storage.googleapis.com/example-bucket/cost_usage_exports/export.zip?X-Goog-Expires=3600
          description: >-
            Signed link to the generated file, generated fresh each time a
            single export is read and valid for one hour. Treat the link as a
            secret: anyone holding it can download the file. Do not store it or
            pass it between systems; read the export again for a new link.
            Always `null` in list responses.
          type: string
          format: uri
        download_url_expires_at:
          nullable: true
          example: '2026-09-02T15:36:11.000Z'
          description: >-
            When `download_url` stops working: one hour after the link was
            generated, or `file_expires_at`, whichever comes first. Read the
            export again for a new link. Always `null` in list responses.
          type: string
          format: date-time
        file_expires_at:
          nullable: true
          example: '2026-09-04T14:35:52.000Z'
          description: >-
            When the generated file is deleted, two days after the export
            finished. The file cannot be re-delivered afterwards; create another
            export instead.
          type: string
          format: date-time
        file_expired:
          example: false
          description: >-
            Whether the generated file has been deleted. Check this rather than
            `status`: a `Completed` export whose file has expired can no longer
            be downloaded.
          type: boolean
        error:
          $ref: '#/components/schemas/CostUsageExportError'
        created_at:
          example: '2026-09-02T14:31:07.000Z'
          description: When the export was accepted.
          type: string
          format: date-time
        started_at:
          nullable: true
          example: '2026-09-02T14:31:19.000Z'
          description: When the export job began running.
          type: string
          format: date-time
        finished_at:
          nullable: true
          example: '2026-09-02T14:35:52.000Z'
          description: >-
            When the export job finished running, either successfully or with an
            error.
          type: string
          format: date-time
        updated_at:
          example: '2026-09-02T14:35:52.000Z'
          description: When the export was last updated.
          type: string
          format: date-time
      required:
        - id
        - status
        - format
        - period_start
        - period_end
        - file_expired
        - created_at
        - updated_at
    ErrorResponse:
      example:
        error:
          code: QUOTA_EXCEEDED
          message: >-
            The index exceeds the project quota of 5 pods by 2 pods. Upgrade
            your account or change the project settings to increase the quota.
        status: 429
      description: The response shape used for all error responses.
      type: object
      properties:
        status:
          example: 500
          description: The HTTP status code of the error.
          type: integer
        error:
          example:
            code: INVALID_ARGUMENT
            message: >-
              Index name must contain only lowercase alphanumeric characters or
              hyphens, and must not begin or end with a hyphen.
          description: Detailed information about the error that occurred.
          type: object
          properties:
            code:
              description: >-
                The error code.


                Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`,
                `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`,
                `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`,
                `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`,
                `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`,
                `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
              x-enum:
                - OK
                - UNKNOWN
                - INVALID_ARGUMENT
                - DEADLINE_EXCEEDED
                - QUOTA_EXCEEDED
                - NOT_FOUND
                - ALREADY_EXISTS
                - PERMISSION_DENIED
                - UNAUTHENTICATED
                - RESOURCE_EXHAUSTED
                - FAILED_PRECONDITION
                - ABORTED
                - OUT_OF_RANGE
                - UNIMPLEMENTED
                - INTERNAL
                - UNAVAILABLE
                - DATA_LOSS
                - FORBIDDEN
                - UNPROCESSABLE_ENTITY
              type: string
            message:
              example: >-
                Index name must contain only lowercase alphanumeric characters
                or hyphens, and must not begin or end with a hyphen.
              type: string
            details:
              description: >-
                Additional information about the error. This field is not
                guaranteed to be present.
              type: object
          required:
            - code
            - message
      required:
        - status
        - error
    CostUsageExportError:
      nullable: true
      description: Why an export failed.
      type: object
      properties:
        code:
          example: DEADLINE_EXCEEDED
          description: >-
            Machine-readable classification of the failure. `DEADLINE_EXCEEDED`
            means the export ran out of time and a shorter window may succeed;
            `INTERNAL` covers every other failure and is worth retrying once.

            Possible values: `DEADLINE_EXCEEDED` or `INTERNAL`.
          x-enum:
            - DEADLINE_EXCEEDED
            - INTERNAL
          type: string
        message:
          example: >-
            The export did not finish within the time budget. Create a new
            export, or request a shorter window.
          description: Human-readable explanation of what went wrong and what to try next.
          type: string
      required:
        - code
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        An [access
        token](https://docs.pinecone.io/guides/organizations/manage-service-accounts#retrieve-an-access-token)
        must be provided in the `Authorization` header using the `Bearer`
        scheme.

````