# API client overview

> What Cloak Proxy's built-in API client does, how its window is laid out, how to open it with ⇧⌘O, and what each sidebar section is for.

Source: https://docs.subcloak.com/cloak-proxy/api-client/overview/

Cloak Proxy includes a Postman-style API client in its own window. You build requests, group them into collections, test responses with JavaScript, and run whole collections, all on your Mac with no account. It speaks HTTP, GraphQL, gRPC, WebSocket, Socket.IO, MQTT, MCP, AI, SQL and raw TCP or UDP, and its requests can go through the proxy so they show up next to the rest of your traffic.

Use it when you want to call an API on purpose rather than watch an app call it: to try an endpoint, reproduce a bug, write tests, or turn a request you captured into something you can edit and send again.

## Open the API client

1. Press <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>O</kbd>, or choose **File › API Client**.

   You can also click **API Client** in the main window's toolbar, or search for "API Client" in global search (<kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>A</kbd>).

2. The first time it opens, the client creates a workspace with a **Getting Started** collection (three requests against `https://httpbin.org`) and a **Local** environment, and opens the first request.

3. Press <kbd>⌘</kbd> <kbd>↩</kbd> to send it. The response, test results and console output appear in the lower half of the editor.

To jump straight to the MCP hub, press <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>M</kbd> (**File › MCP…**). See [MCP client](https://docs.subcloak.com/cloak-proxy/api-client/protocols/mcp/).

## The window

*[Screenshot: The API client window with the section rail on the left, the Collections sidebar showing a Petstore collection, a row of tabs across the top, and the Petstore collection's Overview tab open. The API client: section rail, sidebar, tabs and the editor for the selected tab.]*

> **On Linux:**
> Open the API client from the paper plane in the traffic window's toolbar, or with <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>A</kbd>. Shortcuts use <kbd>Ctrl</kbd> where the Mac uses <kbd>⌘</kbd>: <kbd>Ctrl</kbd> <kbd>T</kbd> for a new request, <kbd>Ctrl</kbd> <kbd>Enter</kbd> to send, <kbd>Ctrl</kbd> <kbd>S</kbd> to save, <kbd>Ctrl</kbd> <kbd>O</kbd> to import, <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>I</kbd> for Agent Mode. The workspace folder is `~/.local/share/cloakproxy/Workspace` (`$XDG_DATA_HOME/cloakproxy/Workspace`), in the same format as the Mac's, so a workspace in Git opens in either app.

The window has five regions, left to right:

| Region | What it does |
|---|---|
| **Rail** | One button per section. Clicking a section changes what the sidebar lists. **MCP**, **Webhooks**, **Vault** and **Git** also open their own tab. |
| **Sidebar** | The section's items. Collections, Datasets, History, Specs, Flows and Packages have a **Filter** field at the top. Drag the sidebar's right edge to resize it (200 to 460 points). |
| **Tab strip** | Every open item as a tab. A request opened with a single click shows in a preview tab, in italics, that the next click reuses; unsaved requests are marked with a dot. Right-click a tab for **Close**, **Close Other Tabs** and **Close All Tabs**. The **+** button (<kbd>⌘</kbd> <kbd>T</kbd>) opens a new HTTP request. |
| **Editor** | The selected tab. A request shows its editor on top and the response below, with a draggable divider between them. |
| **Agent panel** | Optional. **Agent** in the toolbar (<kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>I</kbd>) opens an AI assistant on the right. See [Agent Mode](https://docs.subcloak.com/cloak-proxy/api-client/agent-mode/). |

You can also drop files onto the window to import them: Postman collections and environments, OpenAPI or Swagger specs, HAR files and [Insomnia exports (v4 and v5)](https://docs.subcloak.com/cloak-proxy/api-client/import-and-export/#insomnia-exports). See [Import and export](https://docs.subcloak.com/cloak-proxy/api-client/import-and-export/).

### Toolbar

| Control | What it does |
|---|---|
| **Search** | Opens global search (<kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>A</kbd>). It finds collections, requests, environments, specs, flows, datasets, monitors and packages, as well as proxy actions and settings. |
| **New** | **HTTP Request**, **Other Protocols** (GraphQL, gRPC, WebSocket, Socket.IO, MQTT, MCP, AI, TCP / UDP, Data), **Collection**, **Environment**, **Spec** and **Flow**. |
| **Import** | Opens the Import sheet. |
| Environment menu | Picks the active environment for `{{variables}}`, or **No Environment**. **Manage Environments…** opens the Environments section. |
| **Agent** | Shows or hides the Agent panel (<kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>I</kbd>). |

## Sidebar sections

| Section | What it holds | Learn more |
|---|---|---|
| **Collections** | Collections, folders and saved requests of every protocol. | [Collections and requests](https://docs.subcloak.com/cloak-proxy/api-client/collections-and-requests/) |
| **MCP** | MCP servers saved as MCP requests, and the MCP hub. | [MCP client](https://docs.subcloak.com/cloak-proxy/api-client/protocols/mcp/) |
| **Environments** | **Globals** and your environments. The green check marks the active one. | [Variables and environments](https://docs.subcloak.com/cloak-proxy/api-client/variables-and-environments/) |
| **Datasets** | Tables of test data the runner iterates over. | [Datasets and data files](https://docs.subcloak.com/cloak-proxy/api-client/run/datasets-and-data-files/) |
| **History** | Every request you sent, grouped by day. | [History and Recently Deleted](https://docs.subcloak.com/cloak-proxy/api-client/history-and-recently-deleted/) |
| **Specs** | OpenAPI and Swagger documents. | [Specs](https://docs.subcloak.com/cloak-proxy/api-client/run/specs/) |
| **Flows** | Visual request chains. | [Flows](https://docs.subcloak.com/cloak-proxy/api-client/run/flows/) |
| **Packages** | Shared script modules and downloaded npm packages for `pm.require`. | [Scripts and tests](https://docs.subcloak.com/cloak-proxy/api-client/scripts-and-tests/#share-code-with-packages) |
| **Mocks** | Local mock servers, one per collection, with the port of each running one. | [Mock servers](https://docs.subcloak.com/cloak-proxy/api-client/run/mock-servers/) |
| **Monitors** | Scheduled collection runs. | [Monitors and webhooks](https://docs.subcloak.com/cloak-proxy/api-client/run/monitors-and-webhooks/) |
| **Webhooks** | A local receiver for webhook deliveries. | [Monitors and webhooks](https://docs.subcloak.com/cloak-proxy/api-client/run/monitors-and-webhooks/) |
| **Vault** | Secrets kept in the macOS Keychain. | [Variables and environments](https://docs.subcloak.com/cloak-proxy/api-client/variables-and-environments/#keep-secrets-in-the-vault) |
| **Git** | Commit, pull, push and branch the workspace folder. | [Workspace and Git](https://docs.subcloak.com/cloak-proxy/api-client/workspace-and-git/) |

## How the client relates to the proxy

The API client and the proxy share one app. By default, every request you send from the client goes through Cloak Proxy on its port (9090 unless you changed it), so:

- It appears in the main window's traffic list, where you can inspect it like any captured request.
- The [debugging tools](https://docs.subcloak.com/cloak-proxy/tools/overview/) apply to it: a [breakpoint](https://docs.subcloak.com/cloak-proxy/tools/breakpoint/) can pause it, [Map Local](https://docs.subcloak.com/cloak-proxy/tools/map-local/) can answer it.
- HTTPS requests are decrypted only if [SSL Proxying](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/) is on for that host.

Turn off **Send through Cloak Proxy** in a request's **Settings** tab to send it directly. Direct requests don't use the macOS system proxy either. See [Request settings](https://docs.subcloak.com/cloak-proxy/api-client/collections-and-requests/#request-settings).

The other direction works too: right-click any captured request and choose **Save to API Client**. See [Save captured requests](https://docs.subcloak.com/cloak-proxy/api-client/capture-to-client/). (added in Cloak Proxy 0.5.1) Right-click a saved request and choose **Send to Fuzzer…** to vary its inputs in the [Request fuzzer](https://docs.subcloak.com/cloak-proxy/security/request-fuzzer/).

> **What goes through the proxy is recorded:**
> Requests sent through the proxy, including their `Authorization` headers and cookies, are in the traffic list. If you export that session as HAR or publish it as a Gist, those values go with it unless you [redact](https://docs.subcloak.com/cloak-proxy/sessions/redaction/) them.

## Keyboard shortcuts

| Shortcut | Action |
|---|---|
| <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>O</kbd> | Open the API client |
| <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>M</kbd> | Open the MCP hub |
| <kbd>⌘</kbd> <kbd>T</kbd> | New HTTP request in an unsaved tab |
| <kbd>⌘</kbd> <kbd>P</kbd> (added in Cloak Proxy 0.4.1) | Go to Request: find any request by name, folder, URL or method |
| <kbd>⌘</kbd> <kbd>L</kbd> (added in Cloak Proxy 0.4.1) | Put the cursor in the URL |
| <kbd>⌘</kbd> <kbd>W</kbd> (added in Cloak Proxy 0.4.1) | Close the tab (the window when no tab is open) |
| <kbd>⌃</kbd> <kbd>Tab</kbd> / <kbd>⌃</kbd> <kbd>⇧</kbd> <kbd>Tab</kbd> (added in Cloak Proxy 0.4.1) | Next or previous tab |
| <kbd>⌘</kbd> <kbd>1</kbd> … <kbd>⌘</kbd> <kbd>9</kbd> (added in Cloak Proxy 0.4.1) | Go to tab 1 to 8, or the last tab |
| <kbd>⌥</kbd> <kbd>⌘</kbd> <kbd>1</kbd> … <kbd>⌥</kbd> <kbd>⌘</kbd> <kbd>7</kbd> (added in Cloak Proxy 0.4.1) | The request's Params, Authorization, Headers, Body, Scripts, Settings or Docs |
| <kbd>⌘</kbd> <kbd>↩</kbd> | Send the request |
| <kbd>⌘</kbd> <kbd>S</kbd> | Save an unsaved request (the shortcut of its **Save** menu) |
| <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>I</kbd> | Show or hide Agent Mode |
| <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>A</kbd> | Global search |

All of Cloak Proxy's shortcuts are in [Keyboard shortcuts](https://docs.subcloak.com/cloak-proxy/reference/keyboard-shortcuts/).

## Where your work is kept

Everything in the client lives in a workspace folder of small JSON files, one per request, so you can keep it in Git and review changes. Secret values stay in a git-ignored `.cloak/` folder, and real credentials can live in the macOS Keychain. See [Workspace and Git](https://docs.subcloak.com/cloak-proxy/api-client/workspace-and-git/).

The same workspace is available from the command line: `cloakctl collection run` runs collections in CI, and `cloakctl mcp` lets AI assistants read and edit it. See [cloakctl](https://docs.subcloak.com/cloak-proxy/automation/cloakctl/) and [MCP server](https://docs.subcloak.com/cloak-proxy/automation/mcp-server/).

## Related

  - [Collections and requests](https://docs.subcloak.com/cloak-proxy/api-client/collections-and-requests/): Build, organize and send requests.
  - [Workspace and Git](https://docs.subcloak.com/cloak-proxy/api-client/workspace-and-git/): How the workspace is stored and versioned.
  - [Scripts and tests](https://docs.subcloak.com/cloak-proxy/api-client/scripts-and-tests/): The pm API for tests and automation.
  - [Collection runner](https://docs.subcloak.com/cloak-proxy/api-client/run/collection-runner/): Run every request in a collection.
