The learning API.

Send Authorization: Bearer YOUR_ACCOUNT_KEY to the Conceiver API URL for your deployment. JSON bodies use Content-Type: application/json. Mutations need an Idempotency-Key, except training-text ingestion, whose canonical file content supplies its replay identity.

Check your access

Run this first. It reads the model list and does not teach or query:

curl -s -w "\nHTTP %{http_code}\n" "$TOOLVING_API_URL/v1/models" \
  -H "Authorization: Bearer $TOOLVING_API_KEY"

It should end with HTTP 200 and list two models, language and numbers. If it returns HTTP 401 with code UNAUTHORIZED, the key is missing, wrong or revoked: ask the user for a new key from their account page. Set TOOLVING_API_URL to https://toolving.com with no path after it, unless the account page gives another API URL.

Routes

Method Route Purpose
GET /v1/models List selectable hosted models and their selection contract.
GET /v1/storage Read account storage availability, bounded usage, and spin_down.
GET /v1/storage/spin-down Read whether a spin-down saves the model, and what it would keep now.
PUT /v1/storage/spin-down Turn saving at spin-down on or off: {"save": true} or {"save": false}.
POST /v1/instances Create a language (default) or numbers instance; optional sequence_id or artifact_id restores learning.
GET /v1/instances/{id} Read instance status.
POST /v1/instances/{id}/teach Supply question and answer strings.
POST /v1/instances/{id}/query Supply a question and optional withMemory.
POST /v1/instances/{id}/resolve Supply prediction_id and actual answer.
POST /v1/instances/{id}/sequences Save the teachings that still support what the instance learned, as text.
GET /v1/instances/{id}/training-sequence Assemble current canonical teaching text without storing it.
POST /v1/instances/{id}/training-sequences Ingest canonical teaching text from {\"text\": \"...\"}.
DELETE /v1/instances/{id} Release this instance and retire final live state (a spin-down). ?discard=true unloads it, keeping nothing.
GET /v1/sequences List saved sequences, optionally filtered by model.
GET /v1/sequences/{id} Read saved sequence metadata and text.
GET /v1/sequences/{id}/file Download the UTF-8 .txt file.
GET /v1/operations/{id} Inspect or recover your operation.
GET /v1/artifacts List stored artifacts, newest first, with pinned.
PUT /v1/artifacts/{artifact_id}/pin Pin an artifact so it is never evicted when storage is full.
DELETE /v1/artifacts/{artifact_id}/pin Unpin an artifact.

Set delimiters for a language instance

Conceiver works on words. Include an optional delimiters object in the JSON body of POST /v1/instances to choose how text is cut into words:

{"model":"language","delimiters":{"split":" ","keep":".(),"}}

split characters separate words and are dropped. keep characters separate words and are each a word of their own. Use ASCII characters, include at least one character in split, and list each character at most once across both fields. The default splits at the space and keeps each of . , ; : ! ? ( ) [ ] { } " /, so a value inside punctuation, such as alice in createAccount(alice), is a word of its own. See the teaching guide.

Select a model

GET /v1/models lists two models. language starts empty and learns what you teach it; it is the default when model is omitted:

{"model":"language"}

numbers is a ready-made calculator: it already answers 1234 plus 4321, -5 + 3, 2.5 * 4, 10 / 4, 17 % 5, 1,000 - 2,500, 300 compared to 299 and 12 and 10 (also or, xor). What it handles and what it declines are in the Python SDK reference.

{"model":"numbers"}

There is no separate JSON model: answers that are JSON are taught to a language instance and returned as one line of text, and the SDK decodes them into output. Agent-harness clients may still select json with their host and an opaque compatibility-scope digest. It is not listed in /v1/models; it is a language instance whose learning is shared by that client's sessions:

{
  "model": "json",
  "contract": "toolving-conceiver-json-v1",
  "client": {
    "kind": "agent-harness",
    "host": "pi",
    "compatibilityScope": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}

Each language instance has its own private memory and starts empty. Harness (json) instances share private learning only inside the same account and compatibility scope. Omitting model retains the default language selection for existing clients.

GET /v1/storage returns enabled, its backend, applicable byte accounting, and spin_down. Saving a training sequence requires enabled storage for managed customer accounts. Ingestion remains available without storage, but that live learning is not retained after final retirement.

Saving at spin-down

A spin-down is an instance retiring: a DELETE /v1/instances/{id}, or the service retiring an idle instance. On an account with storage, a taught instance's spin-down saves the model as a stored artifact. This is an account setting, on by default, the same as Save model at spin-down in the playground:

curl -s "$TOOLVING_API_URL/v1/storage/spin-down" -H "Authorization: Bearer $TOOLVING_API_KEY"
# {"save":true,"stores":"artifact","reason":null}
curl -s -X PUT "$TOOLVING_API_URL/v1/storage/spin-down" -H "Authorization: Bearer $TOOLVING_API_KEY" \
  -H "Content-Type: application/json" -d '{"save":false}'
# {"save":false,"stores":"nothing","reason":"SAVE_OFF"}

Both return what a spin-down would keep now: stores is artifact, recovery-sequence (no storage: a recovery copy of the training sequence is kept instead, reason NO_STORAGE), or nothing, with reason SAVE_OFF, NO_STORAGE_ROOM or NO_UNPINNED_SLOT. With saving off, a spin-down keeps nothing and its retirement result has "skipped": "SAVE_OFF".

Teach an answer

After creating an instance, use its returned ID:

curl "$TOOLVING_API_URL/v1/instances/$INSTANCE_ID/teach" \
  -H "Authorization: Bearer $TOOLVING_API_KEY" \
  -H "Idempotency-Key: invoice-answer" \
  -H "Content-Type: application/json" \
  -d '{"question":"Where do invoices go?","answer":"Finance / inbox"}'

Questions and answers are single-line strings. Outer whitespace is trimmed by the model. Queries record observations and predictions; use a new key for a new observation, even if the question is unchanged. Support for raw JSON syntax within Conceiver's taught language is in active development.

Training sequence text

Reading an instance's training sequence collects the teaching examples that still support what the instance has learned. It returns the assembled text without storing it, so Free accounts can copy and manage it locally. Saving the same content as an account file requires enabled storage. The text contains no addresses or event envelopes:

Where do invoices go?
Finance / inbox

Where do alerts go?
Operations / alerts

Every teaching is two nonempty adjacent lines. One empty line separates teachings, and the file ends with LF. Ingestion rejects other layouts and sends each accepted pair through the normal teaching path. Re-ingesting the same content in one model compatibility scope is idempotent.

Prediction confidence

A successful query operation returns a receipt with its native prediction in result:

{
  "status": "ANSWER",
  "text": "talked",
  "output": "talked",
  "confidence": "confident",
  "evidence": {
    "format": "text/markdown",
    "markdown": "The examples and counterexamples behind this decision."
  }
}

confidence is hypothesis, confident, highly confident or ambiguous (Conceiver 1.x instances said high). The level is the answer's evidence for (times it was given or confirmed) minus its evidence against (times it was corrected away): one is hypothesis, two confident, three or more highly confident, and level for and against is ambiguous. An input that fits a pattern in a way no example has shown stays hypothesis: a new word in a slot that has only ever held one word, a value of several words in a slot that has only held single words (until one such answer is confirmed with a resolve), or a word repeated across slots. Every answer from a numbers instance is hypothesis. The Python SDK reference has examples. These describe evidence, not probability percentages. A resolve with a different answer counts against the old answer and for the new one. An unresolved prediction has no answer and no confidence; it carries the available evidence instead of inventing an answer:

{
  "status": "UNRESOLVED",
  "evidence": {
    "format": "text/markdown",
    "markdown": "Relevant evidence for downstream decision-making."
  }
}

Episodic memory

Set withMemory to true on a query to return complete relevant episodes with the decision evidence:

{
  "question": "Where do invoices go?",
  "withMemory": true
}

The response evidence then includes episodes, an array of complete input and output examples. A successful memory-enabled query costs 2 credits. A standard prediction or retrieval costs 1 credit.

Without account storage, memory is ephemeral and final instance retirement discards it. With storage, final retirement saves learned capabilities in a verified artifact. The retirement result includes the artifact format, SHA-256 digest and byte count. A new language or numbers instance loads it only when created with "artifact_id": "<sha256>": the artifact is stacked read-only under the instance's fresh, empty plastic memory, and new learning goes only to that plastic memory. Any stored artifact can be loaded, by any number of instances at once. When such an instance retires, its new artifact holds the loaded artifact together with what it learned, so it can later be loaded on its own; the loaded artifact is unchanged.

When a storage plan's storage is full and has not been expanded, the oldest unpinned artifact is overwritten to make room after each session. The retirement result then carries storage: full, the purchase_url to expand storage, a warning, and evicted_artifact_ids. GET /v1/storage shows the same offer and warning as storage_full while storage is full. Pinned artifacts are never overwritten. If there is still no room, the spin-down stores nothing and overwrites nothing, and the retirement result says why in skipped and storage.reason: NO_STORAGE_ROOM (the quota is full and every artifact that could be overwritten is pinned) or NO_UNPINNED_SLOT (unlimited storage keeps 10 artifacts, and all of them are pinned). That instance's live learning is not kept; read its training sequence first if you need it. Unpin an artifact or expand storage to save again. An instance that was never taught (no teach or resolve; queries do not count) keeps nothing on retirement, on every plan: the result has "skipped": "NOTHING_TAUGHT", no sequence and no artifact. Pin artifacts you want to keep; a pinned artifact is never evicted.

Check status to determine whether an answer was returned. No-support results omit confidence. Older stored receipts and instances using older application bundles can also lack it; a new instance uses the updated bundle with whatever learning it restores. Recovery through /v1/operations/{id} and retries return the original confidence after later learning.

Recovery and errors

Reusing a key with different content returns 409. Invalid input returns 422. Any operation on an instance that is no longer active (retired or retiring), on every model, returns 409 with error code INSTANCE_INACTIVE; create a new instance. Repeating any request with the same key returns its original result, with two exceptions. An operation refused for space (see below) is tried again when it is repeated. The other is for creates: a repeated create returns the same instance while it is live, but once that instance has retired the same key creates a new instance, and the result says so with "replaced": true, replaced_instance_id (the retired instance) and replaced_operation_id (its original create). Use a new key per create to avoid relying on this. An accepted operation interrupted by a lost runtime response may return 503 with an operation ID. Inspect that operation or repeat the same request with its original key; the accepted event remains durable. An operation the runtime cannot carry out, such as a teaching the model cannot take in, returns 422 with error code RUNTIME_OPERATION_REJECTED, the runtime's reason in the message, and an operation ID. That operation has failed for good and nothing is charged for it. Repeating it with the same key returns the same error. The instance and the account stay usable. An operation that would take a model past its maximum size returns 409 with error code MODEL_SIZE_LIMIT_REACHED. This limit applies to one model and is separate from account storage, so upgrading storage does not change it; continue with a new model. An operation the account's storage has no room for returns 402 with error code STORAGE_UPGRADE_REQUIRED and a purchase_url. In both cases the operation is not applied and nothing is charged, and repeating the request with the same key tries it again.

Only your account can access its instances, sequences and predictions. Saved sequences keep their model version. A model-version mismatch remains an error rather than silently changing the saved work.

The customer deployment exposes its interactive native schema at API reference. An earlier website deployment may still expose the older learner service there; check that its schema contains /v1/instances.

Customer account

The browser account page uses Clerk session bearer tokens for /v1/account, key management at /v1/account/keys, and operation counts at /v1/account/usage. Machine API keys authorize the learning routes above; they do not authorize browser account management. Operation counts come from durable native operation identities, so retrying the same accepted request does not add another operation. These counts do not define prices or charges.