Forepop for AI agents
Connect Claude, ChatGPT or your own agents to Forepop, and they can check a survey’s cost, start studies and read the results for you. Everything works inside one workspace, studies spend its answers as in the studio, and every answer is simulated.
Connect an AI app
Forepop is a remote MCP server at https://forepop.com/api/mcp. Apps that sign in for you need only that address:
- Claude (web and desktop): open Settings, Connectors, add a custom connector, and paste the address. Press Connect, sign in to Forepop, pick the workspace and press Allow.
- ChatGPT: with developer mode on, add a connector with the address and OAuth as its sign-in, then sign in and allow it the same way.
- Claude Code: run the line below, then
/mcpto sign in.
claude mcp add --transport http forepop https://forepop.com/api/mcpEach connection shows under Settings, API keys with the app’s name. Revoke it there and the app is disconnected at once. Only admins and owners of a workspace can connect apps to it.
Apps that take a server address with headers instead (Cursor, Windsurf, your own code) use an API key: make one below and add it as shown under MCP server.
What it can do
estimate_cost: check a survey exactly as a study would be checked and say how many answers it would spend. Starts nothing.create_study: start a study. It spends answers (people × questions) from the workspace’s balance.get_study: status and progress. Agents check it until the study is complete.get_results: a complete study’s results, with error bars.list_studies: recent studies in the workspace.get_balance: answers left.
A study runs for all US adults 18+. To answer as a narrower group by age, gender, income or education, send a filter with groupAnswers on:
"audience": { "filter": { "age": ["18-34"], "gender": ["female"] }, "groupAnswers": true }Make a key
- Sign in and open Settings, API keys. Keys belong to your current workspace; admins and owners make them.
- Name the key after what will use it, and press Create key.
- Copy the key straight away. It starts with fp_live_ and is shown only once; we keep only a fingerprint of it.
Send it with every request as Authorization: Bearer fp_live_YOUR_KEY. A key acts as the person who made it. Revoke it in the same place and it stops working at once.
Endpoints
JSON in, JSON out, at https://forepop.com/api/v1. Examples use placeholder keys and ids.
Start a study
POST /api/v1/studies takes the same survey the studio builds. Each question needs a type and its text; ids, scales and settings get the studio’s defaults when left out. The study is queued, and results usually take up to two working days.
curl https://forepop.com/api/v1/studies \
-H "Authorization: Bearer fp_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"survey": {
"title": "Streaming price change",
"questions": [
{
"type": "single",
"text": "If your plan went from $12 to $15 a month, what would you do?",
"options": [{ "label": "Keep my plan" }, { "label": "Switch to a cheaper plan" }, { "label": "Cancel" }]
},
{ "type": "nps", "text": "How likely are you to recommend the service to a friend?" }
],
"audience": { "population": "us_adults", "description": "", "country": "United States", "ageMin": 18, "ageMax": 99 }
},
"personas": 1000
}'Answers 201:
{
"study": { "id": "3f6c…", "title": "Streaming price change", "status": "queued", "personas": 1000, … },
"daily_cap": { "limit": 5, "remaining": 4, "resets_at": "…T00:00:00.000Z" }
}Question types: single, multiple, image_choice, ranking, rating, nps, slider, price_ladder, price_sensitivity, best_worst, concept_test, matrix, open_text and content. Choice questions need 2 or more options (best_worst 3 or more), a matrix also needs rows, and pictures go in as data URLs. The checks are the studio’s own “Before you run” list; a study that fails one answers 422 with every problem found.
Check the cost first
POST /api/v1/studies/estimate takes the same body, runs the same checks and says what the study would spend, without starting it.
curl https://forepop.com/api/v1/studies/estimate \
-H "Authorization: Bearer fp_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "survey": { …the same survey… }, "personas": 1000 }'{ "valid": true, "answers_needed": 2000, "answers_left": 5000, "enough": true, … }Answers left
GET /api/v1/balance: the key’s workspace and its answers left. One answer is one simulated person answering one question.
curl https://forepop.com/api/v1/balance \
-H "Authorization: Bearer fp_live_YOUR_KEY"List studies
GET /api/v1/studies: the workspace’s recent studies, newest first, with each one’s id and status. limit is 1 to 50, 20 by default.
curl "https://forepop.com/api/v1/studies?limit=10" \
-H "Authorization: Bearer fp_live_YOUR_KEY"Check a study
GET /api/v1/studies/{id}: status (queued, running, complete, failed or cancelled) and progress. Check every few minutes at most.
curl https://forepop.com/api/v1/studies/STUDY_ID \
-H "Authorization: Bearer fp_live_YOUR_KEY"Read results
GET /api/v1/studies/{id}/results: the numbers behind the results page. For each question, how many simulated people picked each answer, percentages once at least 60 answered, error_points (our average error in points for answers made that way, an average from tests against published surveys, not a guarantee), written answers, and the simulated respondents. Until the study is complete it answers 409 with its status.
curl https://forepop.com/api/v1/studies/STUDY_ID/results \
-H "Authorization: Bearer fp_live_YOUR_KEY"Limits
- Each key can start 5 studies per day. Days run on UTC, and the count resets at midnight UTC.
- Each key can send up to 30 requests a minute.
- Over either limit, the answer is 429 with a Retry-After header in seconds.
- A workspace can have up to 10 active keys.
Errors
Errors come back as { error: { code, message } }, with a message written to be read:
{ "error": { "code": "daily_cap_reached", "message": "This key has started its 5 studies for today. …" } }| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No key, a malformed key, or a revoked one. |
| 402 | insufficient_credits | The workspace has fewer answers left than the study needs (people × questions); includes answers_needed. |
| 403 | forbidden | The key’s maker is no longer in its workspace. |
| 404 | not_found | No study with that id in the key’s workspace. |
| 409 | not_ready | Results asked for before the study is complete; includes status. |
| 422 | invalid_request | The study didn’t pass the checks; includes issues. |
| 429 | daily_cap_reached, rate_limited | Over a limit; see Retry-After. |
| 503 | unavailable | Try again in a moment, or starting studies from agents isn’t switched on yet. |
MCP server
Forepop is also a remote Model Context Protocol server, so an agent can use it as tools. Its address is https://forepop.com/api/mcp (Streamable HTTP), with the same key in an Authorization header. Most MCP clients take a remote server as JSON like this:
{
"mcpServers": {
"forepop": {
"url": "https://forepop.com/api/mcp",
"headers": {
"Authorization": "Bearer fp_live_YOUR_KEY"
}
}
}
}Field names differ a little between clients. Look for the option to add a remote server by URL with custom headers.
The tools are the ones listed under What it can do. Each tool calls the same code as the endpoints above, with the same checks and limits. Keep the key out of shared files and screenshots; anyone with it can start studies in your workspace.