> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud API

> Call Memanto Cloud over HTTPS with an API key: agents, memories, recall, answers, files, conflicts and expiry policies.

# Memanto Cloud API

The Memanto Cloud API is the HTTPS API behind the `memanto` CLI, the MCP server and the [console](https://docs.memanto.ai/cloud/console/overview.md) when they use Memanto Cloud. Call it from any language to give your own app or agent memory, with nothing to host.

It covers the same operations as the [local REST API](https://docs.memanto.ai/api-reference/authentication.md), with two differences:

* **No sessions.** There is no activate or deactivate step and no session token. Every request carries your API key.
* **No `/api/v2` prefix.** Paths start at the agent: `/agents/{agent_id}/remember`.

## Base URL

```text theme={null}
https://api.memanto.ai
```

> [!NOTE]
>
> The `memanto` CLI reads the base URL from `MEMANTO_API_URL` when it is set.

## Authentication

Every request needs an API key in the `x-api-key` header:

```bash theme={null}
curl https://api.memanto.ai/agents \
  -H "x-api-key: $MEMANTO_API_KEY"
```

Create a key in the console under [API keys](https://docs.memanto.ai/cloud/console/api-keys.md). Keys start with `mk_`. A computer signed in with `memanto login` has its own key, saved as `MEMANTO_API_KEY` in `~/.memanto/.env`.

A key acts as its owner: it can use the agents you own and the agents other people [shared with you](https://docs.memanto.ai/cloud/console/people.md). Creating agents needs an account admin's key.

## Quick start

```bash theme={null}
# 1. Create an agent
curl -X POST https://api.memanto.ai/agents \
  -H "x-api-key: $MEMANTO_API_KEY" -H "Content-Type: application/json" \
  -d '{"agent_id": "my-agent", "pattern": "tool"}'

# 2. Remember something
curl -X POST https://api.memanto.ai/agents/my-agent/remember \
  -H "x-api-key: $MEMANTO_API_KEY" -H "Content-Type: application/json" \
  -d '{"content": "The user prefers dark mode", "type": "preference"}'

# 3. Recall it
curl -X POST https://api.memanto.ai/agents/my-agent/recall \
  -H "x-api-key: $MEMANTO_API_KEY" -H "Content-Type: application/json" \
  -d '{"query": "UI preferences", "limit": 5}'

# 4. Ask a question
curl -X POST https://api.memanto.ai/agents/my-agent/answer \
  -H "x-api-key: $MEMANTO_API_KEY" -H "Content-Type: application/json" \
  -d '{"question": "What theme does the user like?", "stream": false}'
```

## Attributing calls to a tool

Send `source` (a tool slug such as `cursor`, or your app's name) on writes and reads. The console's [Connections](https://docs.memanto.ai/cloud/console/connections.md) page and the **By tool** usage card group activity by it. See [Tool attribution](https://docs.memanto.ai/guides/tool-attribution.md).

## Errors

Errors return a JSON body with a message in `detail`, `message` or `error`, depending on the endpoint.

| Status | Meaning |
| - | - |
| `400` | Bad request, such as a missing field or an `agent_id` that doesn't match the path. |
| `401` | Missing, invalid or revoked API key. |
| `402` | The account has no active plan (`plan_required`). Add a plan in the console under **Billing**. |
| `403` | The agent isn't yours or shared with you, or the call needs an admin. |
| `404` | Agent, memory, file or job not found. |
| `409` | The agent already exists. |
| `422` | Validation failed, such as content over 10,000 characters or an invalid type or tag. |
| `429` | Rate limited, or a plan limit was reached. |
| `5xx` | Server error. `GET`, `PUT` and `DELETE` are safe to retry; retry other methods only if you know the write did not happen. |

## Limits

* Memory content: up to 10,000 characters; title up to 100; up to 20 tags of up to 64 characters.
* [Batch Remember](https://docs.memanto.ai/cloud/api/memories/batch-remember.md): up to 100 memories per call.
* Recall `limit`: `1`–`100`.
* API keys: 3 per account, plus one per signed-in computer (up to 10).
* Agents and monthly usage depend on your plan. [Get Account](https://docs.memanto.ai/cloud/api/account/get-account.md) returns your current usage and limits.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.