Memory 1 credit COMPUTE

Store Memory API

Give your AI agents persistent memory across sessions via REST API. Store any JSON value under a named key — it survives context resets, container restarts, and new conversations. The fundamental building block for stateful agent applications.

Try it live →

How it works

POST a key, value, and optional namespace and tags. The value is stored in a persistent SQLite database, namespaced by your API key. Subsequent calls to memory-get with the same key return the stored value, even in a completely new agent session.

Use cases

API Reference

POST https://slopshop.gg/v1/memory-set
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
key string required The memory key name
value any optional The value to store (for set operations)
namespace string optional Optional namespace for isolation

Example response

{
  "data": {
    "key": "my-key",
    "value": "stored value",
    "updated_at": "2025-01-15T10:30:00Z"
  },
  "meta": {
    "credits_used": 1,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use Store Memory in production.

Example 1
Store user preference
Save a user's language preference across agent sessions.
curl -X POST https://slopshop.gg/v1/memory-set \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "user_language", "value": "es", "namespace": "user:42"}'
Example 2
Checkpoint workflow progress
Save the current step of a multi-stage agent workflow.
curl -X POST https://slopshop.gg/v1/memory-set \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "workflow_step", "value": {"step": 3, "completed": ["fetch", "analyze"], "next": "generate"}, "namespace": "job:8821"}'
Example 3
Cache expensive computation
Store a computed result with a 1-hour TTL to avoid recomputing.
curl -X POST https://slopshop.gg/v1/memory-set \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "report_2024_q3", "value": {"summary": "Revenue up 15%..."}, "ttl": 3600}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/memory-set \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/memory-set",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/memory-set", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call memory-set
slop memory-set '{"input": "your data here"}'

Pricing

Credits per call
1
credits
Cost per call
$0.001
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.

Related APIs in Memory

View the full API catalog · Try in playground · Documentation