API/MCP Gateway
https://gateway.api.metricsensei.com
Version: v14 (older)
You're reading the docs for v14, an older version that is still live. The current version is v16: read its docs.
Two APIs, one way of working
Metric Sensei has two public APIs. They do different jobs, but they are laid out the same way and take the same token, so what you learn on one works on the other.
| Admin API | API/MCP Gateway this guide | |
|---|---|---|
| Use it to | Manage your account: clients, people and their access, data sources and connections, website tracking, services and billing. Everything the admin page does. | Use a client's data: run reports and tools on Google Analytics, Ads, Shopify, Meta and the other connected sources, from your scripts and from AI apps. |
| Address | https://api.metricsensei.com | https://gateway.api.metricsensei.com |
| REST | https://api.metricsensei.com/clients and so on | https://gateway.api.metricsensei.com/tools and so on |
| AI apps (MCP) | https://api.metricsensei.com/mcp | https://gateway.api.metricsensei.com/mcp |
| Guide | /docs | /docs |
| OpenAPI | /openapi.json | https://gateway.api.metricsensei.com/openapi.json |
| Versions | /versions | /versions |
Connect an AI app: /mcp and sign in
AI apps such as Claude and ChatGPT connect to /mcp on either API and sign in with your Metric Sensei account: no token to copy. On the Admin API you choose read only or read and change; on the gateway you pick the client. The app then acts as you, with your own access. A sign-in for one API never works on the other, so connect each one the app should use. Sign apps out in the admin page.
One token for both
Create a personal API token in the admin page (it starts with msat_) and send it as Authorization: Bearer <token>. It acts as you, with your own role, on both APIs. A token names a person, not a client, so on the gateway also say which client you mean with the Metric-Sensei-Client: <client ID> header. A read-only token can read on both and change nothing.
export MS_TOKEN=msat_...
# Admin API: the clients you manage
curl -s https://api.metricsensei.com/clients -H "Authorization: Bearer $MS_TOKEN"
# API/MCP Gateway: the tools you can run for the client acme
curl -s https://gateway.api.metricsensei.com/tools -H "Authorization: Bearer $MS_TOKEN" -H "Metric-Sensei-Client: acme"The gateway also takes a gateway API key (mcpgw_), which belongs to one client and needs no header.
The same on both
- REST lives at the root of the address, AI apps connect at
/mcp, and this guide is at/docs. - Without a version you get the latest. Put
/v<N>first in the path, or sendMetric-Sensei-Version: <N>, to stay on one version;/versionslists them. - Answers are JSON. Errors have an
errorcode and a plainmessage.
Using the gateway
Every tool is available two ways: to AI apps at https://gateway.api.metricsensei.com/mcp, and as plain JSON for scripts.
| Call | What you get |
|---|---|
GET /connections | The connections you can use, with your access to each |
GET /tools | The tools you can run, with the fields each one takes |
POST /tools/{tool} | Runs a tool. The body is the tool's fields; the answer is {"result": ...} |
GET /openapi.json | An OpenAPI 3.1 document of your tools |
curl -s https://gateway.api.metricsensei.com/tools/ga4_run_report \
-H "Authorization: Bearer $MS_TOKEN" -H "Metric-Sensei-Client: acme" -H "content-type: application/json" \
-d '{"metrics": ["sessions"], "dimensions": ["date"]}'
Which tools you see depends on the client's connections and your access to them. Tools that change something need a connection that allows changes and a token that isn't read-only.
Connect an AI app
Add https://gateway.api.metricsensei.com/mcp as a remote MCP server and sign in when the app asks. You sign in with your
Metric Sensei account and pick the client; the app then sees only the tools you have access to there.
- Claude (claude.ai, Desktop and mobile): Settings → Connectors → Add custom connector, paste
https://gateway.api.metricsensei.com/mcp, then Connect. - Claude Code:
claude mcp add --transport http metricsensei https://gateway.api.metricsensei.com/mcp, then run/mcpand choose Authenticate. - ChatGPT, Cursor, VS Code and others: add a remote server with the Streamable HTTP transport and choose OAuth sign-in.
No client ID is needed: apps find the sign-in through
https://gateway.api.metricsensei.com/.well-known/oauth-protected-resource/mcpand register themselves. - Apps that can only send a fixed header: send
Authorization: Bearerwith a gateway API key, or a personal token plus theMetric-Sensei-Clientheader.
Signed-in apps are listed in the admin page under Connect an AI app, where you can sign them out.
To let an AI app manage Metric Sensei itself, connect it to the Admin API's /mcp the same way.
How versions work
Every deploy of the API/MCP Gateway is a new API version: v1, v2, v3 and so on. Older versions keep running unchanged until they're retired.
- Without a version you always get the latest:
https://gateway.api.metricsensei.com/mcp,https://gateway.api.metricsensei.com/tools. - To pin a version, put it before the path:
https://gateway.api.metricsensei.com/v16/mcp. - Or send a header:
Metric-Sensei-Version: 16. - Every response carries the version that answered it in the
Metric-Sensei-Versionheader. - A retired version answers
410 Gone, and an unknown one404. Move to the latest or a live version.
Versions
| Version | Released | Status | Pinned URL |
|---|---|---|---|
| v16 latest | 2026-11-12 | live | https://gateway.api.metricsensei.com/v16 |
| v15 | 2026-11-12 | live | https://gateway.api.metricsensei.com/v15 |
| v14 | 2026-11-11 | live | https://gateway.api.metricsensei.com/v14 |
| v13 | 2026-11-10 | retired 2026-11-11 | https://gateway.api.metricsensei.com/v13 |
| v12 | 2026-11-10 | retired 2026-11-10 | https://gateway.api.metricsensei.com/v12 |
| v11 | 2026-11-09 | retired 2026-11-10 | https://gateway.api.metricsensei.com/v11 |
| v10 | 2026-11-09 | retired 2026-11-09 | https://gateway.api.metricsensei.com/v10 |
| v9 | 2026-11-08 | retired 2026-11-09: Use the latest version | https://gateway.api.metricsensei.com/v9 |
| v8 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v8 |
| v7 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v7 |
| v6 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v6 |
| v5 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v5 |
| v4 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v4 |
| v3 | 2026-11-08 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v3 |
| v2 | 2026-11-07 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v2 |
| v1 | 2026-11-07 | retired 2026-11-08: Use the latest version | https://gateway.api.metricsensei.com/v1 |
As JSON: GET https://gateway.api.metricsensei.com/versions
Limits
Each client may make a set number of requests a minute, counted across all its API keys and signed-in apps.
Above that the API answers 429 with a Retry-After header saying how many seconds to wait.
Examples
curl -H "Authorization: Bearer $API_KEY" https://gateway.api.metricsensei.com/tools curl -H "Authorization: Bearer $API_KEY" https://gateway.api.metricsensei.com/v16/tools curl -H "Authorization: Bearer $API_KEY" -H "Metric-Sensei-Version: 16" https://gateway.api.metricsensei.com/tools
For an AI app, use https://gateway.api.metricsensei.com/mcp to follow the latest version, or https://gateway.api.metricsensei.com/v16/mcp to stay on one. Sign-in works the same on every version.