---
title: "Queries History"
method: GET
path: "/v1/queries/"
tags: ["Queries"]
---

# Queries History

`GET /v1/queries/`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/v1/queries/`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Fetch history of queries sorted by Timestamp in Descending order.

## Query parameters

- `limit` integer
- `offset` integer
- `show` 'all' | 'hourly' | 'daily' | 'weekly'
- `days` integer
- `user` string
- `app` string
- `provider` string
- `route` string

## Response `200`

Queries Listing

- QueriesResponse
  - `items` QuerySchema[], required
    - `id` number, required: Internal ID of the query
    - `username` string, required: Name of the user that made the request
    - `timestamp` string, required: Date and Time when the request was done in ISO format
    - `app` string, required: Name of the API key
    - `provider` string, required: AI Service Provider used
    - `route` string, required: Unique identifier of the AI model used within the Provider
    - `unit` string, required: Unit used for in cost calculations
    - `prompt_tokens` number: Number of Tokens in the prompt
    - `prompt_char` number: Number of Characters in the prompt
    - `response_tokens` number: Number of Tokens in the response
    - `response_char` number: Number of Characters in the response
    - `cost` string, required: Cost of the query, decimal with up to 12 decimal places
    - `latency_ms` number, required: Query latency in milliseconds
  - `limit` number, required: Limit parameter used in the request
  - `offset` number, required: Offset parameter used in the request

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
