Only the contract for the explicit chat-to-research flow.
Agent-ready well-known endpoints
https://185.237.14.76.nip.io/.well-known/api-catalogRFC 9727 API catalog for the REST API and MCP endpointhttps://185.237.14.76.nip.io/.well-known/openapi.jsonMachine-readable OpenAPI description for the public REST APIhttps://185.237.14.76.nip.io/.well-known/oauth-authorization-serverRFC 8414 authorization server metadata mirroring the Clerk issuer used for workspace OAuthhttps://185.237.14.76.nip.io/.well-known/openid-configurationOpenID Provider configuration mirroring the Clerk issuer used for workspace OAuthhttps://185.237.14.76.nip.io/.well-known/oauth-protected-resource/api/chatRFC 9728 protected resource metadata for the Clerk-backed workspace chat APIhttps://185.237.14.76.nip.io/.well-known/mcp/server-card.jsonMCP server card pointing clients at the streamable HTTP MCP transporthttps://185.237.14.76.nip.io/.well-known/agent-skills/index.jsonAgent skills discovery index with Samplence-specific REST and MCP skillsClerk-protected chat routes
GET https://185.237.14.76.nip.io/api/chat/threadsList saved threads for the active workspacePOST https://185.237.14.76.nip.io/api/chat/threadsCreate a workspace thread and queue the first assistant turnGET https://185.237.14.76.nip.io/api/chat/threads/:threadIdRead one workspace threadPOST https://185.237.14.76.nip.io/api/chat/threads/:threadId/messagesAppend a message to an existing workspace threadPOST https://185.237.14.76.nip.io/api/chat/threads/:threadId/research-runsStart or reuse a workspace research runUnauthenticated /api/chat/* responses advertise protected-resource discovery with a WWW-Authenticate header that points clients to path-derived metadata under https://185.237.14.76.nip.io/.well-known/oauth-protected-resource/.... The root workspace chat surface is published at https://185.237.14.76.nip.io/.well-known/oauth-protected-resource/api/chat. The site also mirrors the Clerk issuer metadata at https://185.237.14.76.nip.io/.well-known/oauth-authorization-server and https://185.237.14.76.nip.io/.well-known/openid-configuration for clients that start from generic authorization-server or OIDC discovery. This workspace OAuth path is intended for delegated or manually provisioned integrations, not self-serve public agent onboarding.
Startup research API
GET /healthHealth checkGET /v1/pingAuth checkGET /v1/billingCurrent prepaid credit balance and write pricingPOST /v1/billing/top-upsCreate a Stripe-hosted top-up checkout sessionGET /v1/api-keysList API keys for the current workspacePOST /v1/api-keysCreate a new API keyPOST /v1/api-keys/:apiKeyId/rotateRotate an existing API key and return the new secret oncePOST /v1/api-keys/:apiKeyId/revokeRevoke an API keyGET /v1/chat/threadsList saved case summaries for the current workspaceGET /v1/chat/threads/:threadIdRead one case, including messages, reports, and research runsPOST /v1/chat/threadsCreate a new case and return the first assistant reply. Never auto-starts research.POST /v1/chat/threads/:threadId/messagesContinue an existing case. Never auto-starts research.POST /v1/chat/threads/:threadId/research-runsExplicitly queue a research run for the current anamnesis snapshotPOST /mcpRemote streamable HTTP MCP endpointAPI key scopes
threads_readRead safe case summaries and safe case detail over REST and MCPthreads_writeCreate new cases and append user messages. Chat writes still never auto-start research.research_writeExplicitly queue research runs for an existing casebilling_readRead current credit balance, pricing, and top-up optionsbilling_writeCreate Stripe-hosted top-up sessionsapi_keys_adminCreate, rotate, revoke, and list API keysGET /v1/billing
Pricing is prepaid: $1 buys 10 credits. Chat turns cost 1 credit per successful turn by default, and research runs cost 30 credits upfront. Failed research runs are refunded automatically.
{
"chatTurnBillingMode": "fixed",
"chatTurnMaxReserveCredits": 1,
"creditBalance": 240,
"currency": "usd",
"pricePer100CreditsUsd": 10,
"researchRunBillingMode": "fixed",
"researchRunPriceCredits": 30,
"topUpEndpoint": "https://api.185.237.14.76.nip.io/v1/billing/top-ups",
"topUpOptions": [
{
"creditQuantity": 50,
"usdQuantity": 5
},
{
"creditQuantity": 100,
"usdQuantity": 10
},
{
"creditQuantity": 150,
"usdQuantity": 15
}
],
"topUpScope": "billing_write"
}curl https://api.185.237.14.76.nip.io/v1/billing/top-ups \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"usdQuantity": 5,
"successUrl": "https://client.example.com/billing/success",
"cancelUrl": "https://client.example.com/billing/cancel"
}'/v1/api-keys
Use an api_keys_admin key to mint, rotate, and revoke machine credentials without using the console UI. New keys must declare an explicit scopes array and should be limited to the minimum access the agent needs.
curl https://api.185.237.14.76.nip.io/v1/api-keys \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Automation key",
"scopes": ["threads_read", "threads_write", "research_write", "billing_read"]
}'GET /v1/ping
{
"grantedScopes": [
"threads_read",
"threads_write",
"research_write",
"billing_read"
],
"ok": true,
"supportedRouteGroups": ["mcp", "billing", "threads"]
}POST /v1/chat/threads
Returns 202 Accepted with a pending assistant placeholder, the updated safe case snapshot, and the latest anamnesis and gap assessment. This route never auto-starts research, even if the case is already ready.
curl https://api.185.237.14.76.nip.io/v1/chat/threads \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Idea: AI copilot for insurance brokers in Southeast Asia. It drafts proposals, compares policy options, and speeds up manual broker workflows."
}'{
"assistantMessage": {
"content": "Thinking...",
"createdAt": "2026-04-19T10:00:01.000Z",
"id": "msg_...",
"role": "assistant",
"status": "pending"
},
"anamnesis": {
"ideaSummary": "AI copilot for insurance brokers"
},
"gapAssessment": {
"readinessStatus": "ready"
},
"reportStaleness": {
"isStale": false
},
"thread": {
"id": "thread_...",
"latestCompletedReportId": null,
"messageCount": 2,
"reports": []
},
"userMessage": {
"content": "Idea: AI copilot for insurance brokers",
"createdAt": "2026-04-19T10:00:00.000Z",
"id": "msg_...",
"role": "user",
"status": "complete"
}
}If the workspace has no credits left, the same route returns 402 Payment Required.
{
"error": "Insufficient credits",
"creditBalance": 0,
"requiredCredits": 1
}POST /v1/chat/threads/:threadId/messages
Also returns 202 Accepted with the pending assistant placeholder and the refreshed safe case snapshot. Use the refreshed case state to decide whether to start research explicitly.
curl https://api.185.237.14.76.nip.io/v1/chat/threads/<thread_id>/messages \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Now compare it against manual broker workflow and legacy SaaS competitors."
}'GET /v1/chat/threads/:threadId
Read the canonical safe case state, including anamnesis, gap assessment, safe message content, report summaries, and research run status.
curl https://api.185.237.14.76.nip.io/v1/chat/threads/<thread_id> \
-H "Authorization: Bearer $API_KEY"Public case reads intentionally exclude raw report JSON, full report bodies, provider/model metadata, token accounting, request IDs, and other internal execution data. Report entries expose only safe summary fields such as id, runId, timestamps, and summaryText.
POST /v1/chat/threads/:threadId/research-runs
Starts research for the current anamnesis snapshot. New work returns 202 Accepted; exact matching completed reports can return 200 OK with the reused result immediately instead of queueing a new paid run. In the console UI, this is the same explicit action exposed as the Start research button under the ready-state assistant reply.
curl https://api.185.237.14.76.nip.io/v1/chat/threads/<thread_id>/research-runs \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"force": false
}'{
"anamnesisSnapshot": {
"ideaSummary": "AI copilot for insurance brokers"
},
"gapAssessment": {
"readinessStatus": "ready"
},
"reportStaleness": {
"isStale": false
},
"runId": "run_...",
"thread": {
"id": "thread_..."
}
}/mcp
Remote MCP over streamable HTTP with the same bearer API keys. The current server exposes two tools and three read resources. Public deployments should expose this endpoint over HTTPS.
send_messageCreate a case when threadId is omitted, otherwise append to an existing case and return the updated snapshot. Never auto-starts research.start_researchExplicitly start research for an existing case and either queue a new run or return an exact matching completed report immediatelyhttps://api.185.237.14.76.nip.io/billingResource with the current balance, pricing, and top-up optionshttps://api.185.237.14.76.nip.io/chat/threadsResource listing safe case summaries for the current workspacehttps://api.185.237.14.76.nip.io/chat/threads/{threadId}Resource template for one safe case snapshot with messages, report summaries, anamnesis, and research runs{
"mcpServers": {
"startup-research": {
"type": "streamable-http",
"url": "https://api.185.237.14.76.nip.io/mcp",
"headers": {
"Authorization": "Bearer $API_KEY"
}
}
}
}[mcp_servers.startup-research]
url = "https://api.185.237.14.76.nip.io/mcp"
http_headers = { Authorization = "Bearer sk_live_or_test_api_key" }MCP does not return synthetic pending handles. send_message returns the updated safe case state immediately and leaves research idle. start_research returns the accepted run metadata plus the refreshed safe case snapshot.
{
"assistantMessage": {
"content": "Thinking...",
"id": "msg_...",
"role": "assistant",
"status": "pending"
},
"gapAssessment": {
"readinessStatus": "ready"
},
"thread": {
"id": "thread_..."
},
"userMessage": {
"id": "msg_...",
"role": "user",
"status": "complete"
}
}{
"anamnesisSnapshot": {
"ideaSummary": "AI copilot for insurance brokers"
},
"gapAssessment": {
"readinessStatus": "ready"
},
"runId": "run_...",
"thread": {
"id": "thread_..."
}
}{
"code": "insufficient_credits",
"message": "Insufficient credits. Read https://api.185.237.14.76.nip.io/billing for the current balance before retrying."
}