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

# Get user activity grouped by endpoint

> Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.



## OpenAPI

````yaml /openapi.json get /activity
openapi: 3.1.0
info:
  title: Nemonist API
  version: 1.0.0
  description: >-
    OpenRouter-compatible API with durable per-workspace memory. Point any
    OpenRouter client at https://nemonist.com/api/v1 with a Nemonist key
    (sk-nm-...). Chat completions, Responses and Messages requests from a
    workspace carrying a .nemonist/key get its memory; every other request is
    answered as OpenRouter would.
  contact:
    name: Nemonist
    url: https://nemonist.com
servers:
  - url: https://nemonist.com/api/v1
    description: Production
security:
  - apiKey: []
tags:
  - description: API key management endpoints
    name: API Keys
  - description: Analytics and usage endpoints
    name: Analytics
  - description: Anthropic Messages endpoints
    name: Anthropic Messages
  - description: BYOK endpoints
    name: BYOK
  - description: Benchmarks endpoints
    name: Benchmarks
  - description: Chat completion endpoints
    name: Chat
  - description: Credit management endpoints
    name: Credits
  - description: >-
      Public OpenRouter usage datasets. Data returned by these endpoints is
      licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/):
      reuse and republish it, including commercially, with attribution to
      OpenRouter.
    name: Datasets
  - description: Text embedding endpoints
    name: Embeddings
  - description: Endpoint information
    name: Endpoints
  - name: Folders
    description: >-
      Your memory folders, over your account's API key: read, export, upload,
      and manage keys.
  - description: Generation history endpoints
    name: Generations
  - description: Guardrails endpoints
    name: Guardrails
  - description: Images endpoints
    name: Images
  - name: Memory
    description: Nemonist's per-workspace memory.
  - name: Model runs
    description: Run models (physics and others) on inputs; one contract for every model
  - description: Model information endpoints
    name: Models
  - description: OAuth authentication endpoints
    name: OAuth
  - description: Organization endpoints
    name: Organization
  - description: Private Endpoints endpoints
    name: Private Endpoints
  - description: Provider information endpoints
    name: Providers
  - description: Rerank endpoints
    name: Rerank
  - description: OpenAI-compatible Responses API endpoints
    name: Responses
  - description: Speech-to-text endpoints
    name: STT
    x-displayName: Transcriptions
  - description: >-
      System One endpoints for models such as Jev, compatible with the TypeSafe
      SDKs. See https://openrouter.ai/docs/guides/community/typesafe-sdk.
    name: SystemOne
    x-displayName: System One
  - description: Text-to-speech endpoints
    name: TTS
    x-displayName: Speech
  - description: Video Generation endpoints
    name: Video Generation
  - description: Workspaces endpoints
    name: Workspaces
  - name: beta.responses
    description: >-
      Deprecated alias of responses. Use responses instead; scheduled for
      removal (sunset date TBD).
paths:
  /activity:
    parameters:
      - $ref: '#/components/parameters/AppIdentifier'
      - $ref: '#/components/parameters/AppDisplayName'
      - $ref: '#/components/parameters/AppCategories'
    get:
      tags:
        - Analytics
      summary: Get user activity grouped by endpoint
      description: >-
        Returns user activity data grouped by endpoint for the last 30
        (completed) UTC days. Pass `workspace_id` to scope the response to a
        single workspace. Pass `group_by=workspace` to split each row per
        workspace and include `workspace_id` on every item; by default rows are
        aggregated across workspaces and `workspace_id` is not returned.
        Activity recorded before workspace resolution existed is permanently
        attributed to the account default workspace (no backfill is possible).
        [Management key](/docs/guides/overview/auth/management-api-keys)
        required.
      operationId: getUserActivity
      parameters:
        - description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
          in: query
          name: date
          required: false
          schema:
            description: >-
              Filter by a single UTC date in the last 30 days (YYYY-MM-DD
              format).
            example: '2025-08-24'
            type: string
        - description: >-
            Filter by API key hash (SHA-256 hex string, as returned by the keys
            API).
          in: query
          name: api_key_hash
          required: false
          schema:
            description: >-
              Filter by API key hash (SHA-256 hex string, as returned by the
              keys API).
            example: abc123def456...
            type: string
        - description: >-
            Filter by org member user ID. Only applicable for organization
            accounts.
          in: query
          name: user_id
          required: false
          schema:
            description: >-
              Filter by org member user ID. Only applicable for organization
              accounts.
            example: user_abc123
            type: string
        - description: >-
            Set to 'workspace' to split each row per workspace and include
            `workspace_id` on every item. Omitted by default, in which case rows
            are aggregated across workspaces (by date, model, and endpoint) and
            `workspace_id` is not returned — preserving the historical response
            shape.
          in: query
          name: group_by
          required: false
          schema:
            description: >-
              Set to 'workspace' to split each row per workspace and include
              `workspace_id` on every item. Omitted by default, in which case
              rows are aggregated across workspaces (by date, model, and
              endpoint) and `workspace_id` is not returned — preserving the
              historical response shape.
            enum:
              - workspace
            example: workspace
            type: string
        - description: >-
            Filter by workspace ID. Returns only activity attributed to that
            workspace. The workspace must belong to the authenticated account.
          in: query
          name: workspace_id
          required: false
          schema:
            description: >-
              Filter by workspace ID. Returns only activity attributed to that
              workspace. The workspace must belong to the authenticated account.
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  - byok_usage_inference: 0.012
                    cached_tokens: 10
                    completion_tokens: 125
                    date: '2025-08-24'
                    endpoint_id: 550e8400-e29b-41d4-a716-446655440000
                    model: openai/gpt-4.1
                    model_permaslug: openai/gpt-4.1-2025-04-14
                    prompt_tokens: 50
                    provider_name: OpenAI
                    reasoning_tokens: 25
                    requests: 5
                    usage: 0.015
              schema:
                $ref: '#/components/schemas/ActivityResponse'
          description: Returns user activity data grouped by endpoint
        '400':
          content:
            application/json:
              example:
                error:
                  code: 400
                  message: Invalid request parameters
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
          description: Bad Request - Invalid request parameters or malformed input
        '401':
          content:
            application/json:
              example:
                error:
                  code: 401
                  message: Missing Authentication header
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized - Authentication required or invalid credentials
        '403':
          content:
            application/json:
              example:
                error:
                  code: 403
                  message: Only management keys can perform this operation
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
          description: Forbidden - Authentication successful but insufficient permissions
        '404':
          content:
            application/json:
              example:
                error:
                  code: 404
                  message: Resource not found
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
          description: Not Found - Resource does not exist
        '500':
          content:
            application/json:
              example:
                error:
                  code: 500
                  message: Internal Server Error
              schema:
                $ref: '#/components/schemas/InternalServerResponse'
          description: Internal Server Error - Unexpected server error
        '503':
          description: 'Nemonist: the account service is temporarily unavailable; retry.'
          content:
            application/json:
              example:
                error:
                  code: 500
                  message: Internal Server Error
              schema:
                $ref: '#/components/schemas/InternalServerResponse'
components:
  parameters:
    AppIdentifier:
      name: HTTP-Referer
      in: header
      schema:
        type: string
      description: >
        The app identifier should be your app's URL and is used as the primary
        identifier for rankings.

        This is used to track API usage per application.
    AppDisplayName:
      name: X-OpenRouter-Title
      in: header
      x-speakeasy-name-override: appTitle
      schema:
        type: string
      description: >
        The app display name allows you to customize how your app appears in
        OpenRouter's dashboard.
    AppCategories:
      name: X-OpenRouter-Categories
      in: header
      x-speakeasy-name-override: appCategories
      schema:
        type: string
      description: >
        Comma-separated list of app categories (e.g. "cli-agent,cloud-agent").
        Used for marketplace rankings.
  schemas:
    ActivityResponse:
      example:
        data:
          - byok_usage_inference: 0.012
            cached_tokens: 10
            completion_tokens: 125
            date: '2025-08-24'
            endpoint_id: 550e8400-e29b-41d4-a716-446655440000
            model: openai/gpt-4.1
            model_permaslug: openai/gpt-4.1-2025-04-14
            prompt_tokens: 50
            provider_name: OpenAI
            reasoning_tokens: 25
            requests: 5
            usage: 0.015
      properties:
        data:
          description: List of activity items
          items:
            $ref: '#/components/schemas/ActivityItem'
          type: array
      required:
        - data
      type: object
    BadRequestResponse:
      description: Bad Request - Invalid request parameters or malformed input
      example:
        error:
          code: 400
          message: Invalid request parameters
      properties:
        error:
          $ref: '#/components/schemas/BadRequestResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    UnauthorizedResponse:
      description: Unauthorized - Authentication required or invalid credentials
      example:
        error:
          code: 401
          message: Missing Authentication header
      properties:
        error:
          $ref: '#/components/schemas/UnauthorizedResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    ForbiddenResponse:
      description: Forbidden - Authentication successful but insufficient permissions
      example:
        error:
          code: 403
          message: Only management keys can perform this operation
      properties:
        error:
          $ref: '#/components/schemas/ForbiddenResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    NotFoundResponse:
      description: Not Found - Resource does not exist
      example:
        error:
          code: 404
          message: Resource not found
      properties:
        error:
          $ref: '#/components/schemas/NotFoundResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    InternalServerResponse:
      description: Internal Server Error - Unexpected server error
      example:
        error:
          code: 500
          message: Internal Server Error
      properties:
        error:
          $ref: '#/components/schemas/InternalServerResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    ActivityItem:
      example:
        byok_usage_inference: 0.012
        cached_tokens: 10
        completion_tokens: 125
        date: '2025-08-24'
        endpoint_id: 550e8400-e29b-41d4-a716-446655440000
        model: openai/gpt-4.1
        model_permaslug: openai/gpt-4.1-2025-04-14
        prompt_tokens: 50
        provider_name: OpenAI
        reasoning_tokens: 25
        requests: 5
        usage: 0.015
      properties:
        byok_usage_inference:
          description: BYOK inference cost in USD (external credits spent)
          example: 0.012
          format: double
          type: number
        cached_tokens:
          description: >-
            Total prompt tokens read from the provider prompt cache (cache
            hits). Generally a subset of `prompt_tokens`; for replayed
            response-cache hits the provider may report the two counters over
            disjoint token sets, so `cached_tokens` can exceed `prompt_tokens`.
          example: 10
          type: integer
        completion_tokens:
          description: Total completion tokens generated
          example: 125
          type: integer
        date:
          description: Date of the activity (YYYY-MM-DD format)
          example: '2025-08-24'
          type: string
        endpoint_id:
          description: Unique identifier for the endpoint
          type: string
        model:
          description: Model slug (e.g., "openai/gpt-4.1")
          example: openai/gpt-4.1
          type: string
        model_permaslug:
          description: Model permaslug (e.g., "openai/gpt-4.1-2025-04-14")
          example: openai/gpt-4.1-2025-04-14
          type: string
        prompt_tokens:
          description: Total prompt tokens used
          example: 50
          type: integer
        provider_name:
          description: Name of the provider serving this endpoint
          example: OpenAI
          type: string
        reasoning_tokens:
          description: Total reasoning tokens used
          example: 25
          type: integer
        requests:
          description: Number of requests made
          example: 5
          type: integer
        usage:
          description: Total cost in USD (OpenRouter credits spent)
          example: 0.015
          format: double
          type: number
        workspace_id:
          description: >-
            ID of the workspace this activity is attributed to. Only present
            when `group_by=workspace` is passed; the response is then split per
            workspace. Activity recorded before workspace resolution existed is
            attributed to the account default workspace.
          type: string
      required:
        - date
        - model
        - model_permaslug
        - endpoint_id
        - provider_name
        - usage
        - byok_usage_inference
        - requests
        - prompt_tokens
        - completion_tokens
        - reasoning_tokens
        - cached_tokens
      type: object
    BadRequestResponseErrorData:
      description: Error data for BadRequestResponse
      example:
        code: 400
        message: Invalid request parameters
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 400.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    UnauthorizedResponseErrorData:
      description: Error data for UnauthorizedResponse
      example:
        code: 401
        message: Missing Authentication header
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 401.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    ForbiddenResponseErrorData:
      description: Error data for ForbiddenResponse
      example:
        code: 403
        message: Only management keys can perform this operation
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 403.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    NotFoundResponseErrorData:
      description: Error data for NotFoundResponse
      example:
        code: 404
        message: Resource not found
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 404.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    InternalServerResponseErrorData:
      description: Error data for InternalServerResponse
      example:
        code: 500
        message: Internal Server Error
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 500.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Nemonist key (sk-nm-...) as a bearer token in the Authorization
        header.

````

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