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

# Troubleshooting

> Find the cause and fix for common MCP Server and MCP Gateway failures.

| Symptom | Cause and fix |
| - | - |
| A client connects but lists no tools | The server is not synced, no server is linked, the link omits `enabled: true`, the tools are hidden, the gateway passed **Max tools / gateway**, or the token lacks `mcp:tools`. |
| A tool is missing after a sync | A new tool stays hidden on a gateway that selects tools explicitly. Expose it from the **Toolset** tab or the **Tools updated** summary. |
| A client lists three tools only | The gateway is in **Code mode**. Switch it to **Direct** to expose upstream tools individually. |
| `tool "<name>" not found` (`-32602`) | The tool is hidden, outside the caller's exposure, or the name does not match the **Tool naming** prefix. Use a name from `tools/list`. |
| `401` on connect and no browser opens | The client has no OAuth support. Use an API key header, `codex mcp login`, or a Claude Desktop connector. |
| Prompts are not reachable | The token lacks `mcp:prompts`, which is not in the default scopes. |
| `403 insufficient_scope` | Request a token with the scope the method needs: `mcp:tools`, `mcp:resources`, or `mcp:prompts`. |
| `429 rate limit exceeded` | The per-token or per-gateway limit passed the rolling 60-second window. Back off; there is no `Retry-After`. |
| `upstream tool call timed out` | The tool passed **Tool timeout**. It may have completed; retry only when the tool is safe to repeat. |
| `UPSTREAM_CREDENTIALS_UNAVAILABLE` | The upstream token endpoint refused the stored client credentials. Fix the server's OAuth client settings. |
| `Connect your account to this MCP server before using it.` | A per-user OAuth server has no connection for this user. Connect the account and retry. |
| A tool call is blocked by a guardrail | A blocking guardrail rejected the arguments or result. Change the request, result, or guardrail rule. |
| `gateway not found` | The gateway was deleted while the client still held a token. Remove the gateway URL from the client. |
| `409 COMMON_ARTIFACT_STATE_CONFLICT` | `expected_updated` no longer matches the gateway. Read the gateway again and resend. |
| A server cannot be linked to a gateway | The server is not synced, or its project access does not cover the gateway's project access. |
| A sync fails | The input schema is invalid or over a limit, its dialect is unsupported, or the upstream URL is private or unreachable. |


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