curl --request POST \
--url https://my.orq.ai/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.create({ displayName: 'LLM cost', projectId: 'proj_01J81V5RZPVTDHXBV6M2YVJHRB', defaultRange: '7d', widgets: [{ widgetId: 'cost', type: 'timeseries', title: 'Cost by model', queries: [{ metric: 'genai.cost', groupBy: ['model'] }], layout: { x: 0, y: 0, w: 12, h: 4 } }] });
import requests
url = "https://my.orq.ai/v2/monitors"
payload = {
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_UNSPECIFIED",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}Create a monitor
Creates a monitor (custom observability dashboard) in the workspace. Set project_id to scope the monitor to a project; omit it to create a workspace-wide monitor, which requires admin access.
curl --request POST \
--url https://my.orq.ai/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.create({ displayName: 'LLM cost', projectId: 'proj_01J81V5RZPVTDHXBV6M2YVJHRB', defaultRange: '7d', widgets: [{ widgetId: 'cost', type: 'timeseries', title: 'Cost by model', queries: [{ metric: 'genai.cost', groupBy: ['model'] }], layout: { x: 0, y: 0, w: 12, h: 4 } }] });
import requests
url = "https://my.orq.ai/v2/monitors"
payload = {
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_UNSPECIFIED",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Workspace-unique display name.
Short human-readable summary of what the monitor tracks.
Project that should own the monitor. Omit to create a workspace-wide monitor (requires admin access).
Widgets to render on the monitor. Empty creates a valid blank monitor.
Show child attributes
Show child attributes
Default relative time range applied when the monitor opens.
Known preset used to create the monitor. Empty when built from scratch.
genai-overview, cost-analysis, latency, quality, widget-spans, widget-latency, widget-total-llm-cost, widget-token-count, widget-scores, widget-time-to-first-token, widget-tool-executions, widget-tool-error-rate, widget-tool-duration-p50 Response
OK
Newly created monitor.
Show child attributes
Show child attributes
Was this page helpful?