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

# Create a reporting token

> Creates a read-only token for usage reporting. Only organization owners and admins can create one. The token value is returned in this response only and cannot be retrieved later, so store it securely.



## OpenAPI

````yaml /api-reference/cloud-platform-openapi.json post /v1/organizations/{org_id}/reporting-tokens
openapi: 3.1.0
info:
  description: Account, organization, workspace and billing routes of NEAR AI Cloud.
  title: NEAR AI Cloud Platform API
  version: '5'
servers:
  - url: https://cloud-platform.near.ai
    description: NEAR AI Cloud Platform
security: []
paths:
  /v1/organizations/{org_id}/reporting-tokens:
    post:
      tags:
        - Reporting tokens
      summary: Create a reporting token
      description: >-
        Creates a read-only token for usage reporting. Only organization owners
        and admins can create one. The token value is returned in this response
        only and cannot be retrieved later, so store it securely.
      operationId: create_reporting_token
      parameters:
        - description: The organization id (a UUID).
          in: path
          name: org_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReportingTokenRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReportingTokenResponse'
          description: The token was created.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The request is invalid.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid credential.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The signed-in user is not an owner or admin of this organization.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The organization does not exist.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error.
      security:
        - session: []
components:
  schemas:
    CreateReportingTokenRequest:
      additionalProperties: false
      properties:
        expires_at:
          description: Optional expiration time. Must be in the future.
          format: date-time
          type:
            - string
            - 'null'
        name:
          description: A name for the reporting token, 1 to 255 characters.
          type: string
      required:
        - name
      type: object
    CreateReportingTokenResponse:
      properties:
        created_at:
          format: date-time
          type: string
        created_by_user_id:
          format: uuid
          type: string
        expires_at:
          format: date-time
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        last_used_at:
          description: >-
            Approximate last-authentication timestamp, refreshed at most once
            every 15 minutes.
          format: date-time
          type:
            - string
            - 'null'
        name:
          type: string
        organization_id:
          format: uuid
          type: string
        scope:
          description: What the token may read. Currently only `usage:read`.
          example: usage:read
          type: string
        token:
          description: >-
            The reporting token (`rpt-` followed by a secret). It is shown only
            in this response and cannot be retrieved again.
          type: string
        token_prefix:
          description: Non-secret token prefix for display and audit correlation.
          type: string
      required:
        - id
        - organization_id
        - name
        - token
        - token_prefix
        - created_by_user_id
        - created_at
        - scope
      type: object
    ErrorResponse:
      description: The body of every error answer on the user routes.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      type: object
    ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
      required:
        - message
        - type
      type: object
  securitySchemes:
    session:
      bearerFormat: Session token
      description: 'Session token from signing in, sent as `Authorization: Bearer <token>`.'
      scheme: bearer
      type: http

````

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