Skip to main content
POST
/
v2
/
reporting
Query reporting metrics
curl --request POST \
  --url https://api.orq.ai/v2/reporting \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metric": "genai.requests",
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "grain": "auto",
  "group_by": [
    "project"
  ],
  "filters": [
    {
      "field": "project",
      "op": "eq",
      "values": [
        "<string>"
      ]
    }
  ],
  "limit": 123,
  "time_zone": "<string>",
  "include_totals": true
}
'
{
  "object": "report",
  "request": {
    "metric": "genai.requests",
    "from": "2023-11-07T05:31:56Z",
    "to": "2023-11-07T05:31:56Z",
    "grain": "auto",
    "group_by": [
      "project"
    ],
    "filters": [
      {
        "field": "project",
        "op": "eq",
        "values": [
          "<string>"
        ]
      }
    ],
    "limit": 123,
    "time_zone": "<string>",
    "include_totals": true
  },
  "data": [
    {
      "timestamp": "2023-11-07T05:31:56Z",
      "dimensions": {},
      "metrics": {}
    }
  ],
  "totals": {
    "metrics": {}
  },
  "has_more": true,
  "meta": {
    "effective_grain": "minute",
    "row_count": 123,
    "request_id": "<string>",
    "currency": "USD"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.orq.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
metric
enum<string>

Catalogue metric to query.

Available options:
genai.requests,
genai.tokens,
genai.cost,
genai.errors,
genai.latency.p50,
genai.latency.p95,
genai.latency.p99,
genai.evaluator.runs,
genai.evaluator.pass_rate,
genai.evaluator.score.avg,
genai.guardrail.runs,
genai.guardrail.block_rate,
genai.guardrail.triggered,
genai.usage
from
string<date-time>

Inclusive lower bound for the report window (RFC 3339, UTC).

to
string<date-time>

Exclusive upper bound for the report window (RFC 3339, UTC).

grain
enum<string>

Requested bucket grain. Use auto or omit the field to let the server choose based on the requested range.

Available options:
auto,
minute,
hour,
day
group_by
enum<string>[]

Reporting dimensions to break down by. Valid dimensions depend on the selected metric.

Available options:
project,
identity,
provider,
model,
product,
api_key,
status_code,
http_status_code,
credential_type,
dimension,
dimension_type,
tag,
agent,
tool,
deployment,
evaluator,
dataset,
prompt,
policy,
conversation,
thread,
memory_store,
knowledge,
sheet,
guardrail_origin,
evaluator_name,
evaluator_type,
evaluator_version,
result_type,
evaluation_stage,
guardrail_stage,
evaluator_stage,
guardrail_action,
result_label
filters
object[]

Up to 20 allowlisted predicates combined with AND.

limit
integer<int32>

Maximum bucket rows returned. Defaults to 1000 and is capped at 5000.

time_zone
string

IANA time zone applied to bucket boundaries, for example America/New_York. Response timestamps remain UTC. Empty means UTC.

include_totals
boolean

When true, include a totals block aggregated across the full report window.

Response

200 - application/json

OK

object
enum<string>

Object discriminator for typed SDKs and JSON parsers; always report.

Available options:
report
request
object

The request that produced this response, parroted back so caller code never has to remember its own payload to interpret the result.

data
object[]

Time-ordered buckets.

totals
object

Totals across the whole window. Present only when include_totals=true on the request.

has_more
boolean

Pagination contract. Always populated; currently false because the server caps the response at limit instead of issuing cursors.

meta
object

Diagnostic metadata.