{
  "db_name": "PostgreSQL",
  "query": "\n        SELECT model,\n               COALESCE(SUM(prompt_tokens), 0)::bigint as input_tokens,\n               COALESCE(SUM(completion_tokens), 0)::bigint as output_tokens,\n               COALESCE(SUM(total_cost), 0) as cost,\n               COUNT(*) as request_count\n        FROM http_analytics\n        WHERE user_id = $1\n          AND timestamp >= $2 AND timestamp <= $3\n          AND model IS NOT NULL\n          AND status_code BETWEEN 200 AND 299\n        GROUP BY model\n        ORDER BY request_count DESC\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "model",
        "type_info": "Text"
      },
      {
        "ordinal": 1,
        "name": "input_tokens",
        "type_info": "Int8"
      },
      {
        "ordinal": 2,
        "name": "output_tokens",
        "type_info": "Int8"
      },
      {
        "ordinal": 3,
        "name": "cost",
        "type_info": "Numeric"
      },
      {
        "ordinal": 4,
        "name": "request_count",
        "type_info": "Int8"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Timestamptz",
        "Timestamptz"
      ]
    },
    "nullable": [
      true,
      null,
      null,
      null,
      null
    ]
  },
  "hash": "4c204f7a4617b9c313b2a50e08bd6eca15b4e727759f94815d9b318fdde42d55"
}
