We recommend to use our official client libraries to interact with the orq.ai API.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.
Github
Our SDKs are available on Github:Node.js
Python
Installation
# The SDK can be installed with either pip or poetry package managers.
# PIP
pip install orq-ai-sdk
# Poetry
poetry add orq-ai-sdk
Usage
import os
from orq_ai_sdk import Orq
client = Orq(
api_key=os.environ.get("ORQ_API_KEY", "__API_KEY__"),
environment="production",
# optionally initiate the identity_id for the session
identity_id=2025
)
Agents
Agents A2A
Register an external A2A-compliant agent into Orquesta. The agent card will be fetched during registration to validate the agent and cache its capabilities.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.post_v2_agents_a2a()
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Agents Card Refresh
Fetches the latest agent card from the external A2A agent and updates the cached card in the database. Similar to MCP server refresh functionality.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.post_v2_agents_key_card_refresh(key="<key>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Create an Agent
Creates a new agent with the specified configuration, including model selection, instructions, tools, and knowledge bases. Agents are intelligent assistants that can execute tasks, interact with tools, and maintain context through memory stores. The agent can be configured with a primary model and optional fallback models for automatic failover, custom instructions for behavior control, and various settings to control execution limits and tool usage.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.create(key="<key>", role="<value>", description="alongside beneath doubtfully behest validity bah after furthermore", instructions="<value>", path="Default", model={
"id": "<id>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504,
],
},
}, settings={
"tools": [
{
"type": "mcp",
"id": "01KA84ND5J0SWQMA2Q8HY5WZZZ",
"tool_id": "01KXYZ123456789",
"requires_approval": False,
},
],
}, fallback_models=[
{
"id": "<id>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504,
],
},
},
], knowledge_bases=[
{
"knowledge_id": "customer-knowledge-base",
},
], engine="text")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of settings
Show Properties of settings
Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Response
Show Response
Live is the latest version of the agent. Draft is a version that is not yet published. Pending is a version that is pending approval. Published is a version that was live and has been replaced by a new version.project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Show Properties of tools
Show Properties of tools
Show Properties of model
Show Properties of model
Show Properties of parameters
Show Properties of parameters
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of cache
Show Properties of cache
Show Properties of retry
Show Properties of retry
List Agents
Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Live is the latest version of the agent. Draft is a version that is not yet published. Pending is a version that is pending approval. Published is a version that was live and has been replaced by a new version.project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Show Properties of tools
Show Properties of tools
Show Properties of model
Show Properties of model
Show Properties of parameters
Show Properties of parameters
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of cache
Show Properties of cache
Show Properties of retry
Show Properties of retry
Delete an Agent
Permanently removes an agent from the workspace. This operation is irreversible and will delete all associated configuration including model assignments, tools, knowledge bases, memory stores, and cached data. Active agent sessions will be terminated, and the agent key will become available for reuse.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.agents.delete(agent_key="<value>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve an Agent
Retrieves detailed information about a specific agent identified by its unique key or identifier. Returns the complete agent manifest including configuration settings, model assignments (primary and fallback), tools, knowledge bases, memory stores, instructions, and execution parameters. Use this endpoint to fetch the current state and configuration of an individual agent.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.retrieve(agent_key="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Live is the latest version of the agent. Draft is a version that is not yet published. Pending is a version that is pending approval. Published is a version that was live and has been replaced by a new version.project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Show Properties of tools
Show Properties of tools
Show Properties of model
Show Properties of model
Show Properties of parameters
Show Properties of parameters
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of cache
Show Properties of cache
Show Properties of retry
Show Properties of retry
Update an Agent
Modifies an existing agent’s configuration with partial updates. Supports updating any aspect of the agent including model assignments (primary and fallback), instructions, tools, knowledge bases, memory stores, and execution parameters. Only the fields provided in the request body will be updated; all other fields remain unchanged. Changes take effect immediately for new agent invocations.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.update(agent_key="<value>", model="El Camino", fallback_models=[
"<value>",
], settings={
"tools": [
{
"type": "mcp",
"id": "01KA84ND5J0SWQMA2Q8HY5WZZZ",
"tool_id": "01KXYZ123456789",
"requires_approval": False,
},
],
}, path="Default", knowledge_bases=[
{
"knowledge_id": "customer-knowledge-base",
},
])
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of requestBody
Show Properties of requestBody
Show Properties of settings
Show Properties of settings
project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Response
Show Response
Live is the latest version of the agent. Draft is a version that is not yet published. Pending is a version that is pending approval. Published is a version that was live and has been replaced by a new version.project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Show Properties of tools
Show Properties of tools
Show Properties of model
Show Properties of model
Show Properties of parameters
Show Properties of parameters
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of cache
Show Properties of cache
Show Properties of retry
Show Properties of retry
Invoke an Agent [deprecated]
Invokes an agent to perform a task with the provided input message. The agent will process the request using its configured model and tools, maintaining context through memory stores if configured. Supports automatic model fallback on primary model failure, tool execution, knowledge base retrieval, and continuation of previous conversations. Returns a task response that can be used to track execution status and retrieve results.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.invoke(key="<key>", message={
"role": "user",
"parts": [],
}, identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, thread={
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of requestBody
Show Properties of requestBody
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
Show Response
Show Response
Show Properties of status
Show Properties of status
Show Properties of messages
Show Properties of messages
Run an Agent [deprecated]
Executes an agent using inline configuration or references an existing agent. Supports dynamic agent creation where the system automatically manages agent versioning - reusing existing agents with matching configurations or creating new versions when configurations differ. Ideal for programmatic agent execution with flexible configuration management. The agent processes messages in A2A format with support for memory context, tool execution, and automatic model fallback on failure.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.run(key="<key>", model="F-150", role="<value>", instructions="<value>", message={
"role": "tool",
"parts": [
{
"kind": "text",
"text": "<value>",
},
],
}, path="Default", settings={}, fallback_models=[
"<value>",
], identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, thread={
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
}, knowledge_bases=[
{
"knowledge_id": "customer-knowledge-base",
},
], engine="text")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Show Response
Show Response
Show Properties of status
Show Properties of status
Show Properties of messages
Show Properties of messages
Stream Run [deprecated]
Dynamically configures and executes an agent while streaming the interaction in real-time via Server-Sent Events (SSE). Intelligently manages agent versioning by reusing existing agents with matching configurations or creating new versions when configurations differ. Combines the flexibility of inline configuration with real-time streaming, making it ideal for dynamic agent interactions with live feedback. The stream provides continuous updates including message chunks, tool executions, and status changes until completion or timeout.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.stream_run(key="<key>", model="Alpine", role="<value>", instructions="<value>", message={
"role": "user",
"parts": [
{
"kind": "file",
"file": {
"uri": "https://jumbo-zebra.info/",
},
},
],
}, path="Default", settings={}, fallback_models=[
"<value>",
], identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, thread={
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
}, knowledge_bases=[
{
"knowledge_id": "customer-knowledge-base",
},
], engine="text")
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
project/folder/subfolder/... The first element identifies the project, followed by nested folders (auto-created as needed). With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.Show Properties of teamOfAgents
Show Properties of teamOfAgents
Show Properties of settings
Show Properties of settings
Stream an Agent [deprecated]
Executes an agent and streams the interaction in real-time using Server-Sent Events (SSE). Provides live updates as the agent processes the request, including message chunks, tool calls, and execution status. Perfect for building responsive chat interfaces and monitoring agent progress. The stream continues until the agent completes its task, encounters an error, or reaches the configured timeout (default 30 minutes, configurable 1-3600 seconds).from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.stream(key="<key>", message={
"role": "user",
"parts": [],
}, identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, thread={
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
})
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
Show Properties of requestBody
Show Properties of requestBody
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
Agents.Responses
Create a Response
Initiates an agent conversation and returns a complete response. This endpoint manages the full lifecycle of an agent interaction, from receiving the initial message through all processing steps until completion. Supports synchronous execution (waits for completion) and asynchronous execution (returns immediately with task ID). The response includes all messages exchanged, tool calls made, and token usage statistics. Ideal for request-response patterns where you need the complete interaction result.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.responses.create(agent_key="<value>", message={
"role": "tool",
"parts": [],
}, identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, thread={
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
}, background=False, stream=False)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
Show Properties of requestBody
Show Properties of requestBody
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
Retrieve a Response
Retrieves the current state of an agent response by task ID. Returns the response output, model information, token usage, and execution status. When the agent is still processing, the output array will be empty and status will bein_progress. Once completed, the response includes the full output, usage statistics, and finish reason.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.agents.responses.get(agent_key="<value>", task_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of usage
Show Properties of usage
Show Properties of telemetry
Show Properties of telemetry
Annotations
Create an Annotation
Annotate a spanfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotations.create(trace_id="<id>", span_id="<id>", annotations=[])
# Use the SDK ...
Show Parameters
Show Parameters
Delete an Annotation
Remove an annotation from a spanfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotations.delete(trace_id="<id>", span_id="<id>", keys=[
"<value 1>",
])
# Use the SDK ...
Show Parameters
Show Parameters
Chunking
Parse
Split large text documents into smaller, manageable chunks using different chunking strategies optimized for RAG (Retrieval-Augmented Generation) workflows. This endpoint supports multiple chunking algorithms including token-based, sentence-based, recursive, semantic, and specialized strategies.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.chunking.parse(request={
"text": "The quick brown fox jumps over the lazy dog. This is a sample text that will be chunked into smaller pieces. Each chunk will maintain context while respecting the maximum chunk size.",
"metadata": True,
"strategy": "semantic",
"chunk_size": 256,
"threshold": 0.8,
"embedding_model": "openai/text-embedding-3-small",
"dimensions": 512,
"mode": "window",
"similarity_window": 1,
})
# Handle response
print(res)
Show Parameters
Show Parameters
Contacts
Create a Contact
Update or add user information to workspacefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.contacts.create(external_id="user_12345", display_name="Jane Smith", email="jane.smith@example.com", avatar_url="https://example.com/avatars/jane-smith.jpg", tags=[
"premium",
"beta-user",
"enterprise",
], metadata={
"department": "Engineering",
"role": "Senior Developer",
"subscription_tier": "premium",
"last_login": "2024-01-15T10:30:00Z",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Datasets
List Datasets
Retrieves a paginated list of datasets 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.datasets.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Show Properties of metadata
Show Properties of metadata
Create a Dataset
Creates a new dataset in the specified project.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.create(request={
"display_name": "Neva.Raynor10",
"path": "Default",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of metadata
Show Properties of metadata
Retrieve a Dataset
Retrieves a specific dataset by its unique identifierfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.retrieve(dataset_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of metadata
Show Properties of metadata
Update a Dataset
Update a datasetfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.update(dataset_id="<id>", path="Default")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of metadata
Show Properties of metadata
Delete a Dataset
Permanently deletes a dataset and all its datapoints. This action is irreversible.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.datasets.delete(dataset_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
List Datapoints
Retrieves a paginated list of datapoints from a specific dataset.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.list_datapoints(dataset_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Create Datapoint
Creates a new datapoint in the specified dataset.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.create_datapoint(dataset_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Retrieve Datapoint
Retrieves a datapoint objectfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.retrieve_datapoint(dataset_id="<id>", datapoint_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update Datapoint
Update a datapointfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.datasets.update_datapoint(dataset_id="<id>", datapoint_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete Datapoint
Permanently deletes a specific datapoint from a dataset.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.datasets.delete_datapoint(dataset_id="<id>", datapoint_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Clear Datasets
Delete all datapoints from a dataset. This action is irreversible.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.datasets.clear(dataset_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Deployments
Invoke a Deployment
Invoke a deployment with a given payloadfrom orq_ai_sdk import Orq
import os
with Orq(
environment="<value>",
contact_id="<id>",
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.deployments.invoke(key="<key>", stream=False, identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, documents=[
{
"text": "The refund policy allows customers to return items within 30 days of purchase for a full refund.",
"metadata": {
"file_name": "refund_policy.pdf",
"file_type": "application/pdf",
"page_number": 1,
},
},
{
"text": "Premium members receive free shipping on all orders over $50.",
"metadata": {
"file_name": "membership_benefits.md",
"file_type": "text/markdown",
},
},
])
assert res is not None
# Handle response
print(res)
Show Parameters
Show Parameters
server-sent events as they become available, with the stream terminated by a data: [DONE] message.System message, but before the User and Assistant pairs configured in your deployment.Show Properties of identity
Show Properties of identity
Show Properties of documents
Show Properties of documents
Show Response
Show Response
Show Properties of telemetry
Show Properties of telemetry
include_retrievals flag is set to true in the invoke settings. When stream is set to true, the retrievals property will be returned in the last streamed chunk where the property is_final is set to true.Show Properties of retrievals
Show Properties of retrievals
provider_response property will be set to null.List Deployments
Returns a list of your deployments. The deployments are returned sorted by creation date, with the most recent deployments appearing first.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.deployments.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Show Properties of promptConfig
Show Properties of promptConfig
Show Properties of tools
Show Properties of tools
function is supported.Show Properties of function
Show Properties of function
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicGet Config
Retrieve the deployment configurationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.deployments.get_config(key="<key>", identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, documents=[
{
"text": "The refund policy allows customers to return items within 30 days of purchase for a full refund.",
"metadata": {
"file_name": "refund_policy.pdf",
"file_type": "application/pdf",
"page_number": 1,
},
},
{
"text": "Premium members receive free shipping on all orders over $50.",
"metadata": {
"file_name": "membership_benefits.md",
"file_type": "text/markdown",
},
},
])
assert res is not None
# Handle response
print(res)
Show Parameters
Show Parameters
System message, but before the User and Assistant pairs configured in your deployment.Show Properties of identity
Show Properties of identity
Show Properties of documents
Show Properties of documents
Show Response
Show Response
chat,completion and image are supportedShow Properties of messages
Show Properties of messages
text or image_url when passing in images. You can pass multiple images by adding multiple image_url content parts. Can be null for tool messages in certain scenarios.Show Properties of parameters
Show Properties of parameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicStream a Deployment
Stream deployment generation. Only supported for completions and chat completions.from orq_ai_sdk import Orq
import os
with Orq(
environment="<value>",
contact_id="<id>",
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.deployments.stream(key="<key>", identity={
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
}, documents=[
{
"text": "The refund policy allows customers to return items within 30 days of purchase for a full refund.",
"metadata": {
"file_name": "refund_policy.pdf",
"file_type": "application/pdf",
"page_number": 1,
},
},
{
"text": "Premium members receive free shipping on all orders over $50.",
"metadata": {
"file_name": "membership_benefits.md",
"file_type": "text/markdown",
},
},
])
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
System message, but before the User and Assistant pairs configured in your deployment.Show Properties of identity
Show Properties of identity
Show Properties of documents
Show Properties of documents
Evals
All Evals
Get all Evaluatorsfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.evals.all(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Create an Eval
Create an Evaluatorfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.evals.create(request={
"output_type": "string",
"type": "http_eval",
"url": "https://total-unit.name",
"method": "GET",
"headers": {
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
"payload": {
"key": "<value>",
},
"path": "Default",
"description": "",
"key": "<key>",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Update an Eval
Update an Evaluatorfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.evals.update(id="<id>", path="Default")
# Handle response
print(res)
Show Parameters
Show Parameters
Delete an Eval
Delete an Evaluatorfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.evals.delete(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Invoke an Eval
Invoke a Custom Evaluatorfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.evals.invoke(id="<id>", messages=[
{
"role": "tool",
"content": [],
},
])
# Handle response
print(res)
Show Parameters
Show Parameters
Evaluators Versions
Returns version history for a specific evaluatorfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.evals.get_v2_evaluators_id_versions(id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Feedback
Create a Feedback
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.feedback.post_v2_feedback()
# Handle response
print(res)
Show Parameters
Show Parameters
correction, the value should be a string.get_config or invoke endpointsShow Response
Show Response
correction, the value should be a string.get_config or invoke endpointsFeedback Remove
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.feedback.post_v2_feedback_remove()
# Handle response
print(res)
Files
List Files
Returns a list of the files that your account has access to. orq.ai sorts and returns the files by their creation dates, placing the most recently created files at the top.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.list(limit=10)
# Handle response
print(res)
Show Response
Show Response
Create a File
Files are used to upload documents that can be used with features like Deployments.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.create(purpose=retrieval)
# Handle response
print(res)
Get Content
Returns a presigned URL for downloading the file content by file ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.get_content(file_id_or_path="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Retrieve a File
Retrieves the details of an existing file object. After you supply a unique file ID, orq.ai returns the corresponding file object.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.get(file_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a File
Delete a filefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.delete(file_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Update a File
Updates the metadata of an existing file object.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.update(file_id_param="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
GuardrailRules
List GuardrailRules
Returns a paginated list of guardrail rules for the current project.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of data
Show Properties of data
Create a GuardrailRule
Creates a new guardrail rule with expression, guardrails configuration, and timeout settings.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.create(display_name="Rosemarie_Wisoky")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete a GuardrailRule
Deletes an existing guardrail rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.guardrail_rules.delete(guardrail_rule_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve a GuardrailRule
Retrieves the details of an existing guardrail rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.retrieve(guardrail_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update a GuardrailRule
Partially updates an existing guardrail rule. Only provided fields are updated.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.guardrail_rules.update(guardrail_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
HumanReviewSets
List HumanReviewSets
Get all human review setsfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.human_review_sets.get_v2_human_eval_sets()
# Handle response
print(res)
Show Parameters
Show Parameters
Create a HumanReviewSet
Create a human review setfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.human_review_sets.post_v2_human_eval_sets()
# Handle response
print(res)
Show Parameters
Show Parameters
Retrieve a HumanReviewSet
Get a human review set by IDfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.human_review_sets.get_v2_human_eval_sets_id_(id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Update a HumanReviewSet
Update a human review setfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.human_review_sets.patch_v2_human_eval_sets_id_(id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a HumanReviewSet
Delete a human review setfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.human_review_sets.delete_v2_human_eval_sets_id_(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Identities
List Identities
Retrieves a paginated list of identities in your workspace. Use pagination parameters to navigate through large identity lists efficiently.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.list(limit=10, search="john", filter_by={
"tags": [
"premium",
"beta-user",
],
}, include_metrics=False)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Create an Identity
Creates a new identity with a unique external_id. If an identity with the same external_id already exists, the operation will fail. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.create(request={
"external_id": "user_12345",
"display_name": "Jane Smith",
"email": "jane.smith@example.com",
"avatar_url": "https://example.com/avatars/jane-smith.jpg",
"tags": [
"premium",
"beta-user",
"enterprise",
],
"metadata": {
"department": "Engineering",
"role": "Senior Developer",
"subscription_tier": "premium",
"last_login": "2024-01-15T10:30:00Z",
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Retrieve an Identity
Retrieves detailed information about a specific identity using their identity ID or external ID from your system.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.retrieve(id="<id>", include_metrics=False)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update an Identity
Updates specific fields of an existing identity. Only the fields provided in the request body will be updated.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.update(id="<id>", display_name="Jane Smith", email="jane.smith@example.com", avatar_url="https://example.com/avatars/jane-smith.jpg", tags=[
"premium",
"beta-user",
"enterprise",
], metadata={
"department": "Engineering",
"role": "Senior Developer",
"subscription_tier": "premium",
"last_login": "2024-01-15T10:30:00Z",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete an Identity
Permanently deletes an identity from your workspace and cleans up associated budget configurations. This action cannot be undone.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.identities.delete(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Knowledge
List Knowledge
Returns a list of your knowledge bases. The knowledge bases are returned sorted by creation date, with the most recent knowledge bases appearing firstfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Create a Knowledge
Create a knowledgefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.create(request={
"type": "internal",
"key": "<key>",
"embedding_model": "<value>",
"path": "Default",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Retrieve a Knowledge
Retrieve a knowledge base with the settings.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.retrieve(knowledge_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Update a Knowledge
Updates a knowledgefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.update(knowledge_id="<id>", request_body={
"path": "Default",
"type": "external",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a Knowledge
Deletes a knowledge base. Deleting a knowledge base will delete all the datasources and chunks associated with it.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.knowledge.delete(knowledge_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Search Knowledge
Search a Knowledge Base and return the most similar chunks, along with their search and rerank scores. Note that all configuration changes made in the API will override the settings in the UI.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.search(knowledge_id="<id>", query="<value>", search_type="hybrid_search", rerank_config={
"model": "cohere/rerank-multilingual-v3.0",
})
# Handle response
print(res)
Show Parameters
Show Parameters
List Datasources
List all datasourcesfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.list_datasources(knowledge_id="<id>", limit=50, status=[
"completed",
"failed",
])
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Create Datasource
Create a new datasourcefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.create_datasource(knowledge_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Retrieve Datasource
Retrieve a datasourcefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.retrieve_datasource(knowledge_id="<id>", datasource_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete Datasource
Deletes a datasource from a knowledge base. Deleting a datasource will remove it from the knowledge base and all associated chunks. This action is irreversible and cannot be undone.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.knowledge.delete_datasource(knowledge_id="<id>", datasource_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Update Datasource
Update a datasourcefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.update_datasource(knowledge_id="<id>", datasource_id="<id>", display_name="Tony_Roberts")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Create Chunks
Create chunks for a datasourcefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.create_chunks(knowledge_id="<id>", datasource_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
List Chunks
List all chunks for a datasourcefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.list_chunks(knowledge_id="<id>", datasource_id="<id>", limit=10, status=[
"completed",
"failed",
])
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
page_number or any other key-value pairsDelete Chunks
Delete multiple chunksfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.delete_chunks(knowledge_id="<id>", datasource_id="<id>", chunk_ids=[
"<value 1>",
"<value 2>",
])
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
List Chunks Paginated
List chunks with offset-based paginationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.list_chunks_paginated(knowledge_id="<id>", datasource_id="<id>", q="", limit=100, page=1)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of data
Show Properties of data
page_number or any other key-value pairsGet Chunks Count
Get chunks total countfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.get_chunks_count(knowledge_id="<id>", datasource_id="<id>", q="")
# Handle response
print(res)
Show Parameters
Show Parameters
Update Chunk
Update a chunkfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.update_chunk(chunk_id="<id>", datasource_id="<id>", knowledge_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
page_number or any other key-value pairsDelete Chunk
Delete a chunkfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.knowledge.delete_chunk(chunk_id="<id>", datasource_id="<id>", knowledge_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve Chunk
Retrieve a chunkfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.knowledge.retrieve_chunk(chunk_id="<id>", datasource_id="<id>", knowledge_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
page_number or any other key-value pairsMemoryStores
List MemoryStores
Retrieves a paginated list of memory stores in the workspace. Use cursor-based pagination parameters to navigate through the results.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Create a MemoryStore
Create memory storefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create(request={
"key": "<key>",
"embedding_config": {
"model": "cohere/embed-multilingual-light-v3.0",
},
"description": "unlike excluding soulful quirkily hmph baseboard whereas gee deserted",
"path": "Default",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Retrieve a MemoryStore
Retrieves detailed information about a specific memory store, including its configuration and metadata.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve(memory_store_key="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update a MemoryStore
Update the memory store configurationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update(memory_store_key="<value>", description="wherever cash since now exempt proliferate aha tabulate ack", path="Default")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete a MemoryStore
Permanently delete a memory store, including memories and documents.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete(memory_store_key="<value>")
# Use the SDK ...
Show Parameters
Show Parameters
List Memories
Retrieves a paginated list of memories for the memory storefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list_memories(memory_store_key="<value>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
Create Memory
Creates a new memory in the specified memory store.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create_memory(memory_store_key="<value>", entity_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Retrieve Memory
Retrieves details of a specific memory by its IDfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update Memory
Updates the details of a specific memory.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete Memory
Permanently deletes a specific memory. Use this endpoint to:- Remove a memory from the store
- Clean up unused memories
- Manage memory storage space
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete_memory(memory_store_key="<value>", memory_entity_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
List Documents
Retrieves a paginated list of documents associated with a specific memory.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.list_documents(memory_store_key="<value>", memory_entity_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Show Response
Show Response
Create Document
Creates a new document in the specified memory.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.create_document(memory_store_key="<value>", memory_entity_id="<id>", text="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Retrieve Document
Retrieves details of a specific memory document by its ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.retrieve_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update Document
Updates the details of a specific memory document.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.memory_stores.update_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete Document
Permanently deletes a specific memory document. Use this endpoint to:- Remove a document from a memory
- Clean up unused documents
- Manage document storage space
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.memory_stores.delete_document(memory_store_key="<value>", memory_entity_id="<id>", document_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Orq SDK
Feedback Evaluation Remove
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.post_v2_feedback_evaluation_remove()
# Use the SDK ...
Show Parameters
Show Parameters
Feedback Evaluation
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.post_v2_feedback_evaluation()
# Use the SDK ...
Show Parameters
Show Parameters
Policies
List Policies
Returns a paginated list of policies for the current project.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of data
Show Properties of data
Create a Policy
Creates a new router policy with model configuration, evaluators, retry settings, and limits.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.create(display_name="Zelda80")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete a Policy
Deletes an existing policy by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.policies.delete(policy_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve a Policy
Retrieves the details of an existing policy by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.retrieve(policy_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update a Policy
Partially updates an existing policy. Only provided fields are updated.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.policies.update(policy_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Projects
List Projects
Returns a list of projects. Projects are sorted by creation date, with the most recently created projects appearing first.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.projects.list()
# Handle response
print(res)
Show Response
Show Response
Create a Project
Creates a new project within the workspace. Projects organize resources like skills, deployments, and datasets.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.projects.create()
# Handle response
print(res)
Show Parameters
Show Parameters
Retrieve a Project
Retrieves the details of an existing project by its unique project ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.projects.get(project_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a Project
Delete a projectfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.projects.delete(project_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Update a Project
Updates the specified project by setting the values of the parameters passed.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.projects.update(project_id_param="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Prompts
List Prompts
Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing firstfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Create a Prompt
Create a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.create(request={
"display_name": "Raymundo83",
"prompt": {
"messages": [
{
"role": "system",
"content": "You are a helpful assistant",
},
{
"role": "user",
"content": "What is the weather today?",
},
],
"model": "openai/gpt-4o",
"max_tokens": 1000,
"temperature": 0.7,
},
"path": "Default",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of metadata
Show Properties of metadata
Show Properties of prompt
Show Properties of prompt
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}. The full list of models can be found at https://docs.orq.ai/docs/ai-gateway-supported-models. Only chat models are supported.Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Retrieve a Prompt
Retrieves a prompt objectfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.retrieve(id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Update a Prompt
Update a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.update(id="<id>", prompt={
"messages": [
{
"role": "system",
"content": "You are a helpful assistant",
},
{
"role": "user",
"content": "Hello!",
},
],
"model": "anthropic/claude-3-5-sonnet-20241022",
"temperature": 0.5,
}, path="Default")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Delete a Prompt
Delete a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.prompts.delete(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
List Versions
Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing firstfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.list_versions(prompt_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Get Version
Retrieves a specific version of a prompt by its ID and version ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.get_version(prompt_id="<id>", version_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Remoteconfigs
Retrieve a Remoteconfig
Retrieve a remote configfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.remoteconfigs.retrieve()
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Responses
Create a Response
Creates a model response for the given input. Returns a response object or a stream of server-sent events.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.responses.create()
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of text
Show Properties of text
Retrieve a Response
Retrieves a previously created response by its ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.responses.get(response_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of usage
Show Properties of usage
Show Properties of inputTokensDetails
Show Properties of inputTokensDetails
Router
Ocr
Extracts text content while maintaining document structure and hierarchyfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.ocr(model="Golf", document={
"type": "document_url",
"document_url": "https://fond-pants.net/",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Router.Audio.Speech
Create a Speech
Generates audio from the input text.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.router.audio.speech.create(input="<value>", model="Grand Caravan", voice="<value>", response_format="mp3", speed=1, retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, orq={
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high",
],
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Use the SDK ...
Show Parameters
Show Parameters
alloy, echo, fable, onyx, nova, and shimmer Available voices for ElevenLabs aria, roger, sarah, laura, charlie, george, callum, river, liam, charlotte, alice, matilda, will, jessica, eric, chris, brian, daniel, lily, billmp3, opus, aac, flac, wav, and pcm. If a format is provided but not supported by the provider, the response will be in the default format. When the provided format is not supported by the provider, the response will be in the default format.Show Properties of retry
Show Properties of retry
Router.Audio.Transcriptions
Create a Transcription
Create transcriptionfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.audio.transcriptions.create(model="Malibu", enable_logging=True, diarize=False, tag_audio_events=True, timestamps_granularity="word", temperature=0.5, timestamp_granularities=[
"word",
"segment",
], retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, orq={
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of orq
Show Properties of orq
Show Properties of retry
Show Properties of retry
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Router.Audio.Translations
Create a Translation
Create translationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.audio.translations.create(model="Impala", enable_logging=True, diarize=False, tag_audio_events=True, timestamps_granularity="word", temperature=0.5, retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, orq={
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of orq
Show Properties of orq
Show Properties of retry
Show Properties of retry
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Router.Chat.Completions
Create a Completion
Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.chat.completions.create(messages=[], model="Model 3", fallbacks=[
{
"model": "openai/gpt-4o-mini",
},
], retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
}, timeout={
"call_timeout": 30000,
}, variables={
"customer_name": "John Smith",
"product_name": "Premium Plan",
}, stream=False)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
openai/gpt-4o or anthropic/claude-haiku-4-5-20251001. The AI Gateway offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the (Supported models)[/docs/proxy/supported-models] to browse available models.Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of tools
Show Properties of tools
Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
template_engine.Show Properties of ~~`orq`~~
Show Properties of ~~`orq`~~
Show Properties of retry
Show Properties of retry
Show Properties of prompt
Show Properties of prompt
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
variables field instead. Values to replace in the prompt messages using {{variableName}} syntax.Show Properties of cache
Show Properties of cache
Show Properties of knowledgeBases
Show Properties of knowledgeBases
top_k.thresholdretrieval_typeShow Properties of rerankConfig
Show Properties of rerankConfig
Router.Completions
Create a Completion
For sending requests to legacy completion modelsfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.completions.create(model="XC90", prompt="<value>", echo=False, frequency_penalty=0, max_tokens=16, presence_penalty=0, temperature=1, top_p=1, n=1, retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, stream=False)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
adaptive for models that support adaptive thinking (e.g. Claude Opus 4.6, Sonnet 4.6), or enabled with budget_tokens for manual control.Show Properties of ~~`orq`~~
Show Properties of ~~`orq`~~
Show Properties of retry
Show Properties of retry
Show Properties of prompt
Show Properties of prompt
Show Properties of identity
Show Properties of identity
Show Properties of ~~`contact`~~
Show Properties of ~~`contact`~~
Show Properties of thread
Show Properties of thread
variables field instead. Values to replace in the prompt messages using {{variableName}} syntax.Show Properties of cache
Show Properties of cache
Show Properties of knowledgeBases
Show Properties of knowledgeBases
top_k.thresholdretrieval_typeShow Properties of rerankConfig
Show Properties of rerankConfig
Router.Embeddings
Create an Embedding
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.embeddings.create(input=[
"<value 1>",
"<value 2>",
], model="V90", encoding_format="float", fallbacks=[
{
"model": "openai/text-embedding-3-small",
},
], retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, orq={
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
Router.Images.Edits
Create an Edit
Edit an Imagefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.images.edits.create(model="LeBaron", prompt="<value>", n=1, retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
],
}, timeout={
"call_timeout": 30000,
}, orq={
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"prompt": {
"id": "prompt_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"version": "latest",
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
Router.Images.Generations
Create a Generation
Create an Imagefrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.images.generations.create(prompt="<value>", model="2", n=1, retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [],
}, timeout={
"call_timeout": 30000,
}, orq={
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
openai/gpt-image-1.openai/dall-e-2, openai/dall-e-3, or openai/gpt-image-1.gpt-image-1. Must be either low or auto.dall-e-3, only n=1 is supported.gpt-image-1 with the webp or jpeg output formats.openai/gpt-image-1.auto will automatically select the best quality for the given model.url or b64_json. This parameter isn’t supported for gpt-image-1 which will always return base64-encoded images.openai/dall-e-3. Must be one of vivid or natural.Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
Router.Images.Variations
Create a Variation
Create an Image Variationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.images.variations.create(model="Altima", n=1, response_format="url", size="1024x1024", retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [],
}, timeout={
"call_timeout": 30000,
}, orq={
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"prompt": {
"id": "prompt_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"version": "latest",
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
url or b64_json. URLs are only valid for 60 minutes after the image has been generated.256x256, 512x512, or 1024x1024.Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
Router.Moderations
Create a Moderation
Create moderationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.moderations.create(input=[], model="Fiesta")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Router.Rerank
Create a Rerank
Rerank a list of documents based on their relevance to a query.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.rerank.create(query="<value>", documents=[
"<value 1>",
], model="XTS", retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [],
}, timeout={
"call_timeout": 30000,
}, orq={
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
query. For optimal performance we recommend against sending more than 1,000 documents in a single request.Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
Show Properties of results
Show Properties of results
rerank.RoutingRules
List RoutingRules
Returns a paginated list of routing rules for the current project, ordered by priority ascending.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.routing_rules.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of data
Show Properties of data
Create a RoutingRule
Creates a new routing rule with expression, models configuration, and priority settings.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.routing_rules.create(display_name="Freeda_Beahan")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Delete a RoutingRule
Deletes an existing routing rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.routing_rules.delete(routing_rule_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve a RoutingRule
Retrieves the details of an existing routing rule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.routing_rules.retrieve(routing_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Update a RoutingRule
Partially updates an existing routing rule. Only provided fields are updated.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.routing_rules.update(routing_rule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Schedules
List Schedules
Lists all schedules attached to the specified agent, most recent first.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.schedules.list(agent_key="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Create a Schedule
Creates a schedule that runs the agent on a recurring or one-off cadence. The minimum firing interval is 1 hour forcron and interval; once schedules are exempt.
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of payload
Show Properties of payload
Delete a Schedule
Permanently removes a schedule from NATS, Mongo, and the Redis cache.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.schedules.delete(agent_key="<value>", schedule_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve a Schedule
Retrieves a single schedule by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.schedules.retrieve(agent_key="<value>", schedule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of payload
Show Properties of payload
Update a Schedule
Partially updates a schedule. Any omitted field is left unchanged. Changingexpression or type (or reactivating from inactive) re-publishes the NATS schedule and bumps generation; payload-only and agent_tag-only changes leave the firing cadence in place.
Show Parameters
Show Parameters
Show Response
Show Response
Show Properties of payload
Show Properties of payload
Trigger a Schedule
Runs the schedule’s payload immediately (≈10 seconds after the request, to stay above the NATS scheduler’s minimum deliver-at margin). The schedule’s regular cadence is unaffected. Inactive schedules return 400.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.schedules.trigger(agent_key="<value>", schedule_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Skills
List Skills
Returns a list of skills. Skills are sorted by creation date, with the most recently created skills appearing first.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.skills.list()
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Create a Skill
Skills are modular instructions you can use to codify processes and conventionsfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.skills.create()
# Handle response
print(res)
Retrieve a Skill
Retrieves an existing skill by its unique skill ID or its display name (display names are unique within a workspace).from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.skills.get(skill_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a Skill
Delete a skillfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.skills.delete(skill_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Update a Skill
Updates the specified skill by setting the values of the parameters passed.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.skills.update(skill_id_param="<value>")
# Handle response
print(res)
Show Parameters
Show Parameters
Tools
List Tools
Lists all workspace tools. By default, returns all tools in a single response. Setlimit to enable cursor-based pagination with starting_after and ending_before.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.list(limit=300)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Create a Tool
Creates a new tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.create(request=orq_ai_sdk.RequestBodyJSONSchemaTool(
path="Default",
key="<key>",
description="runway border pro mortally recount accredit promptly",
status="live",
type="json_schema",
json_schema=orq_ai_sdk.RequestBodyJSONSchema(
name="<value>",
description="lovable past madly uh-huh by",
schema_=orq_ai_sdk.RequestBodySchema(
type="<value>",
properties={
"key": "<value>",
},
required=[],
),
),
))
# Handle response
print(res)
Show Parameters
Show Parameters
Update a Tool
Updates a tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.update(tool_id="<id>", request_body=orq_ai_sdk.UpdateFunctionTool(
path="Default",
status="live",
type="function",
))
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a Tool
Deletes a tool by key.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.tools.delete(tool_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
Retrieve a Tool
Retrieves a tool by id.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.retrieve(tool_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Tools Versions
Returns version history for a specific toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.get_v2_tools_tool_id_versions(tool_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Tools Versions
Returns a specific version of a toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.get_v2_tools_tool_id_versions_version_id_(tool_id="<id>", version_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
Deployments.Metrics
Create a Metric [deprecated]
Add metrics to a deploymentfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.deployments.metrics.create(id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters