Core - List sessions
curl --request POST \
--url 'https://my.orq.ai/v2/sessions/query' \
--header "Authorization: Bearer $ORQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"filters": {
"interval": "SESSION_INTERVAL_LAST_24_HOURS",
"project_id": "proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V",
"tags": ["support"]
},
"limit": 25,
"page": 1
}'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const page = await client.sessions.list({
filters: {
interval: 'SESSION_INTERVAL_LAST_24_HOURS',
projectId: 'proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V',
tags: ['support'],
},
limit: 25,
page: 1,
});
for (const session of page.data) {
console.log(session.externalId, session.tracesCount);
}
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
page = client.sessions.list(
filters={
"interval": "SESSION_INTERVAL_LAST_24_HOURS",
"project_id": "proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V",
"tags": ["support"],
},
limit=25,
page=1,
)
for session in page.data:
print(session.external_id, session.traces_count)
{
"object": "<string>",
"data": [
{
"_id": "<string>",
"external_id": "<string>",
"duration": 123,
"contact_ids": [
"<string>"
],
"billing": {
"input_cost": 123,
"output_cost": 123,
"total_cost": 123
},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"traces_count": 123,
"tags": [
"<string>"
],
"project_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"client": "<string>",
"repo": "<string>",
"kind": "THREAD_KIND_UNSPECIFIED"
}
],
"has_more": true
}Threads
List trace threads
List trace threads from your workspace.
POST
/
v2
/
sessions
/
query
Core - List sessions
curl --request POST \
--url 'https://my.orq.ai/v2/sessions/query' \
--header "Authorization: Bearer $ORQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"filters": {
"interval": "SESSION_INTERVAL_LAST_24_HOURS",
"project_id": "proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V",
"tags": ["support"]
},
"limit": 25,
"page": 1
}'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const page = await client.sessions.list({
filters: {
interval: 'SESSION_INTERVAL_LAST_24_HOURS',
projectId: 'proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V',
tags: ['support'],
},
limit: 25,
page: 1,
});
for (const session of page.data) {
console.log(session.externalId, session.tracesCount);
}
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
page = client.sessions.list(
filters={
"interval": "SESSION_INTERVAL_LAST_24_HOURS",
"project_id": "proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V",
"tags": ["support"],
},
limit=25,
page=1,
)
for session in page.data:
print(session.external_id, session.traces_count)
{
"object": "<string>",
"data": [
{
"_id": "<string>",
"external_id": "<string>",
"duration": 123,
"contact_ids": [
"<string>"
],
"billing": {
"input_cost": 123,
"output_cost": 123,
"total_cost": 123
},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"traces_count": 123,
"tags": [
"<string>"
],
"project_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"client": "<string>",
"repo": "<string>",
"kind": "THREAD_KIND_UNSPECIFIED"
}
],
"has_more": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?