GoodMemGoodMem
ReferenceAPIREST APIDecision Models

Request decisions from a model

POST /v1/decision-models/{id}/decide: Sends the supplied questions and content to the registered provider.

POST
/v1/decision-models/{id}/decide

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.

Authorization

ApiKeyAuth
headerx-api-key<token>

Path Parameters

id*string

UUID of the decision model

Header Parameters

GoodMem-Timeout-Ms?integer

Optional 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.

Formatint64
Range1 <= value <= 86400000

Request Body

application/json
  1. 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.

Response Body

Success

application/json
  1. response

Structured provider answers with reported usage.

model*string

Provider-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.

Example Request
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"    }  ]}'
Example Response
{  "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  }}