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

> ## Agent Instructions
> To act on Atlan objects, use the Atlan MCP server at https://api.atlan.com/mcp or the SDK. To install or publish skills from a terminal, use the `aireg` CLI; `aireg --map json` prints its command map. The `atlanai` CLI is deprecated. Run a read-only identity check before any write.
> The docs MCP server at /mcp searches these docs only. It cannot read or change Atlan objects.
> SDK packages: Python `atlanai` (PyPI) and TypeScript `@atlanai/sdk` (npm). Show Python first, then TypeScript.
> These docs cover Atlan Trident, Atlan's hosted product. AI Registry and Agent Registry are its earlier names. Registry OSS is Atlan's open-source agent registry: the registry specification and its aireg CLI, with their own public repository, docs and release notes; /open-source on this site links them. Registry OSS is open source; Atlan Trident is not. Answer generic aireg or specification questions from the project's docs, and use these docs for Atlan-specific setup such as the Atlan adapter, sign-in and workspaces.
> Atlan offers a second product, the Agentic Data Catalog: Atlan's enterprise context layer, covering the data catalog, connectors, lineage, data governance and glossary. It is documented at https://docs.atlan.com; answer questions about it from those docs, not these.

# Query account-wide use statistics for a metric or saved query



## OpenAPI

````yaml /public-openapi.json post /metric/v1/artifacts/{artifact_id}/traces/stats/query
openapi: 3.1.0
info:
  title: Atlan public API
  version: current
  description: >-
    Public HTTP API reference for Registry, Skills, Agents, outputs, files, MCP
    servers and tools, Model Gateway, and OTLP telemetry ingestion.
servers:
  - url: https://api.atlan.com
    description: Atlan API base URL
security:
  - bearer: []
tags:
  - name: Core
  - name: Skill
  - name: Agent
  - name: Files
  - name: Knowledge
  - name: MCP
  - name: Observability
  - name: Credentials
  - name: Store
  - name: Apps
  - name: Evals
  - name: Ontologies
  - name: Ontology bindings
  - name: Slack
  - name: GitHub
  - name: Repositories
  - name: Models
paths:
  /metric/v1/artifacts/{artifact_id}/traces/stats/query:
    post:
      tags:
        - Core
      summary: Query account-wide use statistics for a metric or saved query
      operationId: metric.queryArtifactUseStats
      parameters:
        - in: path
          name: artifact_id
          required: true
          schema:
            type: string
        - name: Content-Encoding
          in: header
          required: false
          schema:
            type: string
            enum:
              - base64
              - gzip, base64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/metric-gateway-TraceStatsRequest'
        required: true
      responses:
        '200':
          description: HTTP 200 response.
        '400':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ValidationProblem'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - invalid_base64
                          - invalid_gzip
                          - invalid_json
          description: HTTP 400 response.
        '401':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - alg_mismatch
                          - alg_not_allowed
                          - audience_mismatch
                          - invalid_api_key
                          - missing_identity
                          - missing_org
                          - missing_user
                          - signature_invalid
                          - token_expired
                          - token_malformed
                          - token_missing
                          - token_not_yet_valid
                          - token_rejected
                          - token_service_account_unbound
                          - unauthorized
                          - unknown_account
                          - unknown_key
                          - untrusted_issuer
          description: HTTP 401 response.
        '403':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - access_denied
                          - account_suspended
                          - forbidden
                          - platform_principal_refused
          description: HTTP 403 response.
        '404':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - not_found
          description: HTTP 404 response.
        '413':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - compressed_payload_too_large
                          - decompressed_payload_too_large
                          - payload_too_large
          description: HTTP 413 response.
        '415':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - unsupported_content_encoding
                          - unsupported_content_type
          description: HTTP 415 response.
        '422':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ValidationProblem'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_failed
          description: HTTP 422 response.
        '500':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - internal_error
          description: HTTP 500 response.
        '503':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - auth_unavailable
                          - service_overloaded
          description: HTTP 503 response.
        '504':
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/metric-ProblemDetails'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - request_timeout
          description: HTTP 504 response.
components:
  schemas:
    metric-gateway-TraceStatsRequest:
      properties:
        bucket:
          oneOf:
            - $ref: '#/components/schemas/metric-gateway-TraceStatsBucket'
            - type: 'null'
        compare:
          oneOf:
            - $ref: '#/components/schemas/metric-gateway-TraceStatsCompareMode'
            - type: 'null'
        end_time_unix_seconds:
          type: integer
          format: int64
        queries:
          items:
            $ref: '#/components/schemas/metric-gateway-TraceStatsPanelQuery'
          type: array
        request_type:
          $ref: '#/components/schemas/metric-gateway-TraceStatsRequestType'
        start_time_unix_seconds:
          type: integer
          format: int64
        workspace_id:
          type:
            - string
            - 'null'
      required:
        - start_time_unix_seconds
        - end_time_unix_seconds
        - request_type
        - queries
      type: object
    metric-ValidationProblem:
      allOf:
        - $ref: '#/components/schemas/metric-ProblemDetails'
        - properties:
            allowed_values:
              type: array
              items:
                type: string
            field:
              type: string
          type: object
    metric-ProblemDetails:
      type: object
      required:
        - title
        - status
        - detail
        - code
      properties:
        code:
          type: string
        detail:
          type: string
        status:
          type: integer
          format: int32
          minimum: 0
        title:
          type: string
        trace_id:
          type:
            - string
            - 'null'
    metric-gateway-TraceStatsBucket:
      enum:
        - day
        - week
      type: string
    metric-gateway-TraceStatsCompareMode:
      enum:
        - none
        - previous_period
      type: string
    metric-gateway-TraceStatsPanelQuery:
      properties:
        filters:
          items:
            $ref: '#/components/schemas/metric-gateway-TraceStatsFilter'
          type: array
        group_by:
          items:
            $ref: '#/components/schemas/metric-gateway-TraceStatsGroupBy'
          type: array
        limit:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        measure:
          $ref: '#/components/schemas/metric-gateway-TraceStatsMeasure'
        name:
          type: string
        order:
          oneOf:
            - $ref: '#/components/schemas/metric-gateway-TraceStatsOrder'
            - type: 'null'
      required:
        - name
        - measure
      type: object
    metric-gateway-TraceStatsRequestType:
      enum:
        - scalar
        - table
        - time_series
      type: string
    metric-gateway-TraceStatsFilter:
      properties:
        key:
          $ref: '#/components/schemas/metric-gateway-TraceStatsGroupBy'
        op:
          $ref: '#/components/schemas/metric-gateway-TraceStatsFilterOperator'
        value:
          $ref: '#/components/schemas/metric-gateway-TraceStatsFilterValue'
      required:
        - key
        - op
      type: object
    metric-gateway-TraceStatsGroupBy:
      enum:
        - repository
        - branch
        - revision
        - harness
        - skill
        - skill_version
        - command
        - mcp
        - tool
        - model
        - user
        - experiment
        - score_name
        - scorer
        - scorer_version
        - artifact
        - artifact_version
        - artifact_release
        - artifact_stage
      type: string
    metric-gateway-TraceStatsMeasure:
      enum:
        - sessions
        - traces
        - spans
        - skill_invocations
        - tool_calls
        - tokens
        - uncached_input_tokens
        - cached_input_tokens
        - cache_write_tokens
        - output_tokens
        - active_users
        - active_visitors
        - error_rate
        - success_rate
        - tokens_per_trace
        - cost
        - latency_p50
        - latency_p90
        - latency_p99
        - score_value
        - scores
        - artifact_uses
        - artifact_serves
      type: string
    metric-gateway-TraceStatsOrder:
      properties:
        by:
          $ref: '#/components/schemas/metric-gateway-TraceStatsOrderBy'
        direction:
          $ref: '#/components/schemas/metric-gateway-TraceStatsOrderDirection'
      required:
        - by
        - direction
      type: object
    metric-gateway-TraceStatsFilterOperator:
      enum:
        - eq
        - neq
        - in
        - exists
        - not_exists
      type: string
    metric-gateway-TraceStatsFilterValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
        - type: array
          items:
            type: string
        - type: array
          items:
            type: number
            format: double
        - type: array
          items:
            type: boolean
    metric-gateway-TraceStatsOrderBy:
      enum:
        - value
        - name
      type: string
    metric-gateway-TraceStatsOrderDirection:
      enum:
        - asc
        - desc
      type: string
  securitySchemes:
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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