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

# Plans

> Write a Plan with an agent, collect comments and decisions from the team, and agree on the approach before a pull request is opened.

Beta

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

## Use cases

> [accordion] Shorten pull request review
>
> Settle scope, approach and trade-offs on the Plan, so the pull request review checks the implementation instead of reopening the design.

> [accordion] Align several people on one change
>
> Collect comments and answers from everyone affected in one document, instead of spreading them over chat threads and review comments.

> [accordion] Give the agent a precise brief
>
> Ask the agent to implement the agreed Plan in the same Session, so it builds on decisions that were already made.

## Overview

A **Plan** is a Markdown document that describes a change before it is built. Every Plan has a [Session](https://docs.orq.ai/factory/sessions.md) attached. The owner iterates on the Plan with the agent in that Session, and teammates comment and answer the questions the agent raises. Disagreements surface while the change is still cheap to redirect, which is what takes time out of the pull request: reviewers have already agreed on what is being built. Plans live in the **Plans** page of the Factory sidebar.

## Create a Plan

A Plan starts in one of two ways.

| Start | How |
| - | - |
| By hand | Click **Plan** on the **Plans** page, enter a title, write the Plan in Markdown and click **Create**. |
| From a [Session](https://docs.orq.ai/factory/sessions.md) | Ask the agent to plan the work. The published Plan appears in the Session **Artifacts** and on the **Plans** page. |

## Iterate with the agent

The owner of a Plan works on it in the chat next to the document.

1. Describe the change in the composer.
2. Click **Iterate**.

The agent decides what the message needs. It answers a question in the chat, publishes a new revision, or asks for a decision first.

## Collaborate on a Plan

Everyone with access to the Factory can review a Plan. Each role has its own part.

| Who | Can do |
| - | - |
| Owner | Send messages to the agent, start and stop an iteration. |
| Teammates | Comment on the Plan and answer open decisions. |
| Agent | Revise the Plan, then resolve or dismiss each comment it handled. |

### Comments

Comment on the whole Plan, or select a passage and comment inline. Open comments are sent to the agent with the next message.

A comment is **Open** until the agent marks it **Resolved** or **Dismissed**. A dismissed comment carries the reason. The **Annotations** tab lists all comments.

### Decisions

When a choice changes the Plan and the agent cannot infer it, the agent asks a decision. Each decision is a single-choice, multiple-choice or free-text question, and it comes with a recommended option.

The chat is blocked until every open decision is answered. Teammates can answer, and the owner then continues the iteration.

### Revisions

Every change the agent publishes is a new revision.

* **Go to revision**: open an earlier revision.
* **Show changes**: compare revisions in a split or unified diff.

## From Plan to pull request

Once comments are resolved and decisions are answered, the Plan is the agreed brief. The owner implements it in the Session attached to the Plan.

1. Open the **Session** tab of the Plan.
2. Ask the agent to implement the Plan.
3. Review the changes and click **Open PR**.

The agent keeps the whole planning conversation, so the implementation follows the comments and decisions the team already settled.

## Limitations

| Limitation | Impact | Workaround |
| - | - | - |
| Only the owner messages the agent | Teammates cannot start an iteration or the implementation | Leave a comment; it is sent with the owner's next message |
| Comments cannot be reopened | A resolved or dismissed comment stays closed | Add a new comment |


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