> ## 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.

> ## Agent Instructions
> Orq.ai is the control plane for model and MCP traffic: one key reaches the workspace's enabled models, MCP servers, and resources. The setup depends on where the agent runs.
> Hosted assistant (ChatGPT, claude.ai, a hosted sandbox): install nothing. Tell the human to add https://my.orq.ai/v2/mcp as a remote MCP connector and finish the Orq.ai sign-in. With OAuth, send no Authorization header; otherwise send an API key as a bearer token.
> Local coding agent (Claude Code, Codex, Cursor, OpenCode): run `curl -fsSL https://cli.orq.ai/install.sh | sh`. It installs the CLI and runs `orq setup`, which signs in, writes a project-scoped key to `~/.orq/env`, and wires the detected agents through the AI Gateway. It can also add the Orq MCP server and Orq Skills, the workflows for agents, evaluations, and traces: https://docs.orq.ai/ai-studio/integrations/code-assistants/orq-skills.md. Verify with `orq status`.
> Headless or CI: read `ORQ_API_KEY` from the environment; a human creates the key at https://docs.orq.ai/ai-studio/organization/api-keys.md.
> Send model traffic to https://my.orq.ai/v3/router with `Authorization: Bearer $ORQ_API_KEY`; the Anthropic SDK uses https://my.orq.ai/v3/anthropic. New integrations go on `/v3/router`: `/v2/router` stays published for backward compatibility, and `orq.prompt` works only on `/v2/router/chat/completions`.
> Enable a model for the workspace and use its exact `provider/model` id. `POST /v2/workspace-models` enables a model, and a call fails while the workspace has neither credits nor a provider key.
> On `/chat/completions`, a reasoning model rejects `tools` with a `reasoning_effort` other than `none`; `/responses` keeps reasoning.
> On a failure, branch on `error.code` and follow `error.doc_url`; a budget rejection answers 429.

# VirtualModels SDK Reference

> SDK reference for the VirtualModels API, available in Node.js and Python.

## VirtualModels

### List VirtualModels

List virtual models

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY"),
) as orq:

    res = orq.virtual_models.list()

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.virtualModels.list();

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "limit": Optional[int],
    "starting_after": Optional[str],
    "search": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  limit?: number;
  startingAfter?: string;
  search?: string;
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "object": Optional[str],
    "data": [{  # optional
        "virtual_model_id": Optional[str],
        "workspace_id": Optional[str],
        "slug": Optional[str],
        "display_name": Optional[str],
        "target_model": Optional[str],
        "model_ref": Optional[str],
        "created_at": str,  # optional
        "updated_at": str,  # optional
    }],
    "has_more": Optional[bool],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  object?: string;
  data?: {
    virtualModelId?: string;
    workspaceId?: string;
    slug?: string;
    displayName?: string;
    targetModel?: string;
    modelRef?: string;
    createdAt?: Date;
    updatedAt?: Date;
  }[];
  hasMore?: boolean;
}
```

### Create a VirtualModel

Creates a workspace alias. Requests to orq/\<slug> run on the target model.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY"),
) as orq:

    res = orq.virtual_models.create(display_name="<value>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.virtualModels.create({
    displayName: "<value>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "slug": Optional[str],
    "display_name": Optional[str],
    "target_model": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  slug?: string;
  displayName?: string;
  targetModel?: string;
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model": {  # optional
        "virtual_model_id": Optional[str],
        "workspace_id": Optional[str],
        "slug": Optional[str],
        "display_name": Optional[str],
        "target_model": Optional[str],
        "model_ref": Optional[str],
        "created_at": str,  # optional
        "updated_at": str,  # optional
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModel?: {
    virtualModelId?: string;
    workspaceId?: string;
    slug?: string;
    displayName?: string;
    targetModel?: string;
    modelRef?: string;
    createdAt?: Date;
    updatedAt?: Date;
  };
}
```

### Retrieve a VirtualModel

Get a virtual model

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY"),
) as orq:

    res = orq.virtual_models.get(virtual_model_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.virtualModels.get({
    virtualModelId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModelId: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model": {  # optional
        "virtual_model_id": Optional[str],
        "workspace_id": Optional[str],
        "slug": Optional[str],
        "display_name": Optional[str],
        "target_model": Optional[str],
        "model_ref": Optional[str],
        "created_at": str,  # optional
        "updated_at": str,  # optional
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModel?: {
    virtualModelId?: string;
    workspaceId?: string;
    slug?: string;
    displayName?: string;
    targetModel?: string;
    modelRef?: string;
    createdAt?: Date;
    updatedAt?: Date;
  };
}
```

### Delete a VirtualModel

Delete a virtual model

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY"),
) as orq:

    res = orq.virtual_models.delete(virtual_model_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.virtualModels.delete({
    virtualModelId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModelId: string;  // required
}
```

### Update a VirtualModel

Changes the name or the target model. The slug cannot change.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY"),
) as orq:

    res = orq.virtual_models.update(virtual_model_id="<id>", display_name="<value>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.virtualModels.update({
    virtualModelId: "<id>",
    updateVirtualModelRequest: {
      displayName: "<value>",
    },
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model_id": str,  # required
    "display_name": Optional[str],
    "target_model": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModelId: string;  // required
  updateVirtualModelRequest: {  // required
    displayName?: string;
    targetModel?: string;
  };
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "virtual_model": {  # optional
        "virtual_model_id": Optional[str],
        "workspace_id": Optional[str],
        "slug": Optional[str],
        "display_name": Optional[str],
        "target_model": Optional[str],
        "model_ref": Optional[str],
        "created_at": str,  # optional
        "updated_at": str,  # optional
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  virtualModel?: {
    virtualModelId?: string;
    workspaceId?: string;
    slug?: string;
    displayName?: string;
    targetModel?: string;
    modelRef?: string;
    createdAt?: Date;
    updatedAt?: Date;
  };
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.