Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Assemble prompt-ready agent context

Merge relevant memories and/or a session summary and message tail into structured blocks and ready-to-paste text.

POST/api/v2/context
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Request body
requiredapplication/json
querystring
min length 1 · max length 8192
maxTokensinteger
min 100 · max 128000 · default: 4000
sessionIdstring
min length 1 · max length 100
runIdstring

Optional run to correlate session context assembly.

min length 1 · max length 100
parentSpanIdstring

Optional parent span within runId.

min length 1 · max length 100
collectionsstring[]
min items 1 · max items 10
filterobject
topKinteger
min 1 · max 50 · default: 10
includeobject
Show properties
memoriesboolean
default: true
sessionboolean
default: true
Any of:
any
any
any
any
Responses
200

Prompt-ready context returned.

successbooleanrequired
Allowed:true
dataAssembledContextrequired
Show properties
blocksContextBlock[]required
Show properties
Array of ContextBlock
typestringrequired
Allowed:memorysession
contentstringrequired
sourcestringrequired
tokensintegerrequired
min 0
textstringrequired
tokensUsedintegerrequired
min 0
maxTokensintegerrequired
min 100 · max 128000
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
429

Too Many Requests - Rate limit exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
503

A required provider or platform dependency is not configured or available.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/context' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "query": "string",
  "maxTokens": 4000,
  "sessionId": "string",
  "runId": "string",
  "parentSpanId": "string",
  "collections": [
    "string"
  ],
  "filter": {},
  "topK": 10,
  "include": {
    "memories": true,
    "session": true
  }
}'
Response
{
  "success": true,
  "data": {
    "blocks": [
      {
        "type": "memory",
        "content": "string",
        "source": "string",
        "tokens": 0
      }
    ],
    "text": "string",
    "tokensUsed": 0,
    "maxTokens": 100
  }
}