Prototypr Docs Logo Docs

AI Agents API Endpoints Documentation

The Premium endpoints in this doc have been created to support organizations with AI Agents that can explore, visualize and analyze data.

As a prototypr.ai customer, it is important to provide you with easy access to your data in a variety of formats that you can use. In order to gain access to agents via the prototypr.ai API, you will need to sign up to a Plus membership from within the app and generate an API Key, which is accessible from the /home page when you login.

AI Agent Endpoints

As a Premium prototypr.ai customer or member, you have access to the following Agents via the API:

  • Fine Tuned Google Analytics GPT Agent

    Chat with your GA4 data and build complex analysis pipelines.

  • AI Memory

    Export product, analytics, UX data, survey feedback, and experiment context in one transparent memory layer and bring that context into other AI workflows.

More agent APIs will be available soon! If you have any feedback or feature requests about these APIs, please take the time to fill out this short survey.

AI Agent Use Case: Building a GA4 Chatbot

One of the ways that prototypr.ai is using the fine tuned GA4 GPT agent API is to power a chatbot that enables customers to chat with their Google Analytics data. If you or your company is using Google Analytics 4, then why not consider building a chatbot with this Agent to enable easier access to your data.

Below is a example video of a Google Analytics 4 GPT chatbot in the beta AI Analytics platform, which is prototypr.ai's analytics platform:

Fine Tuned Google Analytics GPT Agent PREVIEW

Purpose

Enable developers to Chat with their Google Analytics data, build Google Analytics 4 API queries and visualize data with ChartJS.

Type: POST

URL: https://www.prototypr.ai/api/v1/agents/ga4-gpt

Headers

  • Authentication: Bearer ${TOKEN}
  • Content-Type: application/json
  • Accept: application/json

Request Body

  • user_id: String

    Your unique prototypr.ai user_id.

  • workspace_id: String

    Connected to your GA4 account. How to connect GA4 guide.

  • messages: Array

    Standardized chat completions message thread.

  • gpt_data_analysis: Boolean

    Setting to True enables deeper analysis on returned data.

Python Request

import requests
import os
import json

messages_thread = []
messages_thread.append({
    "role": "user",
    "content": "how many users visited my site yesterday?"
})

url = "https://www.prototypr.ai/api/v1/agents/ga4-gpt"

payload = {
    "user_id": "your_user_id",
    "workspace_id": "your_workspace_id",
    "messages": messages_thread,
    "gpt_data_analysis": True
}

headers = {
    "Authorization": "Bearer " + os.getenv("API_KEY"),
    "Content-Type": "application/json"
}

response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())

Sample Response

{ "data": {
    "credit_balance": 99,
    "google_analytics_data" : [
      {
        "kind": "analyticsData#runReport",
        "metaData": {
            "currencyCode": "CAD",
            "timeZone": "America/Toronto"
        },
        "metricHeaders": [
            {
                "name": "activeUsers",
                "type": "America/TYPE_INTEGER"
            }
        ],
        "rowCount": 1,
        "rows": [
            {
                "metricValues": [
                    {
                        "value": "89"
                    }
                ]
            }
        ],
        "totals": [
            {
                "metricValues": [
                    {
                        "value": "89"
                    }
                ]
            }
        ]
      }
    ],
    "google_analytics_query" : {
        "dateRanges": [
            {
                "endDate": "yesterday"
                "startDate": "yesterday"
            }
        ],
        "keepEmptyRows": True,
        "metricAggregations": [
            "TOTAL"
        ],
        "metrics": [
            {
                "name": "activeUsers"
            }
        ]
    },
    "gpt_data_analysis": "<div><p class='analysis-copy'>Yesterday, the site attracted a total of 89 active users, indicating stable engagement.</p></div>",
    "request_log": {
        "request_count": "1",
        "request_date": "2024-12-09 11:45:00",
        "request_id": "8e4249ed56d44f543487c4bf8f16b649",
        "service": "/agents/ga4-gpt"
    },
    "messages_thread": [
        {
            "content": "how many users visited my site yesterday",
            "role": "user",
        },
        {
            "content": "{\"metrics\": [{\"name\": \"activeUsers\"}], \"dateRanges\": [{\"startDate\": \"yesterday\", \"endDate\": \"yesterday\"}], \"keepEmptyRows\": true, \"metricAggregations\": [\"TOTAL\"]}",
            "role": "assistant",
        },
        {
            "content": "[{\"metricHeaders\": [{\"name\": \"activeUsers\", \"type\": \"TYPE_INTEGER\"}], \"rows\": [{\"metricValues\": [{\"value\": \"89\"}]}], \"totals\": [{\"metricValues\": [{\"value\": \"89\"}]}], \"rowCount\": 1, \"metadata\": {\"currencyCode\": \"CAD\", \"timeZone\": \"America/Toronto\"}, \"kind\": \"analyticsData#runReport\"}]",
            "role": "assistant",
        },
        {
            "content": "<div><p class='analysis-copy'>Yesterday, the site attracted a total of 89 active users, indicating stable engagement.</p></div>",
            "role": "assistant"
        }
    ],
    "model": "ga4-gpt-ft"
  }
}                           

Google Analytics MCP Agent

Alternatively, if you would rather access this fine tuned Analytics Agent, you can connect with it via our custom Agent MCP Server.

In order to access this Agent, you will need to generate a prototypr.ai API key and fill out the information below.

{
  "mcpServers": {
    "ga4_agent": {
      "url": "https://www.prototypr.ai/mcp/agents/ga4",
      "displayName": "Google Analytics Agent",
      "headers": {
        "Authorization": "Bearer INSERT_PROTOTYPR_AI_API_KEY",
        "X-User-Id": "INSERT_USER_ID",
        "X-Workspace-Id": "INSERT_WORKSPACE_ID"
      }
    }
  }
}

How to Install: In your AI Workspace, click on MCP Tools, then Add Server. Paste the JSON config above and save.

GA4 API MCP FAQ

How do I connect Google Analytics 4 to a prototypr.ai workspace?

1. Sign up to the Closed GA4 x AI Beta from the /home page. Click on the Analytics icon and register.

2. Once approved, visit the GA4 connection guide to authenticate via OAuth.

How much does it cost to access the GA4 Agent via API or MCP?

Currently, access to the API and MCP client in prototypr.ai requires a $29/month Plus membership subscription. Prices are expected to increase, so subscribe today to keep that price.

Why is prototypr.ai API / MCP a premium feature?

To cover the costs of serving leading LLMs such as ChatGPT and Google Gemini with data analysis baked in, prototypr.ai needs to charge for MCP access. It's with your support that prototypr.ai is able to bring new MCP capabilities to market.

AI Agent Memory PREVIEW

Purpose

Bring your agent's memory with you around the web and make it available to other applications and shared agents.

Type: POST

URL: https://www.prototypr.ai/api/v1/agents/memory

Request Body

  • user_id: String

  • workspace_id: String

Python Request

import requests

url = "https://www.prototypr.ai/api/v1/agents/memory"

headers = {
    "Authorization": "Bearer " + os.getenv("API_KEY"),
    "Content-Type": "application/json"
}

payload = {
    "user_id": "your_id",
    "workspace_id": "your_workspace_id",
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Sample Response

{ "data": {
    "ai_memory": "FORMATTED CONTEXT that includes: Test Center KPI data from Google Analytics, AI Surveys data, conversation summaries, UX image analysis, experiment history, strategic notes, and other saved context used to help the AI reason about your product and growth program.",
    "request_log": {
        "request_count": 1,
        "request_date": "2026-05-13 11:18:50",
        "request_id": "id_123_xyz",
        "service": "ai-memory"
    }
  }
}

AI Memory FAQ

What is AI Agent Memory?

AI Agent Memory is the context layer that helps your AI understand your product, business, experiments, user feedback, and prior decisions over time. Instead of starting from scratch in every conversation, your AI can use saved memory to provide more relevant analysis, recommendations, and follow-up questions.

What data is stored in AI Memory?

AI Memory can include structured context such as analytics summaries, UX image analysis, experiment history, survey feedback, conversation summaries, strategic notes, and saved growth snapshots. The goal is to store useful context that helps the AI reason about your product more effectively, not to save every interaction by default.

Can I edit or delete what is stored in memory?

Yes. AI Memory is designed to be transparent and user-controlled. You should be able to inspect the context that has been saved, correct anything that is outdated or inaccurate, and remove memory that you no longer want the AI to use.

Editing AI memory is done from within the prototypr.ai app. If you would like editing to be api driven, please feel free to reach to customer support in the app and let us know.

Can I use my AI Memory outside of prototypr.ai?

Yes. The AI Memory API is designed to make your saved context portable. You can retrieve memory through the API and use it in other AI workflows, agents, or applications. This allows your product and growth context to move with you, more like history in a browser, instead of being limited to a single chat experience.

Is my AI Memory used to train public AI models?

No. Your AI Memory is intended to help your own AI workflows reason with your own context. It is not designed to train public models. Memory exists to make your AI experience more useful, transparent, and personalized while keeping you in control of what context is saved and used.

Why is the AI Memory API a premium feature?

The AI Memory API is a premium feature because creating, maintaining, and serving high-quality memory requires significant reasoning, context processing, storage, and retrieval infrastructure. The API is designed for users and teams who want to bring their saved product, growth, and business context into other AI workflows while keeping that context transparent, portable, and user-controlled.

In order to access this premium API, you will need a Plus membership, which is currently $29/month.

Rate Limits and API Usage Stats

Currently there are rate limits of 25 requests/day across all API endpoints. This will grow over time as more endpoints are added.

If you need more, please file a customer support ticket and our team will partner with you to get you the access levels you need.