PydanticAI Usage API

The Usage API from PydanticAI — 6 operation(s) for usage.

Operations 6

GET /v1/usage/daily/ Get Organization Daily Usage #
GET /v1/usage/monthly/ Get Organization Monthly Usage #
GET /v1/usage/projects/daily/ Get All Projects Daily Usage #
GET /v1/usage/projects/monthly/ Get All Projects Monthly Usage #
GET /v1/usage/projects/{project_id}/daily/ Get Project Daily Usage #
GET /v1/usage/projects/{project_id}/monthly/ Get Project Monthly Usage #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pydantic-ai-usage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pydantic-ai-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pydantic Logfire Usage API
  summary: Public API to access Logfire resources
  description: 'To be able to use the Logfire API, you need to either create an

    [OAuth App](https://logfire.pydantic.dev/-/redirect/default-org/settings/developer/oauth-apps) or a

    [Personal Access Token](https://logfire.pydantic.dev/-/redirect/default-org/settings/developer/pat).

    '
  termsOfService: https://pydantic.dev/legal/terms-of-service
  version: 0.1.0
servers:
- url: https://logfire-us.pydantic.dev/api
  description: Pydantic Logfire API (US)
- url: https://logfire-eu.pydantic.dev/api
  description: Pydantic Logfire API (EU)
tags:
- name: Usage
paths:
  /v1/usage/daily/:
    get:
      tags:
      - Usage
      summary: Get Organization Daily Usage
      description: 'Get organization-level daily usage (up to 3 months).


        Returns daily usage aggregated across all projects, read from `token_usage_rollup`.'
      operationId: get_organization_daily_usage_v1_usage_daily__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/usage/monthly/:
    get:
      tags:
      - Usage
      summary: Get Organization Monthly Usage
      description: 'Get organization-level monthly usage since account opening.


        Returns monthly usage aggregated across all projects, read from `token_usage_monthly`.'
      operationId: get_organization_monthly_usage_v1_usage_monthly__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/usage/projects/daily/:
    get:
      tags:
      - Usage
      summary: Get All Projects Daily Usage
      description: 'Get daily usage for all projects in the organization (up to 90 days).


        Returns daily usage broken down by project. Each row is one `(date, project)` pair.

        Read from `token_usage_rollup`. Supports pagination via `limit` and `offset`.'
      operationId: get_all_projects_daily_usage_v1_usage_projects_daily__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 200
          minimum: 1
          default: 100
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProjectsUsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/usage/projects/monthly/:
    get:
      tags:
      - Usage
      summary: Get All Projects Monthly Usage
      description: 'Get monthly usage for all projects in the organization.


        Returns monthly usage broken down by project. Each row is one `(month, project)` pair.

        Read from `token_usage_monthly`.'
      operationId: get_all_projects_monthly_usage_v1_usage_projects_monthly__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectsUsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/usage/projects/{project_id}/daily/:
    get:
      tags:
      - Usage
      summary: Get Project Daily Usage
      description: 'Get daily usage for a single project (up to 3 months).


        Returns daily usage for the specified project, read from `token_usage_rollup`.'
      operationId: get_project_daily_usage_v1_usage_projects__project_id__daily__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/usage/projects/{project_id}/monthly/:
    get:
      tags:
      - Usage
      summary: Get Project Monthly Usage
      description: 'Get monthly usage for a single project since account opening.


        Returns monthly usage for the specified project, read from `token_usage_monthly`.'
      operationId: get_project_monthly_usage_v1_usage_projects__project_id__monthly__get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:payment
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: start_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: Start Date
      - name: end_date
        in: query
        required: true
        schema:
          type: string
          format: date
          title: End Date
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponseV1'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ProjectsUsageResponseV1:
      properties:
        start_date:
          type: string
          format: date
          title: Start Date
        end_date:
          type: string
          format: date
          title: End Date
        total_records_count:
          type: integer
          title: Total Records Count
        total_metrics_count:
          type: integer
          title: Total Metrics Count
        total_observations:
          type: integer
          title: Total Observations
        usage:
          items:
            $ref: '#/components/schemas/ProjectUsageRowV1'
          type: array
          title: Usage
      type: object
      required:
      - start_date
      - end_date
      - total_records_count
      - total_metrics_count
      - total_observations
      - usage
      title: ProjectsUsageResponseV1
    UsageRowV1:
      properties:
        date:
          type: string
          format: date
          title: Date
        records_count:
          type: integer
          title: Records Count
        metrics_count:
          type: integer
          title: Metrics Count
        total_observations:
          type: integer
          title: Total Observations
      type: object
      required:
      - date
      - records_count
      - metrics_count
      - total_observations
      title: UsageRowV1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProjectUsageRowV1:
      properties:
        date:
          type: string
          format: date
          title: Date
        project_id:
          type: string
          format: uuid
          title: Project Id
        project_name:
          type: string
          title: Project Name
        records_count:
          type: integer
          title: Records Count
        metrics_count:
          type: integer
          title: Metrics Count
        total_observations:
          type: integer
          title: Total Observations
      type: object
      required:
      - date
      - project_id
      - project_name
      - records_count
      - metrics_count
      - total_observations
      title: ProjectUsageRowV1
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    PaginatedProjectsUsageResponseV1:
      properties:
        start_date:
          type: string
          format: date
          title: Start Date
        end_date:
          type: string
          format: date
          title: End Date
        total:
          type: integer
          title: Total
        usage:
          items:
            $ref: '#/components/schemas/ProjectUsageRowV1'
          type: array
          title: Usage
      type: object
      required:
      - start_date
      - end_date
      - total
      - usage
      title: PaginatedProjectsUsageResponseV1
    HTTPExceptionError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
      - detail
      title: HTTPExceptionError
    UsageResponseV1:
      properties:
        start_date:
          type: string
          format: date
          title: Start Date
        end_date:
          type: string
          format: date
          title: End Date
        total_records_count:
          type: integer
          title: Total Records Count
        total_metrics_count:
          type: integer
          title: Total Metrics Count
        total_observations:
          type: integer
          title: Total Observations
        usage:
          items:
            $ref: '#/components/schemas/UsageRowV1'
          type: array
          title: Usage
      type: object
      required:
      - start_date
      - end_date
      - total_records_count
      - total_metrics_count
      - total_observations
      - usage
      title: UsageResponseV1
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          refreshUrl: /api/oauth/token
          scopes:
            instance:admin: Platform admin access to manage the whole self-hosted instance
            instance:billing: Read billing and usage data across the whole self-hosted instance
            organization:admin: Platform admin access to manage organizations across the instance (self-hosted only)
            organization:read: Read access to organizations
            organization:write: Write access to organizations
            organization:create_project: Ability to create projects within the organization
            organization:read_member: Read organization members and roles
            organization:write_member: Modify organization member roles and membership
            organization:read_channel: Read notification channels across the organization
            organization:write_channel: Create or modify notification channels across the organization
            organization:create_api_key: Create new API keys for the organization
            organization:read_api_key: Read API keys across the organization
            organization:write_api_key: Edit or revoke existing API keys across the organization
            organization:read_invitation: Read organization invitations
            organization:write_invitation: Create organization invitations
            project:read: Read access to projects
            project:write: Write access to projects
            project:write_token: Create write tokens
            project:read_token: Create read tokens
            project:read_dashboard: Read dashboards within a project
            project:write_dashboard: Create or modify dashboards within a project
            project:read_alert: Read alerts within a project
            project:write_alert: Create or modify alerts within a project
            project:read_datasets: Read datasets within a project
            project:write_datasets: Create or modify datasets within a project
            project:read_variables: Read managed variables and prompts within a project
            project:write_variables: Create or modify managed variables and prompts within a project
            project:read_external_variables: Read external managed variables within a project via OFREP
            project:gateway_proxy: Proxy AI model requests through the project AI Gateway
            project:read_otlp: Query trace data submitted to the project via OTLP
            project:write_otlp: Send OTLP traces, logs, and metrics to the project
            project:read_api_key: Read API keys within a project
            project:write_api_key: Create, edit, or revoke API keys within a project
            organization:scim: SCIM access to organizations
            organization:auditlog: Read audit logs for the organization
            organization:payment: Read billing usage data for the organization
            organization:read_trust_policy: Read OIDC trust policies and their token exchange history
            organization:write_trust_policy: Create, modify, or delete OIDC trust policies and revoke issued workload tokens
          authorizationUrl: api/oauth/authorize
          tokenUrl: /api/oauth/token