API reference

API overview

Base URL, response shape, pagination, jobs, idempotency and errors for the MoltMentions API.

Base URL and format

Every route is under https://api.thrivestack.ai/v1. Requests and responses are JSON. Send Content-Type: application/json on every call with a body.

The API is in early access. Routes, limits and prices can change while it is. The pricing page always shows the current prices.
Request
curl https://api.thrivestack.ai/v1/wallet/balance \
  -H 'Authorization: Bearer tsk_live_YOUR_KEY'

Response shape

Every success response has the same envelope. A single result and a list differ only by data being an object or an array.

Single result
{
  "data": { "id": "..." },
  "meta": {
    "request_id": "req_01HV...",
    "cost": { "amount": "0.000000", "currency": "USD", "state": "charged" }
  }
}
List
{
  "data": [ { "id": "..." } ],
  "page": { "limit": 25, "next_cursor": "...", "total_count": null },
  "meta": { "request_id": "req_01HV...", "cost": { "amount": "0.000000", "currency": "USD", "state": "charged" } }
}
  • meta.request_id is also sent as the X-Request-Id header. Quote it when you contact support.
  • meta.cost is what this call cost, as a decimal string in USD. A free call shows "0.000000". On a job that has just started, state is estimated.
  • New fields can appear in meta at any time. Ignore the ones you do not know.

Pagination

List routes take limit (default 25, maximum 100) and cursor. When page.next_cursor is not null, pass it back as cursor to get the next page. page.total_count can be null where counting is slow.

A cursor is opaque. Do not parse it. It works for 24 hours, only on the route and with the filters and limit it was issued for. Anything else returns 400 invalid_cursor.

Jobs: runs, audits and recommendations

Work that takes a while answers 202 Accepted with an id and a status URL. Poll the status URL until the status is a finished one. A refused or failed start is never charged.

StartPoll
POST /v1/runsGET /v1/runs/{id}
POST /v1/auditsGET /v1/audits/{id}
POST /v1/recommendations/content/generateGET /v1/recommendations/content/jobs

Idempotency

Routes that can charge you take an Idempotency-Key header. Send a new unique value for each action and reuse it only to retry that same action. A retry with the same key is answered from the stored response and charged once. Starting a run, an audit or a recommendation job requires the header.

Errors

Errors keep one shape on every route:

Error
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_cursor",
    "message": "The cursor does not match this request.",
    "param": "cursor",
    "request_id": "req_01HV..."
  }
}
StatusMeaning
400Malformed or invalid input. param names the field.
401No key, or a key that is unknown, expired or revoked.
402Not enough credit or another billing block. The message says what the call costs. Nothing was charged. See Billing and balance.
403The key may not use that brand.
409The brand is not in a state where the call can go ahead, such as run_in_progress, brand_kit_not_ready or prompts_not_ready. Nothing was charged.
429Too many requests. Wait Retry-After seconds.
503A dependency is down. Nothing was done or charged. Retry after Retry-After seconds.

All routes

Routes are grouped by what you are doing. Each group has its own page with parameters and examples.

GroupRoutes
BrandBuild and read the brand profile
PromptsGenerate, save, list and tag the prompts you track
Runs and answersMeasure the prompts on AI engines, read answers
Metrics and sourcesMention and citation rates, cited domains and URLs
RecommendationsContent fixes from a finished run
AuditsCheck one site for AI readiness
WalletBalance, quote, ledger, usage and top-up