SmartMemory
POST
/memory/recall/pack

Assemble the most useful context that fits in budget_tokens.

Returns {block, manifest}. 400 on an out-of-range budget, an unknown section name or preset, or both preset and sections. A typo'd section must surface rather than silently shrink the pack, and an ambiguous request must not be silently resolved.

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The token is either a Clerk session JWT or a SmartMemory API key (prefix sm_live_, sm_test_, or legacy sk_).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request for a token-budgeted context pack (CORE-RECALL-BUDGET-1).

budget_tokens is StrictInt, not int, deliberately: Pydantic's lax mode coerces JSON true and "1" to the integer 1, so a plain int annotation turns two clearly-invalid bodies into a successful 200 with a 1-token budget. By the time the route's own range check runs the value is a genuine int and the guard cannot tell it apart from a caller who really asked for 1. Strict mode rejects both at the parse boundary, where the caller still learns what was wrong.

Response Body

application/json

application/json

curl -X POST "https://example.com/memory/recall/pack" \  -H "Content-Type: application/json" \  -d '{}'
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}