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

# SSO group mapping on-premise

> Grant Orq.ai Teams and workspace roles from identity provider groups on an on-premise install with ORQ_SSO_GROUP_MAPPING.

Feature available with the [Enterprise Plan](https://orq.ai/solutions/enterprise)

`ORQ_SSO_GROUP_MAPPING` grants **Teams** and workspace roles from the identity provider's groups. It applies on every OIDC or SAML login and every [SCIM](https://docs.orq.ai/ai-studio/organization/sso.md#scim-provisioning) update.

## Setup

Requires chart 1.15.0 or later and `workspaceSetup.ORQ_SSO_ENABLED: "true"`. Set the mapping as JSON in the Helm values:

```yaml values.yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
workspaceSetup:
  ORQ_SSO_ENABLED: "true"
  ORQ_SSO_GROUP_MAPPING: |
    {
      "enabled": true,
      "mappings": [
        { "idpGroup": "orq-admins", "role": "admin" },
        { "idpGroup": "engineering", "teamIds": ["<team-id>"], "role": "developer" }
      ]
    }
```

The value can also be a key in the Secret named by `workspaceSetup.existingSsoSecret`.

> [!WARNING]
>
> Helm values own the whole SSO configuration. Each install and upgrade overwrites a mapping saved in the UI, and an empty value removes it.

## Fields

| Field | Description |
| - | - |
| `enabled` | Must be `true`, or the mapping does nothing |
| `mappings[].idpGroup` | Group name as the identity provider sends it, matched case-insensitively. Microsoft Entra ID sends the group GUID |
| `mappings[].teamIds` | **Team** IDs to add the user to |
| `mappings[].role` | `admin`, `developer`, `researcher`, or a custom role ID |
| `defaultRole` | Optional: `developer` (default) or `researcher`. Role a user gets back when a mapped role stops applying |
| `attribute` | Optional: claim or attribute holding the groups. Defaults to `groups`, `memberOf`, or the Microsoft groups claim |

Each mapping needs `teamIds`, `role`, or both.

To find a team ID, open the team under **Settings → Organization → Teams & Members** and copy the last part of the URL. On a new install, start with roles only, create the teams, then add their IDs and upgrade.

## Behavior

* The mapping only removes access it granted. Team members added by hand stay.
* When several groups match, the highest role wins: Admin, custom role, Developer, Researcher.
* A mapped role replaces a lower role set by hand. An Admin set by hand is never changed.
* The last workspace admin is never demoted.
* Changes apply at each user's next login or SCIM update.
* Setting `enabled` to `false` stops syncing but keeps access already granted.
* An invalid mapping fails the workspace-setup hook, and with it the Helm upgrade.


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