SDK reference for Model state and lookup in the Models API, available in Node.js and Python.
Models
Validate a Model
Validates a provider endpoint by performing a minimal live probe. Currently supports Azure OpenAI. Response includes the resolved region, whether the model is known to Orq, and either the full model document or a synthesized default.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: orq.models.validate(api_key="<value>", provider="<value>")
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { await orq.models.validate({ apiKey: "<value>", provider: "<value>", });}run();
Deletes a custom model from the workspace. System models cannot be deleted. Returns 200 with an explanatory message if the model is a system model or is still referenced by experiments.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: orq.models.delete(id="<id>")
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { await orq.models.delete({ id: "<id>", });}run();
Show Parameters
{ "id": str, # required}
{ id: string; // required}
Enable a Model
Adds the model to the workspace’s enabled set. Idempotent: re-enabling an already-enabled model returns 204 with no state change.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: orq.models.enable(model_id="<id>")
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { await orq.models.enable({ modelId: "<id>", });}run();
Show Parameters
{ "model_id": str, # required}
{ modelId: string; // required}
Disable a Model
Removes the model from the workspace’s enabled set. Idempotent: disabling an already-disabled model returns 204.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: orq.models.disable(model_id="<id>")
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { await orq.models.disable({ modelId: "<id>", });}run();
Show Parameters
{ "model_id": str, # required}
{ modelId: string; // required}
List Models
Lists all models available through the AI Router. Returns each model in OpenAI-compatible shape with its provider, ID, and creation timestamp.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.models.list() # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.models.list(); console.log(result);}run();