---
title: "Inject memories into a conversation"
method: POST
path: "/v1/inject"
tags: ["Context injection"]
---

# Inject memories into a conversation

`POST /v1/inject`

## Request

- Base URL: `https://api.chainmemory.ai`
- URL: `https://api.chainmemory.ai/v1/inject`
- Auth: API key in header `x-api-key`

Returns the selected memories plus `inject_text`, a ready-to-paste block that tells the model to cite each memory by its #N. Fee: 0.1 AIC (half burned, half to treasury). Quarantined and archived memories are skipped silently. With `optimistic: true` the response comes back immediately and the payment settles in the background: poll /v1/inject/status/{id} with `payment.inject_log_id`. Sealed memories come back as ciphertext (`content_blob`, `scheme` 2) and as a placeholder inside `inject_text`; the client decrypts them.

## Request body

- object
  - `memory_ids` integer[], required: memory_numbers, 1-50
  - `optimistic` boolean: Respond before the payment confirms
  - `project_filter` string: Recorded in the history only
  - `target_platform` string: Recorded in the history only

## Response `200`

Injected

## Other responses

- `400`: memory_ids missing or more than 50
- `402`: insufficient_aic
- `404`: none of the ids is a valid memory of this key
- `500`: payment_failed (non-optimistic mode only)

---

[API](https://skmtc.dev/chainmemory/apis/chainmemory-api.md) · [All operations](https://skmtc.dev/chainmemory/apis/chainmemory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chainmemory/apis/chainmemory-api/revisions/5331e0f0b6af?raw)
