Request decisions from a model
POST /v1/decision-models/{id}/decide: Sends the supplied questions and content to the registered provider.
Sends the supplied questions and content to the registered provider. Requires READ_DECISION_MODEL and EXECUTE_DECISION_MODEL. Each request calls the provider once and may incur charges, so do not retry automatically. GoodMem does not store the input or answers. Unsupported questions or media return 400. Problems with the stored provider credentials or settings return 412.
ApiKeyAuthx-api-key<token>id*stringUUID of the decision model
GoodMem-Timeout-Ms?integerOptional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.
int641 <= value <= 86400000application/json- body
Sends named questions and content to a registered decision model. The provider may charge for this request.
state*||||Content evaluated by all questions.
attachments?array<>|Media files included with the request. Their order is preserved within each media type.
questions*Questions keyed by names that you choose. The model must support each question type and its media.
Success
application/json- response
Structured provider answers with reported usage.
model*stringProvider-reported model identifier.
answers*Answers keyed by the original question identifiers.
usage*Token counts reported by the provider. An omitted count is unknown; a count of 0 means the provider reported zero.
curl -X POST 'https://your-goodmem-server.example.com/v1/decision-models/550e8400-e29b-41d4-a716-446655440000/decide' \ -H 'GoodMem-Timeout-Ms: 30000' \ -H 'Content-Type: application/json' \ -d '{ "state": { "text": "hello" }, "attachments": [ { "mimeType": "image/png" } ]}'{ "model": "string", "answers": { "property1": { "choice": { "choice": "string", "probabilities": { "property1": 0.1, "property2": 0.1 }, "confidence": 0, "confidenceMeaning": "ADJUSTED_TOP_PROBABILITY" } }, "property2": { "choice": { "choice": "string", "probabilities": { "property1": 0.1, "property2": 0.1 }, "confidence": 0, "confidenceMeaning": "ADJUSTED_TOP_PROBABILITY" } } }, "usage": { "inputTokens": 0, "outputTokens": 0 }}