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

# GitHub integration

> Install the Orq.ai GitHub App so Factory Sessions can clone repositories, open pull requests and react to GitHub events.

Beta

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

GitHub is the integration a **Factory** needs first: without it, Sessions have no code to work on. It is connected by installing the **Orq.ai** GitHub App on a user or an organization.

## Connect GitHub

1. Go to **Settings** > **Integrations** and click **Connect** next to **GitHub**.
2. On GitHub, choose the account, then **All repositories** or a selection.
3. Install the App. GitHub returns to **Orq.ai** and the connection appears in the list.

Install the App on every account whose repositories Sessions should work on. A workspace can hold several GitHub connections.

## What it enables

| Capability | Where it shows |
| - | - |
| Repository access | The repository picker of a [Session](https://docs.orq.ai/factory/sessions.md), a [Loop](https://docs.orq.ai/factory/loops.md) and a [Runner](https://docs.orq.ai/factory/runners.md). |
| Pull requests | **Open PR** on the result card of a Session. |
| Event triggers | The **Event** trigger of a Loop. |

The connected repositories are listed in **Settings** > [Repositories](https://docs.orq.ai/factory/repositories.md).

## Trigger Loops from GitHub

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

| Event | Typical use |
| - | - |
| **Issue** | Triage or fix a new issue. |
| **Issue or PR comment** | React to a command in a comment. |
| **Pull request** | Review every pull request. |
| **PR review** | Address a submitted review. |
| **PR review comment** | Address a single review comment. |
| **Check run** | Fix a failing check. |
| **Push** | Run a task on every push. |

Events caused by the Factory itself are ignored unless the trigger includes app events. See [Loops](https://docs.orq.ai/factory/loops.md#triggers).

## Change the repository selection

Change which repositories the App covers in the GitHub settings of the account. The repository list in **Orq.ai** follows the installation.


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