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

# API Usage Breakdown

> Retrieve a breakdown of API requests and credits consumed within a date range, grouped both by individual API key (`by_key`) and by endpoint (`by_endpoint`). Useful for identifying the highest-traffic keys and the most credit-intensive endpoints across the workspace.



## OpenAPI

````yaml en-openapi POST /api_keys/usage/breakdown
openapi: 3.0.0
info:
  description: >-
    The Pubrio API is used to search, preview and enrich Contacts and Accounts.
    Pubrio database provides extensive B2B contacts and sales intelligence data.
  version: 1.0.0
  title: Pubrio OpenAPI
  termsOfService: https://pubrio.com/en/terms-of-service
  contact:
    email: king.lai@pubrio.com
    name: King Lai
    url: https://pubrio.com/en/get-in-touch
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.pubrio.com
security:
  - pubrio_api_key: []
tags:
  - name: Profile
    description: Workspace profile information and usage statistics
  - name: Enrichment
    description: Enrich people and company records with detailed B2B data
  - name: Lookalike
    description: Find companies similar to a given company
  - name: Search
    description: Search for people, companies, jobs, news, and advertisements with filters
  - name: Lookup
    description: >-
      Look up detailed information for specific people, companies, jobs, news,
      advertisements, and technologies
  - name: LinkedIn
    description: Look up people and company data via LinkedIn profile URLs
  - name: Redeem
    description: Redeem credits to unlock people contact details (single and batch)
  - name: Channels
    description: Manage outreach channel templates (create, update, delete, list)
  - name: Monitor
    description: Create and manage data monitors with webhooks, statistics, and processing
  - name: Filters
    description: >-
      Retrieve available filter values for search parameters (technologies,
      locations, verticals, etc.)
  - name: API Keys
    description: List and inspect API request logs and usage analytics for API keys
externalDocs:
  description: >-
    The Pubrio API is used to search, preview and enrich Contacts and Accounts.
    Pubrio database provides extensive B2B contacts and sales intelligence data.
  url: https://docs.pubrio.com
paths:
  /api_keys/usage/breakdown:
    post:
      tags:
        - API Keys
      summary: Get API usage breakdown by key and endpoint
      description: >-
        Retrieve a breakdown of API requests and credits consumed within a date
        range, grouped both by individual API key (`by_key`) and by endpoint
        (`by_endpoint`). Useful for identifying the highest-traffic keys and the
        most credit-intensive endpoints across the workspace.
      operationId: api_keys_get_usage_breakdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - start_date
                - end_date
              properties:
                profile_id:
                  $ref: '#/components/schemas/profile_id'
                start_date:
                  type: string
                  example: '2026-05-01'
                  description: >-
                    Start of the date range in `YYYY-MM-DD` format (interpreted
                    in the workspace timezone).
                end_date:
                  type: string
                  example: '2026-05-14'
                  description: >-
                    End of the date range in `YYYY-MM-DD` format (interpreted in
                    the workspace timezone).
                keys:
                  type: array
                  items:
                    type: string
                  description: >-
                    Optional list of masked API key identifiers (e.g.
                    `0••••••••••••••••f39`) to restrict the results to specific
                    keys. Use the masked values returned by `/api_keys` or by
                    the `masked_authentication` field on a log entry.
                log_type_slugs:
                  type: array
                  items:
                    type: string
                  description: >-
                    Optional list of log type slugs (e.g. `people_search`,
                    `company_search`, `people_redeem`) to restrict the results
                    to specific endpoints.
      responses:
        '200':
          description: Successful response containing the API usage breakdown.
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: object
                    properties:
                      filters:
                        type: object
                        description: >-
                          Echo of the request filters used to produce this
                          response, with empty values stripped.
                        additionalProperties: true
                  data:
                    type: object
                    properties:
                      by_key:
                        type: array
                        description: >-
                          Usage grouped by API key (top 100, ordered by credits
                          then requests).
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: Masked API key identifier.
                            requests:
                              type: integer
                              description: Number of requests made with this key.
                            credits:
                              type: number
                              description: Credits consumed by this key.
                            last_used:
                              type: string
                              nullable: true
                              description: >-
                                Timestamp of the most recent request from this
                                key, or `null` if never used in the range.
                            percent_of_requests:
                              type: number
                              description: Share of total requests, as a percentage.
                            percent_of_credits:
                              type: number
                              description: Share of total credits, as a percentage.
                      by_endpoint:
                        type: array
                        description: >-
                          Usage grouped by endpoint (top 100, ordered by credits
                          then requests).
                        items:
                          type: object
                          properties:
                            slug:
                              type: string
                              nullable: true
                              description: >-
                                Log type slug. `null` for requests not mapped to
                                a billable log type.
                            name:
                              type: string
                              description: Human-readable log type name.
                            requests:
                              type: integer
                            credits:
                              type: number
                            cost_per_call:
                              type: number
                              description: Average credits per request for this endpoint.
                            percent_of_requests:
                              type: number
                              description: Share of total requests, as a percentage.
                            percent_of_credits:
                              type: number
                              description: Share of total credits, as a percentage.
                      totals:
                        type: object
                        properties:
                          credits:
                            type: number
                          requests:
                            type: integer
              example:
                metadata:
                  filters:
                    start_date: '2026-04-01'
                    end_date: '2026-05-14'
                data:
                  by_key:
                    - name: 2••••••••••••••••a37
                      requests: 929
                      credits: 42766
                      last_used: '2026-05-05 11:09:42.508'
                      percent_of_requests: 17.892
                      percent_of_credits: 99.425
                    - name: 0••••••••••••••••f39
                      requests: 175
                      credits: 187
                      last_used: '2026-05-14 12:04:21.651'
                      percent_of_requests: 3.37
                      percent_of_credits: 0.434
                  by_endpoint:
                    - slug: people_redeem
                      name: Redeem People
                      requests: 4088
                      credits: 41215
                      cost_per_call: 10.08
                      percent_of_requests: 78.73
                      percent_of_credits: 95.82
                    - slug: people_search
                      name: People Search
                      requests: 368
                      credits: 1101
                      cost_per_call: 2.99
                      percent_of_requests: 7.08
                      percent_of_credits: 2.55
                  totals:
                    credits: 43013
                    requests: 5192
        '400':
          $ref: '#/components/responses/general_error'
        '429':
          $ref: '#/components/responses/rate_limit_error'
        '500':
          $ref: '#/components/responses/server_error'
components:
  schemas:
    profile_id:
      type: integer
      description: >-
        Optional. An identifier for the user profile (workspace) making the
        request. This is no longer required as the API key already includes your
        workspace information. If provided, it helps in associating the lookup
        with a specific user, allowing for data retrieval and credit tracking. 

         Check out `user details` endpoints under the Profile tab for more information.
  responses:
    general_error:
      description: >-
        Bad request. The request was malformed or contained invalid parameters.
        Check the error code and message for details.
      content:
        application/json:
          schema:
            required:
              - code
              - message
              - details
            type: object
            properties:
              code:
                example: 40001
                type: integer
              message:
                example: >-
                  Errors and codes will vary depending on the scenario, please
                  see the documentation for information.
                type: string
              details:
                type: object
    rate_limit_error:
      description: >-
        Rate limit exceeded. Too many requests were made in a given time period.
        Retry after the rate limit window resets.
      content:
        application/json:
          schema:
            required:
              - error
            type: object
            properties:
              error:
                example: Request rate limit exceeded. Please wait and try again later.
                type: string
    server_error:
      description: >-
        Internal server error. An unexpected error occurred on the server.
        Contact support if the error persists.
      content:
        application/json:
          schema:
            required:
              - error
            type: object
            properties:
              error:
                example: An unexpected error occurred on the server.
                type: string
  securitySchemes:
    pubrio_api_key:
      type: apiKey
      name: pubrio-api-key
      description: >-
        A unique API token that represents the actions you perform through the
        API and the corresponding permissions and operations. You can create it
        through the [Settings](https://dashboard.pubrio.com/#/settings/)
        section.
      in: header

````