PlaxorStack API

Call your trained models from your own code. One API key, one HTTP request, a prediction back. Everything below works against the live API — there is no separate sandbox and no SDK to install.

Base URL https://api.plaxorstack.com

Getting started

Three steps. If you have a trained model already, this takes about two minutes.

1

Create an API key

Sign in and open Secrets, or click Share on any trained model and create one there.

The key is shown once, when you create it. We store only a hash of it, so it cannot be shown again — copy it before you close the dialog. Lost a key? Revoke it and create another.

2

Send it on every request

The key goes in a header called X-Api-Key, never in the query string:

Header
X-Api-Key: YOUR_API_TOKEN

If your tool can only send a bearer token, send the same key as Authorization: Bearer instead. It works on every endpoint, and when a request carries both, X-Api-Key is used.

Header — alternative
Authorization: Bearer YOUR_API_TOKEN

That is the whole of authentication. The key identifies you, your subscription and which models you may call, so nothing else in the request decides who you are.

3

Make your first call

Replace YOUR_API_TOKEN with your key and 123 with your model id, then paste this into a terminal:

curl -X POST "https://api.plaxorstack.com/predict" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trainingTypeId": 123, "inputs": {"YourColumn": "value", "AnotherColumn": "42"}}'
const response = await fetch("https://api.plaxorstack.com/predict", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_API_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    trainingTypeId: 123,
    inputs: { YourColumn: "value", AnotherColumn: "42" }
  })
});

const result = await response.json();
console.log(result.predictedLabel, result.probability);
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_TOKEN");

var response = await client.PostAsJsonAsync("https://api.plaxorstack.com/predict", new
{
    trainingTypeId = 123,
    inputs = new Dictionary<string, string>
    {
        ["YourColumn"] = "value",
        ["AnotherColumn"] = "42"
    }
});

Console.WriteLine(await response.Content.ReadAsStringAsync());

A 200 with "success": true means you are done — everything after this page is detail.

Authentication

Every endpoint on this page takes the same header. A request without it, or with a revoked or mistyped key, gets 401 with success: false and a message — the API does not say which of those it was.

Header
X-Api-Key: YOUR_API_TOKEN

Authorization: Bearer with the same key is accepted everywhere as well, for clients that cannot set a custom header. It is the same key either way: the same models, the same limits, the same refusals. When both are sent, X-Api-Key wins, and any other scheme, such as Basic, is ignored.

Header — alternative
Authorization: Bearer YOUR_API_TOKEN

What a key can do

A key belongs to one subscription and acts as the user who created it. It can call the models that subscription owns, and its usage counts against that subscription's plan. Keys come in two kinds:

  • API keys — for your own server-side code, and for an AI assistant connected over MCP. They reach every model in the subscription.
  • Widget keys — for the chat widget on your public site. A widget key is bound to one model and to the web origins you list, and it cannot be used for anything else. See Adding the chat widget.

An API key only reads. Two switches on the key, off by default and set by the subscription's owner or an admin under Secrets, let it do more: Allow proposals (see actions an assistant may propose) and Allow adding documents, which lets it add, replace and delete passages of your search models through /search/{id}/documents.

Never put an API key in a web page, a mobile app or any public repository. Anything a browser downloads, a visitor can read. Call the API from your own server, and use a widget key — which is origin-locked and model-locked — for anything that runs in a browser. If a key leaks, revoke it on the Secrets screen; revocation takes effect on the next request.

Finding your model id

Every request names the model to use, as trainingTypeId. Open the model and click Share — the ready-made samples there already have your id filled in, so you can copy one and change only the key.

A model you have retired keeps its id but stops answering: those calls get 410 Gone rather than a 404, because the model did exist and its owner withdrew it on purpose. See Errors.

POST /predict

A prediction from a tabular model — the kind trained on a spreadsheet or a CSV. You send the column values, you get the answer.

Request

FieldTypeNotes
trainingTypeId number Required. Which model to use.
inputs object Required. Values keyed by your own column names — the ones in the file you trained on, spelled the same way. Values are sent as strings; numbers are parsed for you.
curl -X POST "https://api.plaxorstack.com/predict" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trainingTypeId": 123, "inputs": {"YourColumn": "value", "AnotherColumn": "42"}}'
const response = await fetch("https://api.plaxorstack.com/predict", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_API_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    trainingTypeId: 123,
    inputs: { YourColumn: "value", AnotherColumn: "42" }
  })
});

const result = await response.json();
console.log(result.predictedLabel, result.probability);
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_TOKEN");

var response = await client.PostAsJsonAsync("https://api.plaxorstack.com/predict", new
{
    trainingTypeId = 123,
    inputs = new Dictionary<string, string>
    {
        ["YourColumn"] = "value",
        ["AnotherColumn"] = "42"
    }
});

Console.WriteLine(await response.Content.ReadAsStringAsync());

Response

200 OK
{
  "success": true,
  "predictedLabel": "Likely to renew",
  "probability": 0.87,
  "score": null,
  "scores": [0.13, 0.87],
  "message": null,
  "trainingModelId": 4412,
  "trainingId": 903,
  "trainingTypeId": 123
}

Which fields are filled depends on what the model predicts: a category model answers with predictedLabel and probability, a numeric one with score. See Responses.

A model's post actions that run immediately run on every successful /predict, /predict/text, /predict/document and /predict/image call whose prediction meets their condition, and each run counts against your monthly action runs. Actions that ask first never run from the API — nobody is there to say yes — and the batch and forecast routes run none.

POST /predict/text

Classify a piece of text with a text model — sorting a message, a review or a support ticket into one of the categories you trained on.

Which languages it reads depends on the encoder chosen at training: MiniLM reads English, and Multilingual reads more than 50 languages. A search index built on the multilingual encoder also finds passages written in another language than the question.

Request

FieldTypeNotes
trainingTypeIdnumberRequired.
text string Required. The text to classify, as one string.
curl
curl -X POST "https://api.plaxorstack.com/predict/text" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trainingTypeId": 123, "text": "The delivery arrived two days late and the box was damaged."}'

Response

The same shape as /predict: predictedLabel with the winning category and probability with its confidence.

POST /predict/document

Classify a whole file with a text model — an invoice, a contract, a letter. The API reads the text out of the file the same way training read the documents the model learned from, so you do not extract it yourself. Like /predict/image, it takes multipart/form-data.

Request

Form fieldTypeNotes
trainingTypeIdtextRequired.
document file Required. A .pdf, .docx, .txt, .text, .md or .log file, at most 8 MB. We recommend this name; with no field called document, the first file in the form is used.
curl
curl -X POST "https://api.plaxorstack.com/predict/document" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -F "trainingTypeId=123" \
  -F "document=@/path/to/invoice.pdf"

Limits

  • Reading stops after 50 pages or 100,000 characters, far more than the model looks at, and gives up after 10 seconds.
  • 30 requests a minute per key, separate from the other prediction routes: reading a document costs more than any other input, and sending documents does not use up your text and image allowance.
  • One file is one prediction against your plan, however long it is.

Response

The same shape as /predict/text. A refused file answers with success: false and a message naming the reason, and its status says what to change. None of these is counted against your plan: the model was never asked.

StatusMeaningWhat to do
400 The request is malformed — not multipart/form-data, no trainingTypeId, no file or an empty one — or the model is not a text classifier. Fix the request.
413 The file is over 8 MB. Send its text to /predict/text.
415 Not a type listed above. The content is checked, not only the extension: a renamed file is refused here. Send a PDF, a Word .docx or a plain-text file.
422 The right type, but it cannot be read: damaged, password-protected, an older .doc renamed, a scan with no text, or more than 10 seconds to read. Fix the file. For a scan, recognise its text yourself and send it to /predict/text.

POST /predict/forecast

Forecast the next periods of a series with a time-series model — sales, demand, visitors. The forecast starts after the last date the model was trained on, and every point carries an 80% band measured on its own backtest.

Request

FieldTypeNotes
trainingTypeIdnumberRequired.
horizon number How many periods ahead. Omitted or 0 is the horizon the model was trained for; at most twice that.
series string Required when the model was trained on several series, such as one per store.
covariates number[][] Required when the model was trained with columns known ahead, such as a planned price: one array per period, one value per column in the order they were mapped.
curl
curl -X POST "https://api.plaxorstack.com/predict/forecast" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trainingTypeId": 123, "horizon": 3, "series": "store-a"}'

Response

200 OK
{
  "success": true,
  "forecast": {
    "series": "store-a",
    "frequency": "Daily",
    "history": [
      { "date": "2026-10-19T00:00:00Z", "value": 412, "lower": null, "upper": null }
    ],
    "backtest": [
      { "date": "2026-10-19T00:00:00Z", "value": 398, "lower": null, "upper": null }
    ],
    "points": [
      { "date": "2026-10-20T00:00:00Z", "value": 405, "lower": 371, "upper": 439 },
      { "date": "2026-10-21T00:00:00Z", "value": 418, "lower": 380, "upper": 456 },
      { "date": "2026-10-22T00:00:00Z", "value": 431, "lower": 389, "upper": 473 }
    ]
  },
  "message": null,
  "trainingModelId": 4412,
  "trainingId": 903,
  "trainingTypeId": 123
}

The forecast is in forecast.points, with lower and upper bounding each value. history holds the recent actual values and backtest what the model predicted for periods that have already happened, so you can draw both on one chart. One call is one prediction against your plan, whatever the horizon.

POST /predict/image

Classify a picture. This endpoint takes multipart/form-data rather than JSON, so the file travels as bytes instead of growing by a third as base64.

A multi-label image model also returns predictedLabels: every label that applies, possibly none. predictedLabel is then the strongest one, and scores holds each label's own probability rather than shares that sum to one.

Request

Form fieldTypeNotes
trainingTypeIdtextRequired.
imagefileRequired. The picture to classify. We recommend this name; with no field called image, the first file in the form is used.
curl -X POST "https://api.plaxorstack.com/predict/image" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -F "trainingTypeId=123" \
  -F "image=@/path/to/photo.jpg"
const form = new FormData();
form.append("trainingTypeId", "123");
form.append("image", fileInput.files[0]);

const response = await fetch("https://api.plaxorstack.com/predict/image", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_API_TOKEN" },
  body: form
});

console.log(await response.json());
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_TOKEN");

using var form = new MultipartFormDataContent
{
    { new StringContent("123"), "trainingTypeId" },
    { new ByteArrayContent(File.ReadAllBytes("photo.jpg")), "image", "photo.jpg" }
};

var response = await client.PostAsync("https://api.plaxorstack.com/predict/image", form);

Console.WriteLine(await response.Content.ReadAsStringAsync());

POST /predict/image/batch

Classify up to 16 pictures for one model in a single request. The same form as /predict/image, with the field images repeated once per file. Faster than one request per picture, and it counts as one call against the rate limit.

Request

Form fieldTypeNotes
trainingTypeIdtextRequired.
images file, repeated Required. At most 16 files and 8 MB together.

Response

An array of response objects, one per file and in the order you sent them. Each succeeds or fails on its own: a file that is not a picture fails alone, and when your plan has fewer predictions left than you sent, the first ones are answered and the rest carry the quota message. Only the answered ones are counted.

When the model has an action on a Results file card, the response also carries one X-Result-File header per such action: a link to a PDF or a ZIP (CSV and JSON) of the whole batch. The link answers 202 with Retry-After for the few seconds the file takes to write, then the file itself. Anyone holding the link can download it, so pass it on as you would the results; it expires after 7 days. Each file is one action run.

curl -X POST "https://api.plaxorstack.com/predict/image/batch" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -F "trainingTypeId=123" \
  -F "images=@/path/to/first.jpg" \
  -F "images=@/path/to/second.jpg"

POST /chat

Ask the model a question in plain language instead of building the inputs object yourself. This is the endpoint behind the chat widget, and it needs an AI Brain connected to the model — except on a text model, which answers without one (below).

The AI Brain runs the conversation, not the prediction. It is told the model's description and the names of its input fields, so it knows what to ask for. Your training data is never sent to it, and the answer still comes from the model you trained. A search model is the exception: the passages it finds are sent, because they are what the Brain answers from — see below.

Request

FieldTypeNotes
trainingTypeIdnumberRequired.
messagestringRequired. What the person asked.
history array Optional. Earlier turns, each { "role": "user" | "assistant", "content": "…" }. Send it back on every turn to keep the thread; the API stores no conversation of its own.
curl -X POST "https://api.plaxorstack.com/chat" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trainingTypeId": 123, "message": "How many sales last month?"}'
const response = await fetch("https://api.plaxorstack.com/chat", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_API_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    trainingTypeId: 123,
    message: "How many sales last month?"
  })
});

console.log((await response.json()).reply);
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_TOKEN");

var response = await client.PostAsJsonAsync("https://api.plaxorstack.com/chat", new
{
    trainingTypeId = 123,
    message = "How many sales last month?"
});

Console.WriteLine(await response.Content.ReadAsStringAsync());
import requests

response = requests.post(
    "https://api.plaxorstack.com/chat",
    headers={"X-Api-Key": "YOUR_API_TOKEN"},
    json={"trainingTypeId": 123, "message": "How many sales last month?"},
)

print(response.json()["reply"])

Response

200 OK
{
  "success": true,
  "reply": "About 2 days for standard delivery to San Francisco",
  "usedModel": true,
  "interpretedInputs": {
    "Destination": "San Francisco",
    "ShippingMethod": "Standard"
  },
  "missingInputs": null,
  "prediction": {
    "success": true,
    "score": 2.1,
    "predictedLabel": null,
    "probability": null
  }
}
FieldNotes
replyWhat to show the person.
usedModel true when the answer came from a prediction. When it is false the Brain was still gathering details and no prediction was spent.
missingInputs Fields it still needs before it can predict. Useful if you are building your own chat UI and want to ask for them directly.
interpretedInputsWhat it understood from the conversation.
predictionThe full prediction object, when there was one.
sources Search models only: the documents the reply cites, each { number, id, score, title, url, excerpt }. number matches a [n] in reply; url is an http(s) link from the document's data, or null; excerpt is the start of the passage on a plain reply, else null.
isPlain true when no AI Brain took part: the reply was built from prediction, and the turn counted as one prediction rather than a chat message.

The same call answers from your documents. The model finds the passages closest to the question, the AI Brain answers from those alone, and every statement it takes from one is marked [1], [2] and so on. A number that does not match a passage the search returned is removed before the reply reaches you. A follow-up such as "and for shoes?" is first rewritten into a full question from history, so send the history back.

200 OK
{
  "success": true,
  "reply": "Refunds are paid within 14 days of the return arriving [1].",
  "usedModel": true,
  "sources": [
    {
      "number": 1,
      "id": "refund-policy",
      "score": 0.82,
      "title": "Refund policy",
      "url": "https://help.example.com/refunds"
    }
  ]
}

Anything in the index can be read by whoever can call /chat on it — through the answers and the sources they cite. A widget key is public by design, so do not put a widget on an index of internal documents.

On a text model without an AI Brain

A text classifier or a search model answers /chat with no AI Brain at all: the message is the model's input, and the prediction is the answer. It does so whenever no Brain is connected, and always for a widget key created with plain replies. isPlain is true, prediction carries the label, and the turn counts as one prediction — no chat message is spent.

  • A classifier replies with the widget's reply text, where {{prediction.label}}, {{prediction.probability}} and {{inputs.Text}} are filled in, or with "This looks like billing." when none was set.
  • A search model replies with its three best passages in sources, each with its score and an excerpt.

The model's post actions run on a plain turn as on any other chat turn; one that asks first comes back in proposalOffers for a yes or no. On a search model, a condition reads the best passage: its id as the label and its similarity as the score, which is 0 when nothing was found.

On a public widget (one that does not require sign-in), only the actions its owner allowed for that widget, on the API keys page, are offered. They always ask first, the visitor passes a bot check before a yes runs, and runs are capped per widget and per visitor. A call made with the widget's key outside the widget is offered no action.

On a tabular model without an AI Brain

A tabular classifier, regression or anomaly model with no AI Brain chats through a form: one question per input, one prediction, and a reply built from it. Ask which questions first — it costs nothing:

POST /chat/form
// request
{ "trainingTypeId": 42 }

// 200 OK
{
  "isForm": true,
  "fields": [
    { "name": "Age", "prompt": "How old is the applicant?" },
    { "name": "Income", "prompt": "What is their yearly income?" }
  ]
}

When isForm is true, ask each field's prompt (the question you wrote on the model's page, or the column name) and send the answers to /chat as inputs, keyed by name. message is then ignored. The turn counts as one prediction, isPlain is true, and the reply is the widget's reply text with {{prediction.label}}, {{prediction.score}} and {{inputs.<column>}} filled in. The model's post actions run on it as on any chat turn.

POST /chat/image

The same conversation, for an image model: the person sends a picture and asks about it. Takes multipart/form-data, with the message and the file as form fields.

GET /llm/providers

Which AI providers your subscription can use for chat. Worth calling only if you are building your own interface and want to show the choice.

curl
curl "https://api.plaxorstack.com/llm/providers" \
  -H "X-Api-Key: YOUR_API_TOKEN"

POST /search/{id}/documents

Adds passages to a semantic search model, replaces passages, and deletes them, without training it again. A passage is searchable as soon as the call returns. The model keeps its id, its MCP tools and its widget. The model must have been trained once from an upload.

It needs an API key with Allow adding documents switched on, created by the subscription's owner or an admin. Any other key is refused with 403, and so is the key once its creator is no longer an owner or admin.

Request

  • documents: the passages to add or replace. Each one needs an id, unique in the model, and a text. A passage sent with an id the model already has replaces it. The other columns are the ones your training upload used, such as project, file, doc, title, section, version, is_latest, date and related_files. A column the model has never had is refused, except these.
  • deleteIds: ids of passages to delete.
  • deleteFiles: file names. Every passage whose file is one of them is deleted.

Deletes happen before documents are added. So to send a new copy of a file, put its name in deleteFiles and all of its passages in documents, in one call. Passages the new copy no longer has are then gone too. Sending only the passages that changed would keep the old copy's others. A passage sent back with the same id and text is replaced, not deleted, and counts no prediction.

Versions. When the model's passages use version and is_latest, the passages with the highest version of a doc (same project and doc, or file when there is no doc) say is_latest yes, and older versions are set to no. Sending v2 sets v1 to no. A doc is left as you sent it when one of its versions is not a number such as 2 or 1.3, or when none of its passages has an is_latest. The same rule applies when the model is trained again.

curl
curl -X POST "https://api.plaxorstack.com/search/123/documents" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "deleteFiles": ["notes/HANDOFF-v2.md"],
    "documents": [
      {"id": "notes/HANDOFF-v2.md#1", "text": "Uploads now go straight from the browser to storage.",
       "file": "notes/HANDOFF-v2.md", "doc": "handoff", "title": "Uploads", "version": "2", "is_latest": "yes", "date": "2026-11-21"},
      {"id": "notes/HANDOFF-v2.md#2", "text": "A refused upload is deleted, and the user chooses the file again.",
       "file": "notes/HANDOFF-v2.md", "doc": "handoff", "title": "Refusals", "version": "2", "is_latest": "yes", "date": "2026-11-21"}
    ]
  }'

Response

200 OK
{
  "success": true,
  "message": "0 added, 2 replaced, 0 deleted; 1 encoded. Searchable now.",
  "added": 0,
  "replaced": 2,
  "deleted": 0,
  "notFound": 0,
  "encoded": 1,
  "markedNotLatest": 3,
  "documents": 1240,
  "searchable": "now",
  "trainingTypeId": 123,
  "trainingId": 903,
  "trainingModelId": 4415
}

encoded is the number of passages whose text was read, and those are the ones metered. notFound counts ids and files to delete that the model did not have; it is not an error. trainingModelId changes on every call, because the index is saved again; the model's id does not.

Metering and limits

  • Each passage whose text is new or changed counts as one prediction. Deletes, and passages sent again with the same text (only their other columns changed), count as none.
  • When fewer predictions are left in your month than the call would read, the whole call is refused with 429 and nothing changes. Deletes still work when none are left.
  • One call takes at most 100 documents, 200,000 characters of text in all, 8,000 per passage, and 1,000 ids and files to delete together.
  • A model is edited this way up to 25,000 passages. A larger one is refused with 409: train it again from an upload.
  • Your plan's search documents and storage still apply. A call that would go over either is refused with 403.
  • Calls count against the same per-minute limit as /predict. While the model is being trained, a call is refused with 409; send it again when training has finished.
  • Passages added this way are kept when the model is trained again from its uploads, and deleted ones stay deleted.

Keeping a model up to date from Claude Code

A SessionEnd hook can send the notes a session wrote, so the next session can search them. This script sends each Markdown file matching a pattern that changed since its last run. Each ## section is one passage, and each file is sent as a new copy, as described above, so a section that did not change counts no prediction. Put the key in the SEARCH_API_KEY environment variable, never in the file, and the files to send in SEARCH_NOTES (a glob, **/*HANDOFF*.md by default). The script remembers what it sent in .claude/.push_notes.json; add that to .gitignore.

.claude/push_notes.py
# Sends the Markdown notes that changed since the last run to a search model.
# Run by Claude Code's SessionEnd hook. Python 3.9+, nothing to install.
import glob, hashlib, json, os, re, sys, urllib.error, urllib.request

API = "https://api.plaxorstack.com/search/123/documents"  # your model id
KEY = os.environ.get("SEARCH_API_KEY")
PATTERN = os.environ.get("SEARCH_NOTES", "**/*HANDOFF*.md")
STATE = os.path.join(os.path.dirname(os.path.abspath(__file__)), ".push_notes.json")
PASSAGE_CHARS = 6000
CALL_ROWS = 100
CALL_CHARS = 190000


def passages(name, text):
    rows = []
    for section in re.split(r"(?m)^(?=## )", text):
        section = section.strip()
        if not section:
            continue
        title = section.splitlines()[0].lstrip("# ").strip()
        for start in range(0, len(section), PASSAGE_CHARS):
            rows.append({"id": f"{name}#{len(rows) + 1}", "text": section[start:start + PASSAGE_CHARS],
                         "file": name, "title": title})
    return rows


def batches(rows):
    batch, chars = [], 0
    for row in rows:
        if batch and (len(batch) == CALL_ROWS or chars + len(row["text"]) > CALL_CHARS):
            yield batch
            batch, chars = [], 0
        batch.append(row)
        chars += len(row["text"])
    yield batch


def send(body):
    request = urllib.request.Request(API, data=json.dumps(body).encode(), method="POST",
                                     headers={"X-Api-Key": KEY, "Content-Type": "application/json"})
    with urllib.request.urlopen(request, timeout=120) as response:
        return json.load(response)


def main():
    if not KEY:
        sys.exit("Set SEARCH_API_KEY to an API key with 'Allow adding documents'.")
    try:
        with open(STATE, encoding="utf-8") as f:
            sent = json.load(f)
    except (OSError, ValueError):
        sent = {}
    for path in glob.glob(PATTERN, recursive=True):
        name = os.path.relpath(path).replace(os.sep, "/")
        with open(path, encoding="utf-8") as f:
            text = f.read()
        digest = hashlib.sha256(text.encode()).hexdigest()
        if sent.get(name) == digest:
            continue
        try:
            for number, batch in enumerate(batches(passages(name, text))):
                body = {"documents": batch}
                if number == 0:
                    body["deleteFiles"] = [name]  # a new copy: what it no longer has goes too
                print(f"{name}: {send(body)['message']}")
        except urllib.error.HTTPError as error:
            print(f"{name}: {error.code} {error.read().decode(errors='replace')}", file=sys.stderr)
            continue  # not recorded, so the next run sends it again
        sent[name] = digest
        with open(STATE, "w", encoding="utf-8") as f:
            json.dump(sent, f, indent=1)


main()
.claude/settings.json
{
  "hooks": {
    "SessionEnd": [
      {
        "hooks": [
          { "type": "command", "command": "python \"$CLAUDE_PROJECT_DIR/.claude/push_notes.py\"" }
        ]
      }
    ]
  }
}

POST /mcp

Your models as tools for an AI assistant. /mcp is an MCP server over Streamable HTTP: Claude Code, Claude Desktop or any other MCP client lists your models and calls one when a question needs it, so you write no request yourself.

Which models are listed

ModelToolTakes
Tabular predict_<name>_<id> Your own column names, as on /predict.
Text classification, multi-label text predict_<name>_<id> text
Image classification, multi-label image predict_<name>_<id> image: {"type": "url", "url": "https://…"}, a public link to the image file, or {"type": "asset_id", "asset_id": "img_…"} from upload_image
Time-series forecast predict_<name>_<id> Optionally horizon, series and covariates, as on /predict/forecast.
Semantic search search_<name>_<id> query, and optionally top, minScore and filter
Semantic search ask_<name>_<id> question, and optionally maxWords and filter
Semantic search, for a key with Allow adding documents add_to_<name>_<id> documents, deleteIds and deleteFiles, as on /search/{id}/documents

<name> is the training's name and <id> its model id. The tool's description is the one you wrote on the AI Board, so write it for the assistant: what the model decides and when to use it. The list is read on every request, so a model you train later appears the next time the assistant asks. Up to 100 models are listed.

A search model is listed twice. search_ returns the closest passages for the assistant to read; ask_ returns a short answer with its sources, so the assistant does not have to read them. How the answer is made depends on the model's AI Board:

  • An LLM is connected and the board is on: the LLM writes the answer from the closest passages and cites them as [1], [2]. Each call counts as one prediction and one chat message, or more on an LLM that costs more per reply (its AI Board card shows how many), and none on your own LLM key.
  • No LLM is connected: the answer is quoted from your documents — the words that answer the question and the sentence they come from. Nothing is written, so the assistant phrases the reply itself. Each call counts as one prediction. English questions and documents only.
  • The board is switched off: there is no ask_ tool; search_ is still listed.

Either way the answer says notFound when the documents do not answer the question.

An image is fetched by our server from the link the assistant gives: https only, a public address, up to the same size as an upload. A link to a page that shows the image is refused; it must be the file itself.

For an image with no public link — a file the user attached in the chat — the assistant calls upload_image with the file's type and exact size in bytes. It answers with an asset_id and an upload_url; the assistant sends the file as the body of an HTTP PUT to that address within 15 minutes, then passes the asset_id to the image tool. The upload itself costs nothing; each prediction that reads it counts as one. An uploaded image is kept for 24 hours and can be used several times; delete_image removes it sooner, and a subscription holds at most 20 at once. The assistant needs a way to make an HTTP request for this; one that can only call tools must use a link instead. upload_image is listed only when the key can predict and the subscription has an image model.

Left out: retired and untrained models; models served by ML.NET itself because their trainer has no ONNX export; and a tabular model with no input columns mapped.

Actions an assistant may propose

An assistant can also ask for one of your actions to run. It never runs it: the request waits on the Approvals page until the subscription's owner approves or declines it. Both switches are off by default:

  • On the key: Allow proposals under Secrets, which only the owner or an admin can switch. A key without it sees no propose_ tools.
  • On the action: Outside AIs may propose it through MCP. An action whose body uses {{inputs.…}} or {{prediction.…}} cannot be opened, because an assistant has nothing honest to fill them with. Neither can an action that sends from a visitor's own account.

Each such action is a tool propose_<name>_<id> taking:

  • reason: why it should run, shown to the approver;
  • arguments: exactly the {{arguments.…}} names the action's body uses, as text. Every one is required and nothing else is accepted.

The destination is fixed on the action, so no argument can change where it goes. The approver sees the body exactly as it will be sent.

Metering. Proposing costs nothing. An approval is one action run of your month. A request is refused once a key has made 50 proposals in the hour, or once 200 are waiting. Repeating the same proposal does not add a second one. A proposal nobody answers expires after 3 days.

Keys, metering and limits

  • It takes an API key, in X-Api-Key or as Authorization: Bearer, or a member's sign-in. A widget key is refused.
  • Each tool call is one prediction against your plan, except add_to_, which counts one for each passage it reads, as on /search/{id}/documents. Every request to /mcp counts against the same per-minute limit as /predict.
  • Give the assistant its own key. Its client stores the key in a config file, and a key of its own can be revoked without breaking anything else.

claude.ai, ChatGPT and other connectors: sign in

An assistant that adds a server by its address alone signs you in instead of taking a key. Add https://api.plaxorstack.com/mcp as a custom connector — in claude.ai or Claude Desktop under Settings › Connectors, in ChatGPT as a connector in developer mode — and leave the client id and secret empty. The assistant registers itself, then opens a PlaxorStack page where you choose:

  • One subscription. The connection sees that subscription's models and no other.
  • Call your models (predict) and, if you are the subscription's owner or an admin, propose actions (actions:propose). You may grant less than the assistant asked for, never more.

What the connection holds works on /mcp only: every other route refuses it, and like any key it can never approve a proposal. Calls are metered as with a key. The assistant renews its access by itself; it lasts while it is used, and stops after 30 days unused, if you leave the subscription, or when you disconnect it under MCP › Connected AI apps. A proposal right stops on the assistant's next call once you are no longer the owner or an admin.

Claude Code

Terminal
claude mcp add --transport http plaxorstack "https://api.plaxorstack.com/mcp" \
  --header "X-Api-Key: YOUR_API_TOKEN"

Claude Desktop with a key

To use an API key rather than sign in, connect through mcp-remote, which needs Node.js. Add this to claude_desktop_config.json:

claude_desktop_config.json
{
  "mcpServers": {
    "plaxorstack": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.plaxorstack.com/mcp", "--header", "Authorization:${AUTH}"],
      "env": { "AUTH": "Bearer YOUR_API_TOKEN" }
    }
  }
}

MCP Inspector

To see the tools and try a call:

Terminal
npx @modelcontextprotocol/inspector

Choose Streamable HTTP, enter https://api.plaxorstack.com/mcp and add the key as a header. Connect through the Inspector's proxy, its default: the API sends no CORS headers, so a direct connection from the browser is refused.

Responses

Every prediction endpoint answers with the same object. Fields that do not apply to your kind of model are null rather than absent.

FieldTypeNotes
success boolean Check this first. A 200 can still carry false.
predictedLabelstringThe winning category, for a classifier.
probabilitynumberConfidence in that category, 0 to 1.
scorenumberThe predicted value, for a numeric model.
scoresnumber[]The score for every category, in the model's own order.
messagestringWhy it failed, when it did. Safe to show a developer, not an end user.
trainingModelId, trainingId, trainingTypeId number Which model version answered. Worth logging: it is how you tell later which version produced a given answer.

Errors

The status code tells you whether retrying can ever work. That distinction is deliberate — treat 403 and 429 differently or you will build a client that retries forever.

StatusMeaningWhat to do
400 The request is malformed — no model id, or inputs the model does not recognise. Fix the request. Retrying it unchanged will fail again.
401 Missing, mistyped or revoked key. Check the X-Api-Key header, or the value after Bearer.
403 The key is valid but not allowed this call — another subscription's model, or a widget key used off its model or its origin. Do not retry. Waiting does not change it.
410 The training was retired by its owner. It existed; it no longer answers. Ask the owner, or point at a current model. Not a client bug.
429 Too many requests in a minute, or the plan's monthly allowance is spent. Retry with a backoff. This one succeeds again later.
503 Inference is temporarily unavailable. Retry with a backoff.

Rate limits and quotas

There are two separate ceilings, and they fail the same way but mean different things.

  • Rate limit — how many calls you may make in one minute, counted in a fixed window, with separate allowances for prediction and chat. It protects the service from a burst, and it resets within the minute.
  • Plan allowance — how many predictions and chat messages your subscription includes per month. This resets when the month does. Your current usage is on the Statistics screen.

Both answer 429, and the message field says which one you hit. A prediction is counted only when it succeeds — a refused or failed call costs you nothing.

Adding the chat widget

The widget puts your model on your own website as a chat panel, so visitors can ask it questions without you writing any code. It is one script tag.

1

Create a widget key

Open the model, click Share, and create a widget key — not an API key. A widget key is safe to put in a public page: it works for that one model only, and only on the websites you list.

On a text model the key also sets how the widget replies: a classifier with its predicted label, in words you can write; a search model either through the AI Brain or with the passages it found (plain replies).

2

List the websites that may use it

Add every origin the widget will run on. An origin is the scheme, host and port with no path and no trailing slash:

Allowed origins
https://example.com
https://www.example.com

This is the mistake that costs people an afternoon. https://example.com and https://www.example.com are different origins — list both if you serve both. An origin that is not listed gets 403 and the panel stays empty.

3

Paste the script into your page

Anywhere in the HTML — it is defer, so it will not slow the page down. A floating chat button appears in the corner:

HTML
<script src="https://plaxorstack.com/js/widget.js"
        data-key="YOUR_WIDGET_KEY"
        data-title="Ask about our products"
        defer></script>

To place the panel inside your own layout instead of floating it, give it an element to fill:

HTML — inline
<div id="chat-panel" style="height: 560px"></div>

<script src="https://plaxorstack.com/js/widget.js"
        data-key="YOUR_WIDGET_KEY"
        data-title="Ask about our products"
        data-mode="inline"
        data-target="#chat-panel"
        defer></script>

Widget options

Everything except data-key has a sensible default.

AttributeNotes
data-keyRequired. Your widget key.
data-titleThe heading on the panel. Shown to your visitors, so name it for them.
data-modeinline to place the panel in your page. Floating by default.
data-targetA CSS selector for the element to fill. Needed with data-mode="inline".
data-imagetrue for an image model, so the panel offers a file picker.
data-positionWhich corner the floating button sits in.
data-opentrue to open the panel on load instead of waiting for a click.

The widget key never reaches your visitors' conversations with your data. Each visit exchanges the key for a short-lived session bound to that one model, which is why a copied key is useless on a site you have not listed.

Stuck?

Email [email protected] with the endpoint you called, the status code you got back and the message field. That is almost always enough to answer in one reply.