Endpoint
POST /v1/memory/upload
Content-Type: multipart/form-data
| Field | Required | Description |
|---|
file | ✅ | Binary file (max 10 MB) |
type | ✅ | Memory type (usually file) |
key | ✅ | Unique key |
blobFilename | | Custom blob name |
blobExtension | | Override file extension |
expiresIn | | TTL (default 30d) |
mimeType | | MIME type hint |
metadata | | JSON string: {"tags":[],"visibility":"..."} |
encryptionProvider | | Set for encrypted uploads |
encryptionMeta | | JSON: {"iv":"...","tag":"..."} |
Example
curl -X POST "$API/memory/upload" \
-H "Authorization: Bearer $API_KEY" \
-F "[email protected];type=video/mp4" \
-F "type=file" \
-F "key=media/demo-video" \
-F "blobFilename=demo_recording" \
-F "expiresIn=30d" \
-F 'metadata={"tags":["video","demo"],"visibility":"share"}'
Response (201)
{
"id": "...",
"type": "file",
"key": "media/demo-video",
"version": 1,
"blobName": "memory/file/media/demo-video/demo_recording_v1.mp4",
"sizeBytes": 5185628,
"mimeType": "video/mp4",
"filename": "video.mp4",
"pinned": false,
"importance": 0.5,
"isCompressed": false,
"createdAt": "..."
}
Credit Cost
This operation costs 5 credits (memory.write).