> ## 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. Cursor receives the Orq MCP server and Orq Skills only; its model calls are not routed through the AI Gateway. 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`.
> To enable a model for the workspace, ask a human to enable it in the Model Garden, or call `POST /v2/workspace-models` with a Management Key that has `workspace-model` write; API keys are rejected with `403`. Use the model's exact `provider/model` id. 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.

# Linear integration

> Connect Linear to start Factory Sessions from issues, route issues to the right Factory, and trigger Loops on Linear events.

Beta

> [!NOTE]
>
> **Factory** is in private preview and is enabled per workspace by the **Orq.ai** team.

The Linear integration lets work start from the ticket. Delegating an issue to the agent starts a [Session](https://docs.orq.ai/factory/sessions.md) with the issue as its task, and [Loops](https://docs.orq.ai/factory/loops.md) can react to what happens in a Linear team.

## Connect Linear

Go to **Settings** > **Integrations**, click **Connect** next to **Linear** and authorize the Linear workspace.

## Start a Session from an issue

Delegate a Linear issue to orq, or mention it in a comment. A Session starts in a Factory with the issue as its task.

## Route issues to a Factory

**Linear routing** decides which Factory takes an issue. Open the Linear connection to configure it.

| Setting | Description |
| - | - |
| **Rules** | Conditions on the issue, each with a Factory to send it to. Up to 32. |
| **Default factory** | The Factory that takes an issue no rule matches. |

Rules are checked from top to bottom and the first match wins. Drag a rule to change its position. The Session stays in the chosen Factory until it ends.

A condition compares one of these fields.

| Field | Example use |
| - | - |
| Issue identifier | Route by the team prefix of the issue key. |
| Issue title | Route issues with a keyword in the title. |
| Issue description | Route by a keyword in the description. |
| Team | Send each Linear team to its own Factory. |
| Creator | Route by who created the issue. |
| First comment | Route by the text of the delegating comment. |

## Trigger Loops from Linear

A Loop can run on these events, scoped to a Linear team.

| Event | Typical use |
| - | - |
| **Issue** | Triage or enrich a new issue. |
| **Comment** | React to a comment on an issue. |
| **Issue SLA** | Act when an SLA is at risk or breached. |
| **Customer request** | Investigate an incoming customer request. |
| **Cycle** | Report when a cycle starts or ends. |
| **Project** | React to a project change. |
| **Project update** | React to a posted project update. |

See [Loops](https://docs.orq.ai/factory/loops.md#triggers).


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