{
  "/tag/daily/activity": {
    "get": {
      "tags": [
        "tag management"
      ],
      "summary": "Get Tag Daily Activity",
      "description": "Get daily activity for specific tags or all tags.\n\nArgs:\n    tags (Optional[str]): Comma-separated list of tags to filter by. If not provided, returns data for all tags.\n    start_date (Optional[str]): Start date for the activity period (YYYY-MM-DD).\n    end_date (Optional[str]): End date for the activity period (YYYY-MM-DD).\n    model (Optional[str]): Filter by model name.\n    api_key (Optional[str]): Filter by API key.\n    page (int): Page number for pagination.\n    page_size (int): Number of items per page.\n\nReturns:\n    SpendAnalyticsPaginatedResponse: Paginated response containing daily activity data.",
      "operationId": "get_tag_daily_activity_tag_daily_activity_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "tags",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        {
          "name": "start_date",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          }
        },
        {
          "name": "end_date",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          }
        },
        {
          "name": "model",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          }
        },
        {
          "name": "api_key",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          }
        },
        {
          "name": "page",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "default": 1,
            "title": "Page"
          }
        },
        {
          "name": "page_size",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "default": 10,
            "title": "Page Size"
          }
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpendAnalyticsPaginatedResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  },
  "/tag/dau": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Daily Active Users",
      "description": "Get Daily Active Users (DAU) by tags for the last {MAX_DAYS} days ending on UTC today + 1 day.\n\nThis endpoint efficiently calculates unique users per tag for each of the last {MAX_DAYS} days\nusing a single optimized SQL query, perfect for dashboard time series visualization.\n\nArgs:\n    tag_filter: Optional filter to specific tag (legacy)\n    tag_filters: Optional filter to multiple specific tags (takes precedence over tag_filter)\n\nReturns:\n    ActiveUsersAnalyticsResponse: DAU data by tag for each of the last {MAX_DAYS} days",
      "operationId": "get_daily_active_users_tag_dau_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "tag_filter",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by specific tag (optional)",
            "title": "Tag Filter"
          },
          "description": "Filter by specific tag (optional)"
        },
        {
          "name": "tag_filters",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)",
            "title": "Tag Filters"
          },
          "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)"
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActiveUsersAnalyticsResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  },
  "/tag/delete": {
    "post": {
      "tags": [
        "tag management"
      ],
      "summary": "Delete Tag",
      "description": "Delete a tag.\n\nParameters:\n- name: str - The name of the tag to delete",
      "operationId": "delete_tag_tag_delete_post",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TagDeleteRequest"
            }
          }
        },
        "required": true
      },
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/distinct": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Distinct User Agent Tags",
      "description": "Get all distinct user agent tags up to a maximum of {MAX_TAGS} tags.\n\nThis endpoint returns all unique user agent tags found in the database,\nsorted by frequency of usage.\n\nReturns:\n    DistinctTagsResponse: List of distinct user agent tags",
      "operationId": "get_distinct_user_agent_tags_tag_distinct_get",
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DistinctTagsResponse"
              }
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/info": {
    "post": {
      "tags": [
        "tag management"
      ],
      "summary": "Info Tag",
      "description": "Get information about specific tags.\n\nParameters:\n- names: List[str] - List of tag names to get information for",
      "operationId": "info_tag_tag_info_post",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TagInfoRequest"
            }
          }
        },
        "required": true
      },
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/list": {
    "get": {
      "tags": [
        "tag management"
      ],
      "summary": "List Tags",
      "description": "List all available tags with their budget information.",
      "operationId": "list_tags_tag_list_get",
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/mau": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Monthly Active Users",
      "description": "Get Monthly Active Users (MAU) by tags for the last {MAX_MONTHS} months ending on UTC today + 1 day.\n\nShows month-by-month breakdown:\n- Month 1 (Nov): Earliest month (7 months ago, 30-day period)\n- Month 2 (Dec): Next month (6 months ago)\n- Month 3 (Jan): Next month (5 months ago)\n- ... and so on for {MAX_MONTHS} months total\n- Month 7: Most recent month ending on UTC today + 1 day\n\nArgs:\n    tag_filter: Optional filter to specific tag (legacy)\n    tag_filters: Optional filter to multiple specific tags (takes precedence over tag_filter)\n\nReturns:\n    ActiveUsersAnalyticsResponse: MAU data by tag for each of the last {MAX_MONTHS} months with descriptive month labels (e.g., \"Month 1 (Nov)\")",
      "operationId": "get_monthly_active_users_tag_mau_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "tag_filter",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by specific tag (optional)",
            "title": "Tag Filter"
          },
          "description": "Filter by specific tag (optional)"
        },
        {
          "name": "tag_filters",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)",
            "title": "Tag Filters"
          },
          "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)"
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActiveUsersAnalyticsResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  },
  "/tag/new": {
    "post": {
      "tags": [
        "tag management"
      ],
      "summary": "New Tag",
      "description": "Create a new tag.\n\nParameters:\n- name: str - The name of the tag\n- description: Optional[str] - Description of what this tag represents\n- models: List[str] - List of either 'model_id' or 'model_name' allowed for this tag\n- budget_id: Optional[str] - The id for a budget (tpm/rpm/max budget) for the tag\n\n### IF NO BUDGET ID - CREATE ONE WITH THESE PARAMS ###\n- max_budget: Optional[float] - Max budget for tag\n- tpm_limit: Optional[int] - Max tpm limit for tag\n- rpm_limit: Optional[int] - Max rpm limit for tag\n- max_parallel_requests: Optional[int] - Max parallel requests for tag\n- soft_budget: Optional[float] - Get a slack alert when this soft budget is reached\n- model_max_budget: Optional[dict] - Max budget for a specific model\n- budget_duration: Optional[str] - Frequency of resetting tag budget",
      "operationId": "new_tag_tag_new_post",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TagNewRequest"
            }
          }
        },
        "required": true
      },
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/summary": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Tag Summary",
      "description": "Get summary analytics for tags including unique users, requests, tokens, and spend.\n\nArgs:\n    start_date: Start date for the analytics period (YYYY-MM-DD)\n    end_date: End date for the analytics period (YYYY-MM-DD)\n    tag_filter: Optional filter to specific tag (legacy)\n    tag_filters: Optional filter to multiple specific tags (takes precedence over tag_filter)\n\nReturns:\n    TagSummaryResponse: Summary analytics data by tag",
      "operationId": "get_tag_summary_tag_summary_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "start_date",
          "in": "query",
          "required": true,
          "schema": {
            "type": "string",
            "description": "Start date in YYYY-MM-DD format",
            "title": "Start Date"
          },
          "description": "Start date in YYYY-MM-DD format"
        },
        {
          "name": "end_date",
          "in": "query",
          "required": true,
          "schema": {
            "type": "string",
            "description": "End date in YYYY-MM-DD format",
            "title": "End Date"
          },
          "description": "End date in YYYY-MM-DD format"
        },
        {
          "name": "tag_filter",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by specific tag (optional)",
            "title": "Tag Filter"
          },
          "description": "Filter by specific tag (optional)"
        },
        {
          "name": "tag_filters",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)",
            "title": "Tag Filters"
          },
          "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)"
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagSummaryResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  },
  "/tag/update": {
    "post": {
      "tags": [
        "tag management"
      ],
      "summary": "Update Tag",
      "description": "Update an existing tag.\n\nParameters:\n- name: str - The name of the tag to update\n- description: Optional[str] - Updated description\n- models: List[str] - Updated list of allowed LLM models\n- budget_id: Optional[str] - The id for a budget to associate with the tag\n\n### BUDGET UPDATE PARAMS ###\n- max_budget: Optional[float] - Max budget for tag\n- tpm_limit: Optional[int] - Max tpm limit for tag\n- rpm_limit: Optional[int] - Max rpm limit for tag\n- max_parallel_requests: Optional[int] - Max parallel requests for tag\n- soft_budget: Optional[float] - Get a slack alert when this soft budget is reached\n- model_max_budget: Optional[dict] - Max budget for a specific model\n- budget_duration: Optional[str] - Frequency of resetting tag budget",
      "operationId": "update_tag_tag_update_post",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TagUpdateRequest"
            }
          }
        },
        "required": true
      },
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      },
      "security": [
        {
          "APIKeyHeader": []
        }
      ]
    }
  },
  "/tag/user-agent/per-user-analytics": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Per User Analytics",
      "description": "Get per-user analytics including successful requests, tokens, and spend by individual users.\n\nThis endpoint provides usage metrics broken down by individual users based on their\ntag activity during the last 30 days ending on UTC today + 1 day.\n\nArgs:\n    tag_filter: Optional filter to specific tag (legacy)\n    tag_filters: Optional filter to multiple specific tags (takes precedence over tag_filter)\n    page: Page number for pagination\n    page_size: Number of items per page\n\nReturns:\n    PerUserAnalyticsResponse: Analytics data broken down by individual users for the last 30 days",
      "operationId": "get_per_user_analytics_tag_user_agent_per_user_analytics_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "tag_filter",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by specific tag (optional)",
            "title": "Tag Filter"
          },
          "description": "Filter by specific tag (optional)"
        },
        {
          "name": "tag_filters",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)",
            "title": "Tag Filters"
          },
          "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)"
        },
        {
          "name": "page",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "minimum": 1,
            "description": "Page number for pagination",
            "default": 1,
            "title": "Page"
          },
          "description": "Page number for pagination"
        },
        {
          "name": "page_size",
          "in": "query",
          "required": false,
          "schema": {
            "type": "integer",
            "maximum": 1000,
            "minimum": 1,
            "description": "Items per page",
            "default": 50,
            "title": "Page Size"
          },
          "description": "Items per page"
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PerUserAnalyticsResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  },
  "/tag/wau": {
    "get": {
      "tags": [
        "tag management",
        "user agent analytics"
      ],
      "summary": "Get Weekly Active Users",
      "description": "Get Weekly Active Users (WAU) by tags for the last {MAX_WEEKS} weeks ending on UTC today + 1 day.\n\nShows week-by-week breakdown:\n- Week 1 (Jan 1): Earliest week (7 weeks ago)\n- Week 2 (Jan 8): Next week (6 weeks ago)\n- Week 3 (Jan 15): Next week (5 weeks ago)\n- ... and so on for {MAX_WEEKS} weeks total\n- Week 7: Most recent week ending on UTC today + 1 day\n\nArgs:\n    tag_filter: Optional filter to specific tag (legacy)\n    tag_filters: Optional filter to multiple specific tags (takes precedence over tag_filter)\n\nReturns:\n    ActiveUsersAnalyticsResponse: WAU data by tag for each of the last {MAX_WEEKS} weeks with descriptive week labels (e.g., \"Week 1 (Jan 1)\")",
      "operationId": "get_weekly_active_users_tag_wau_get",
      "security": [
        {
          "APIKeyHeader": []
        }
      ],
      "parameters": [
        {
          "name": "tag_filter",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by specific tag (optional)",
            "title": "Tag Filter"
          },
          "description": "Filter by specific tag (optional)"
        },
        {
          "name": "tag_filters",
          "in": "query",
          "required": false,
          "schema": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)",
            "title": "Tag Filters"
          },
          "description": "Filter by multiple specific tags (optional, takes precedence over tag_filter)"
        }
      ],
      "responses": {
        "200": {
          "description": "Successful Response",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActiveUsersAnalyticsResponse"
              }
            }
          }
        },
        "422": {
          "description": "Validation Error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HTTPValidationError"
              }
            }
          }
        }
      }
    }
  }
}