> ## Documentation Index
> Fetch the complete documentation index at: https://copilot-api.nick3.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Control request rate limits in Copilot API

> Use rate limiting and manual approval to avoid triggering GitHub Copilot abuse detection and stay within your subscription's usage limits.

GitHub Copilot monitors usage patterns and can flag accounts that send rapid or bulk automated requests. Copilot API gives you three flags — `--rate-limit`, `--wait`, and `--manual` — to slow down or gate requests before they reach Copilot's servers. You can combine these flags with `smallModel` routing in `config.json` to further reduce how often premium quota is consumed.

<Warning>
  GitHub's Acceptable Use Policies prohibit excessive automated or bulk activity. Rapid automated use of Copilot may trigger abuse-detection systems and result in a temporary suspension of your Copilot access. Review [GitHub Acceptable Use Policies](https://docs.github.com/site-policy/acceptable-use-policies/github-acceptable-use-policies#4-spam-and-inauthentic-activity-on-github) and [GitHub Copilot Terms](https://docs.github.com/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot) before running automated workloads.
</Warning>

## Rate limiting flags

### `--rate-limit <seconds>`

The `--rate-limit` flag sets a minimum number of seconds that must pass between requests. If a new request arrives before the cooldown expires, the proxy rejects it with an error.

```bash theme={null}
npx @nick3/copilot-api@latest start --rate-limit 30
```

This enforces at least 30 seconds between each request sent upstream to Copilot.

### `--wait`

Add `--wait` alongside `--rate-limit` to make the proxy hold the request in a queue until the cooldown expires instead of returning an error. This is useful when your client does not retry automatically on rate limit errors.

```bash theme={null}
npx @nick3/copilot-api@latest start --rate-limit 30 --wait
```

<Tip>
  Use `--wait` when you want smooth operation without error-handling logic in your client. Use `--rate-limit` alone (without `--wait`) when you want the client to receive an error and decide whether to retry.
</Tip>

### `--manual`

The `--manual` flag pauses every request and prompts you in the terminal to approve or deny it before it is forwarded to Copilot. This gives you complete, per-request control over what gets sent.

```bash theme={null}
npx @nick3/copilot-api@latest start --manual
```

<Note>
  `--manual` is most useful during debugging or when you want to inspect every request interactively. It is not practical for long-running sessions where you step away from the terminal.
</Note>

## Example commands

<CodeGroup>
  ```bash Rate limit only theme={null}
  npx @nick3/copilot-api@latest start --rate-limit 30
  ```

  ```bash Rate limit with wait theme={null}
  npx @nick3/copilot-api@latest start --rate-limit 30 --wait
  ```

  ```bash Manual approval theme={null}
  npx @nick3/copilot-api@latest start --manual
  ```
</CodeGroup>

## Reducing premium request consumption

Beyond pacing requests, you can configure Copilot API to route certain low-value requests to a cheaper model so they do not spend your premium quota.

**`smallModel`** — Set this in `config.json` to a free or cheaper model (default: `gpt-5-mini`). The proxy uses `smallModel` for tool-less warmup probes, compact/background requests, and other housekeeping turns that do not need a premium model.

**`compactUseSmallModel`** — When `true` (the default), detected compact requests from Claude Code or OpenCode are automatically routed to `smallModel`. Set it to `false` only if you want compact requests to use the full model.

```json config.json theme={null}
{
  "smallModel": "gpt-5-mini",
  "compactUseSmallModel": true
}
```

<Note>
  Premium request optimizations — including `smallModel` routing and compact detection — are covered in more detail in the [configuration reference](/configuration/config-file).
</Note>
