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

# Gateway-only SSO for MCP gateways

> Let employees use approved MCP gateways through Entra ID or Okta without becoming workspace members.

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

Gateway-only SSO connects an identity provider so employees can use approved MCP gateways. They sign in with their company account and connect their own upstream accounts.

Gateway users are not workspace members. They have no seat, no Studio access and no role, and they do not appear in member lists, teams or pickers. Admins see them on the **Gateway users** page.

## Set Up a Gateway Connection

Workspace admins manage gateway connections, and admins and management keys with SSO access manage gateway users and rules. Other API keys cannot.

**1. Create a dedicated application in the identity provider**

Use a new OIDC or SAML application, separate from the one used for Studio sign-in. Assignment to this application becomes the outer access gate.

**2. Add the connection**

Open **Organization > Gateway users** and add a connection. Enter the protocol settings, allowed email domains, allowed OAuth clients and the immutable user claim.

**3. Map groups to gateways**

Add a rule for each identity provider group, naming the gateways its members may use. Rules are the grant: a gateway shared with all projects is still reachable only through a rule.

**4. Configure SCIM**

Generate a SCIM token on the same page and configure the identity provider with the SCIM endpoint shown there. SCIM is optional, and it decides how quickly access ends. See [Offboarding](#offboarding).

### Immutable User Claim

Every connection needs a claim or SAML attribute that never changes for a person, such as `oid` in Entra ID. SSO and SCIM use it to resolve to one user. Email is never used for this.

If SCIM is configured, the SCIM `externalId` must carry the same value. When a login matches no provisioned user, it is denied.

### Identity Provider Requirements

> [accordion] Microsoft Entra ID
>
> * Set the correlation claim to `oid`, or for SAML to the object identifier attribute.
> * Change the SCIM `externalId` mapping to `objectId`. Check this first: the default mapping is reported to use `mailNickname`, which will not match and denies login.
> * Limit the groups claim to groups assigned to the application. Beyond 200 groups in OIDC tokens or 150 in SAML, Entra omits the list, and the login is denied.

> [accordion] SAML
>
> * Use a persistent NameID that is not an email address. Transient and email-shaped NameIDs are refused.
> * Use a SAML entity ID unique to this connection.
> * Sign in starts from the MCP client. IdP-initiated sign-in is not supported, and neither is SAML single logout.

> [accordion] Group IDs
>
> Rules match the value the identity provider sends in the groups claim, and the SCIM group `externalId`. Use an immutable group ID, and confirm the provider sends the same value in both.

## Sign In as an Employee

1. Add the gateway to an MCP client that the connection allows, using the gateway URL with its ID.
2. Approve the request in the browser, after signing in with single sign-on.
3. When a tool needs an upstream account, open the connection link and approve it.

A gateway URL that uses a key needs a `workspace` hint, because keys are unique only within a workspace.

## Offboarding

| Event | When access ends |
| - | - |
| SCIM deactivation or removal | Next request after the push arrives |
| SCIM group change | Next request after the push arrives |
| Rule, client allowlist or connection change | Next request |
| Disabling a user on the **Gateway users** page | Next request |
| Identity provider disable without SCIM | At the next sign-in, or at the maximum session age |

The maximum session age defaults to 24 hours and is set per connection. Refreshing cannot extend it.

Configuring SCIM is the customer's responsibility. Without it, group changes apply only at the next sign-in.

After deactivation, tokens, upstream connections, consent and the analytics identity are removed in the background. Upstream tokens are revoked where the upstream supports it.

In-flight requests may finish. If invalidation fails, SCIM returns an error so the identity provider retries, and the longest access continues is the 10-minute access token lifetime plus one minute of clock leeway.

## What Gateway Users Can Reach

Their tokens work only on gateway execution, and only for a gateway their rules grant and a client on the connection's list. Each request also checks the workspace's blocked and archived state, IP allowlist and SSO entitlement.

A gateway user who matches a workspace member by email is shown as linked for access reviews. The link is an identity provider assertion, not proof of identity, and it grants nothing.

## Limits

* Replacing the identity provider tenant or connection creates new identities, and users must reconnect upstream accounts.
* Enterprise-managed (ID-JAG) upstream servers are not available to gateway users, and calls return a clear error.
* Traces use the gateway's project when it is shared with exactly one. Otherwise they stay at workspace level.
* Gateway users appear in traces and on the Identities page as opaque IDs, without names or emails.


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