> ## Documentation Index
> Fetch the complete documentation index at: https://monid.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Your Own Proxy

> Run a proxy in front of the Monid API to control validation, billing, and endpoint access.

Run your own proxy in front of Monid, then point your users' agents (via [Skill](/guide/quickstart-skill) or [MCP](/guide/quickstart-mcp)) at your proxy. Your service sits in the middle and handles everything before the request reaches Monid.

## How It Works

<Steps>
  <Step title="Create your own proxy server">
    Stand up an HTTP server at a URL you control (e.g. `https://your-proxy.example.com`). It will accept the same request shapes as the Monid API.
  </Step>

  <Step title="Install the Monid Skill or CLI and point it at your proxy">
    Install the [Monid Skill](https://monid.ai/SKILL.md) and the [Monid CLI](/guide/quickstart-cli), then set the environment variable to your proxy URL:

    ```bash theme={null}
    export MONID_API_BASE_URL=https://your-proxy.example.com
    ```

    All Monid CLI traffic will now hit your proxy instead of `https://api.monid.ai`.
  </Step>

  <Step title="Your proxy decides and forwards">
    Every `discover`, `inspect`, and `run` call arrives at your proxy. Inspect the request, apply your own auth / billing / allowlist, and forward approved requests to `https://api.monid.ai` using your own Monid credentials. Return the response to the caller.
  </Step>
</Steps>

## What Your Proxy Can Do

* **Validate incoming requests** — authenticate your own users, enforce rate limits, and check inputs.
* **Bill your own way** — charge in dollars, credits, or subscription tiers, with or without markup on Monid's per‑call and per‑result pricing.
* **Whitelist or blocklist endpoints** — restrict which Monid endpoints your users can reach.
* **Rewrite or enrich responses** — add your own metadata, cache results, or transform payloads.

## Environment Variable

Set the Monid client's base URL to your proxy:

```bash theme={null}
export MONID_API_BASE_URL=https://your-proxy.example.com
```

The [Skill](/guide/quickstart-skill), [MCP](/guide/quickstart-mcp), [CLI](/guide/quickstart-cli), and API clients all respect this variable.

## Forwarding to Monid

Inside your proxy, forward approved requests to Monid using your own API key or an OAuth access token. Include an `x-workspace-id` header — get available workspace IDs from [`GET /v1/auth/workspaces`](/api/auth/workspaces):

```bash theme={null}
curl -X POST https://api.monid.ai/v1/run \
  -H "Authorization: Bearer <your-monid-key>" \
  -H "x-workspace-id: <workspace-id>" \
  -H "Content-Type: application/json" \
  -d '<forwarded-body>'
```

See the [API Reference](/api/overview) for the full request and response formats.

## When to Use This

Use the proxy model when you want **maximum control** over the user experience, billing, and available tools — for example, embedding Monid inside a calendar app, a workflow product, or a curated agent platform.
