Annotation Queues
List Annotation Queues
Retrieves a paginated list of annotation queues for the current workspace. Results can be paginated using cursor-based pagination.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.list(limit=10)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.list({});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
"search": Optional[str],
"updated_by": Optional[str],
}
{
limit?: number;
startingAfter?: string;
endingBefore?: string;
search?: string;
updatedBy?: string;
}
Show Response
Show Response
{
"object": Literal["list"],
"data": [{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": date, # optional
"updated": date, # optional
}],
"has_more": bool,
}
{
object: "list";
data: {
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}[];
hasMore: boolean;
}
Create an Annotation Queue
Create an annotation queuefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.create()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.create();
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"display_name": str, # required
"description": str, # required
"project_id": str, # required
}
{
displayName: string; // required
description: string; // required
projectId: string; // required
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": date, # optional
"updated": date, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Retrieve an Annotation Queue
Retrieves a specific annotation queue by its unique identifierfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.retrieve(annotation_queue_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.retrieve({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": date, # optional
"updated": date, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Update an Annotation Queue
Edit an annotation queuefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.update(annotation_queue_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.update({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"display_name": Optional[str],
"description": Optional[str],
"project_id": Optional[str],
"human_review_ids": List[str], # optional
}
{
annotationQueueId: string; // required
requestBody?: {
displayName?: string;
description?: string;
projectId?: string;
humanReviewIds?: string[];
};
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": date, # optional
"updated": date, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Delete an Annotation Queue
Delete an annotation queuefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.delete(annotation_queue_id="<id>")
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.delete({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
Clear an Annotation Queue
Delete all items from an annotation queue. This action is irreversible.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.clear(annotation_queue_id="<id>")
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.clear({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
List Annotation Queue Items
Queries items from the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.list_items(annotation_queue_id="<id>", limit=10)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.listItems({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
{
annotationQueueId: string; // required
limit?: number;
startingAfter?: string;
endingBefore?: string;
}
Show Response
Show Response
{
"object": Literal["list"],
"data": List[Union[ListAnnotationQueueItemsData1, ListAnnotationQueueItemsData2]],
"has_more": bool,
}
{
object: "list";
data: (ListAnnotationQueueItemsData1 | ListAnnotationQueueItemsData2)[];
hasMore: boolean;
}
Add Annotation Queue Items
Adds items to the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.add_items(annotation_queue_id="<id>", items=[
{
"span_id": "<id>",
"trace_id": "<id>",
},
])
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.addItems({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"items": [{ # required
"span_id": str, # required
"trace_id": str, # required
}],
}
{
annotationQueueId: string; // required
requestBody?: {
items: { // required
spanId: string; // required
traceId: string; // required
}[];
};
}
Remove Annotation Queue Items
Removes items from the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.remove_items(annotation_queue_id="<id>", span_ids=[
"<value 1>",
"<value 2>",
])
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.removeItems({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"span_ids": List[str], # required
}
{
annotationQueueId: string; // required
requestBody?: {
spanIds: string[]; // required
};
}
Retrieve an Annotation Queue Item
Retrieves an item from the specified annotation queue in its expanded form. An annotation queue item is a pointer to a span; this endpoint returns the fully resolved span the item references.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.retrieve_item(annotation_queue_id="<id>", item_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.retrieveItem({
annotationQueueId: "<id>",
itemId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"item_id": str, # required
}
{
annotationQueueId: string; // required
itemId: string; // required
}
Show Response
Show Response
{
"id": Optional[str],
"name": Optional[str],
"trace_id": str,
"duration": Optional[float],
"total_tokens": Optional[float],
"total_cost": Optional[float],
"billable": Optional[bool],
"session_id": Optional[str],
"context": { # optional
"trace_id": str,
"span_id": str,
},
"parent_id": Optional[str],
"start_time": Optional[str],
"end_time": Optional[str],
"events": List[Dict[str, Any]], # optional
"attributes": { # optional
"type": Optional[Literal["generic"]],
"gen_ai": { # optional
"operation": { # optional
"name": Optional[str],
},
"system": Optional[str],
"system_instructions": Optional[str],
"response": { # optional
"finish_reasons": List[Nullable[str]], # optional
"id": Optional[str],
"model": Optional[str],
},
"usage": { # optional
"input_tokens": Optional[float],
"output_tokens": Optional[float],
"prompt_tokens": Optional[float],
"completion_tokens": Optional[float],
"total_tokens": Optional[float],
"prompt_tokens_details": { # optional
"cached_tokens": Optional[float],
"cache_creation_tokens": Optional[float],
"audio_tokens": Optional[float],
},
"completion_tokens_details": { # optional
"reasoning_tokens": Optional[float],
"audio_tokens": Optional[float],
"accepted_prediction_tokens": Optional[float],
"rejected_prediction_tokens": Optional[float],
},
},
"agent": { # optional
"id": Optional[str],
"name": Optional[str],
"description": Optional[str],
"source": Optional[Literal["internal", "external", "experiment"]],
},
"conversation": { # optional
"id": Optional[str],
},
"tool": { # optional
"name": Optional[str],
"call": { # optional
"id": Optional[str],
"arguments": Optional[Any],
"result": Optional[Any],
},
"description": Optional[str],
"type": Optional[Literal["function", "extension", "datastore"]],
"definitions": Optional[Any],
},
"data_source": { # optional
"id": Optional[str],
},
"input": { # optional
"messages": List[Any], # optional
"prompt": Optional[str],
},
"output": { # optional
"messages": List[Any], # optional
"type": Optional[Literal["text", "json", "image", "speech"]],
"completion": Optional[str],
},
"provider": { # optional
"name": Optional[Literal["openai", "azure.ai.openai", "azure.ai.inference", "gcp.gemini", "gcp.gen_ai", "gcp.vertex_ai", "aws.bedrock", "anthropic", "cohere", "mistral_ai", "perplexity", "groq", "deepseek", "x_ai", "ibm.watsonx.ai"]],
},
"token": { # optional
"type": Optional[Literal["input", "output"]],
},
"embeddings": { # optional
"dimension": { # optional
"count": Optional[float],
},
},
"evaluation": { # optional
"name": Optional[str],
"score": { # optional
"value": Optional[float],
"label": Optional[str],
},
"explanation": Optional[str],
"passed": Optional[bool],
},
},
"agent": { # optional
"version": Optional[str],
"environment": Optional[str],
"iterations": { # optional
"count": Optional[int],
},
},
"orq": { # optional
"related_entities": Dict[str, Dict[str, bool]], # optional
"workspace_id": Optional[str],
"project_id": Optional[str],
"contact_id": Optional[str],
"identity_id": Optional[str],
"api_key_id": Optional[str],
"thread_id": Optional[str],
"tags": List[str], # optional
"product": Optional[str],
"billing": { # optional
"total_cost": Optional[float],
"input_cost": Optional[float],
"output_cost": Optional[float],
"cache_read_cost": Optional[float],
"cache_write_cost": Optional[float],
"audio_input_cost": Optional[float],
"audio_output_cost": Optional[float],
"reasoning_cost": Optional[float],
"web_search_cost": Optional[float],
"pricing_tier": Optional[str],
"threshold_exceeded": Optional[bool],
"billable": Optional[bool],
"integration_id": Optional[str],
},
"latency": Optional[float],
"time_to_first_token": Optional[float],
"costs": Optional[float],
"object_name": Optional[str],
"variables": Dict[str, Any], # optional
"context": Dict[str, Any], # optional
"evaluations": List[Union[RetrieveAnnotationQueueItemEvaluations1, RetrieveAnnotationQueueItemEvaluations2, RetrieveAnnotationQueueItemEvaluations3, RetrieveAnnotationQueueItemEvaluations4, Evaluations5, Evaluations6, Evaluations7, Evaluations8, Evaluations9, Evaluations10, Evaluations11, Evaluations12, Evaluations13, Evaluations14, Evaluations15, Evaluations16, Evaluations17, Evaluations18, Evaluations19]], # optional
"guardrail": { # optional
"enabled": Optional[bool],
},
"duration": Optional[float],
"trace": { # optional
"framework": { # optional
"name": str,
"version": Optional[str],
},
"graph": { # optional
"nodes": [{
"id": str,
"type": str,
"span_ids": List[str],
}],
"edges": [{
"source": str,
"target": str,
}],
},
},
"internal": Optional[bool],
"masking": { # optional
"input": Optional[bool],
"output": Optional[bool],
"system": Optional[bool],
},
"settings": { # optional
"engine": Optional[Literal["text", "jinja", "mustache"]],
},
},
"otel": { # optional
"status_code": Optional[Literal["OK", "ERROR"]],
"status_description": Optional[str],
},
"otlp": { # optional
"status": { # optional
"message": Optional[str],
},
},
"http": { # optional
"response": {
"status_code": float,
},
},
"openresponses": { # optional
"input": List[Union[RetrieveAnnotationQueueItemInputAnnotationQueues1, RetrieveAnnotationQueueItemInputAnnotationQueuesResponse200ApplicationJSONResponseBody12, Input3, Input4, Input5, Input6, Input7, Input8]], # optional
"output": List[Union[RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody11, RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody12, RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody13, RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody14, RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody15]], # optional
"object": Optional[str],
"created_at": Optional[float],
"status": Optional[str],
"completed_at": Optional[str],
"incomplete_details": Optional[str],
"error": Optional[str],
"previous_response_id": Optional[str],
"instructions": Optional[str],
"truncation": Optional[Literal["auto", "disabled"]],
"service_tier": Optional[Literal["auto", "default", "flex", "priority"]],
"safety_identifier": Optional[str],
"prompt_cache_key": Optional[str],
"user": Optional[str],
"temperature": Optional[float],
"top_p": Optional[float],
"presence_penalty": Optional[float],
"frequency_penalty": Optional[float],
"parallel_tool_calls": Optional[bool],
"stream": Optional[bool],
"background": Optional[bool],
"store": Optional[bool],
"top_logprobs": Optional[float],
"max_output_tokens": Optional[float],
"max_tool_calls": Optional[float],
"tools": [{ # optional
"type": Optional[Literal["function"]],
"name": str,
"description": Nullable[str],
"parameters": Dict[str, Any],
"strict": Nullable[bool],
}],
"tools_count": Optional[float],
"tool_choice": Optional[str],
"metadata": Dict[str, Any], # optional
"text": Optional[str],
"stream_options": Optional[str],
"reasoning": Optional[str],
"include": Optional[str],
"include_count": Optional[float],
},
"metadata": Dict[str, Any], # optional
},
"type": Literal["span.generic"],
"input": Dict[str, Any],
"output": Dict[str, Any],
}
{
id?: string;
name?: string;
traceId: string;
duration?: number;
totalTokens?: number;
totalCost?: number;
billable?: boolean;
sessionId?: string;
context?: {
traceId: string;
spanId: string;
};
parentId?: string;
startTime?: string;
endTime?: string;
events?: Record<string, any>[];
attributes?: {
type?: "generic";
genAi?: {
operation?: {
name?: string;
};
system?: string;
systemInstructions?: string;
response?: {
finishReasons?: string[];
id?: string;
model?: string;
};
usage?: {
inputTokens?: number;
outputTokens?: number;
promptTokens?: number;
completionTokens?: number;
totalTokens?: number;
promptTokensDetails?: {
cachedTokens?: number;
cacheCreationTokens?: number;
audioTokens?: number;
};
completionTokensDetails?: {
reasoningTokens?: number;
audioTokens?: number;
acceptedPredictionTokens?: number;
rejectedPredictionTokens?: number;
};
};
agent?: {
id?: string;
name?: string;
description?: string;
source?: "internal" | "external" | "experiment";
};
conversation?: {
id?: string;
};
tool?: {
name?: string;
call?: {
id?: string;
arguments?: any;
result?: any;
};
description?: string;
type?: "function" | "extension" | "datastore";
definitions?: any;
};
dataSource?: {
id?: string;
};
input?: {
messages?: any[];
prompt?: string;
};
output?: {
messages?: any[];
type?: "text" | "json" | "image" | "speech";
completion?: string;
};
provider?: {
name?: "openai" | "azure.ai.openai" | "azure.ai.inference" | "gcp.gemini" | "gcp.gen_ai" | "gcp.vertex_ai" | "aws.bedrock" | "anthropic" | "cohere" | "mistral_ai" | "perplexity" | "groq" | "deepseek" | "x_ai" | "ibm.watsonx.ai";
};
token?: {
type?: "input" | "output";
};
embeddings?: {
dimension?: {
count?: number;
};
};
evaluation?: {
name?: string;
score?: {
value?: number;
label?: string;
};
explanation?: string;
passed?: boolean;
};
};
agent?: {
version?: string;
environment?: string;
iterations?: {
count?: number;
};
};
orq?: {
relatedEntities?: Record<string, Record<string, boolean>>;
workspaceId?: string;
projectId?: string;
contactId?: string;
identityId?: string;
apiKeyId?: string;
threadId?: string;
tags?: string[];
product?: string;
billing?: {
totalCost?: number;
inputCost?: number;
outputCost?: number;
cacheReadCost?: number;
cacheWriteCost?: number;
audioInputCost?: number;
audioOutputCost?: number;
reasoningCost?: number;
webSearchCost?: number;
pricingTier?: string;
thresholdExceeded?: boolean;
billable?: boolean;
integrationId?: string;
};
latency?: number;
timeToFirstToken?: number;
costs?: number;
objectName?: string;
variables?: Record<string, any>;
context?: Record<string, any>;
evaluations?: (RetrieveAnnotationQueueItemEvaluations1 | RetrieveAnnotationQueueItemEvaluations2 | RetrieveAnnotationQueueItemEvaluations3 | RetrieveAnnotationQueueItemEvaluations4 | Evaluations5 | Evaluations6 | Evaluations7 | Evaluations8 | Evaluations9 | Evaluations10 | Evaluations11 | Evaluations12 | Evaluations13 | Evaluations14 | Evaluations15 | Evaluations16 | Evaluations17 | Evaluations18 | Evaluations19)[];
guardrail?: {
enabled?: boolean;
};
duration?: number;
trace?: {
framework?: {
name: string;
version?: string;
};
graph?: {
nodes: {
id: string;
type: string;
spanIds: string[];
}[];
edges: {
source: string;
target: string;
}[];
};
};
internal?: boolean;
masking?: {
input?: boolean;
output?: boolean;
system?: boolean;
};
settings?: {
engine?: "text" | "jinja" | "mustache";
};
};
otel?: {
statusCode?: "OK" | "ERROR";
statusDescription?: string;
};
otlp?: {
status?: {
message?: string;
};
};
http?: {
response: {
statusCode: number;
};
};
openresponses?: {
input?: (RetrieveAnnotationQueueItemInputAnnotationQueues1 | RetrieveAnnotationQueueItemInputAnnotationQueuesResponse200ApplicationJSONResponseBody12 | Input3 | Input4 | Input5 | Input6 | Input7 | Input8)[];
output?: (RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody11 | RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody12 | RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody13 | RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody14 | RetrieveAnnotationQueueItemOutputAnnotationQueuesResponse200ApplicationJSONResponseBody15)[];
object?: string;
createdAt?: number;
status?: string;
completedAt?: string;
incompleteDetails?: string;
error?: string;
previousResponseId?: string;
instructions?: string;
truncation?: "auto" | "disabled";
serviceTier?: "auto" | "default" | "flex" | "priority";
safetyIdentifier?: string;
promptCacheKey?: string;
user?: string;
temperature?: number;
topP?: number;
presencePenalty?: number;
frequencyPenalty?: number;
parallelToolCalls?: boolean;
stream?: boolean;
background?: boolean;
store?: boolean;
topLogprobs?: number;
maxOutputTokens?: number;
maxToolCalls?: number;
tools?: {
type?: "function";
name: string;
description: string;
parameters: Record<string, any>;
strict: boolean;
}[];
toolsCount?: number;
toolChoice?: string;
metadata?: Record<string, any>;
text?: string;
streamOptions?: string;
reasoning?: string;
include?: string;
includeCount?: number;
};
metadata?: Record<string, any>;
};
type: "span.generic";
input: Record<string, any>;
output: Record<string, any>;
}