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

# Overview

> REST APIs for agents, sessions, messages, memories, prompts, and knowledge

## Actx0 REST API

Actx0 exposes a versioned HTTP API under `/api/v1`. Use it to run agents and sessions, store messages and memories, version prompts, and search knowledge documents.

Examples are in **Pctx0** (Python), **Nctx0** (Node.js), **Gtcx0** (Go), and **cURL / Acli**. Create, list, update, and delete workspaces with a user API key (`X-API-Key`). Everything else in this guide uses a workspace access key (`X-Access-Key`).

<Info>
  **Quick start:** [Create a workspace access key in the Actx0 Dashboard](https://app.actx0.com/settings), then call Create Memory with `X-Access-Key`.
</Info>

***

## SDKs and CLI

| Package                                 | Language             | Install                                            |
| --------------------------------------- | -------------------- | -------------------------------------------------- |
| [Pctx0](https://github.com/Actx0/Pctx0) | Python               | `uv add pctx0` / `pip install pctx0`               |
| [Nctx0](https://github.com/Actx0/Nctx0) | Node.js / TypeScript | `npm install @actx0/nctx0`                         |
| [Gtcx0](https://github.com/Actx0/Gctx0) | Go                   | `go get github.com/Actx0/Gctx0`                    |
| [Acli](https://github.com/Actx0/Acli)   | CLI                  | `go install github.com/Actx0/Acli/cmd/acli@latest` |

These clients authenticate with a workspace access key (`X-Access-Key`). Create workspaces and access keys in the [Actx0 Dashboard](https://app.actx0.com/settings).

```python theme={null}
from pctx0 import Pctx0Client

client = Pctx0Client(
    access_key="YOUR_ACCESS_KEY",
    workspace_id="YOUR_WORKSPACE_ID",
)
```

```ts theme={null}
import { Nctx0Client } from "@actx0/nctx0";

const client = new Nctx0Client({
  accessKey: "YOUR_ACCESS_KEY",
  workspaceId: "YOUR_WORKSPACE_ID",
});
```

```go theme={null}
client := gctx0.NewClient(
  gctx0.WithAccessKey("YOUR_ACCESS_KEY"),
  gctx0.WithWorkspaceId("YOUR_WORKSPACE_ID"),
)
defer client.Close()
```

```bash theme={null}
export ACTX0_ACCESS_KEY="YOUR_ACCESS_KEY"
export ACTX0_WORKSPACE_ID="YOUR_WORKSPACE_ID"
acli status
```

***

## Base URL

```text theme={null}
https://app.actx0.com/api/v1
```

***

## Authentication

Most API requests authenticate with a workspace access key:

```bash theme={null}
X-Access-Key: <workspace-access-key>
```

[Create access keys in the Actx0 Dashboard](https://app.actx0.com/settings) with the permissions your agents need. Agents, sessions, messages, memories, prompts, and knowledge accept the key when it includes the matching permission.

Create Workspace and other workspace CRUD endpoints require a user API key instead:

```bash theme={null}
X-API-Key: <user-api-key>
```

<Warning>
  **Keep your keys secure.** Never expose them in client-side code or public repositories. Use environment variables and server-side requests only.
</Warning>

***

## Resource hierarchy

```text theme={null}
/api/v1
  /me
  /workspaces/{workspaceId}
    /prompts
    /promptsByName/{promptName}
    /documents
    /agents/{agentId}
      /sessions/{sessionId}
        /messages
        /memories
```

Sessions can also be addressed by external `id` and/or label query params via `/sessions/by-labels`.

***

## Conventions

* **IDs** are UUIDs.
* **Timestamps** are RFC3339 UTC strings.
* **Pagination** uses `limit` (default `50`, max `100`) and `offset` (default `0`).
* **List responses** use a collection key plus `_meta`:

```json theme={null}
{
  "memories": [],
  "_meta": { "limit": 50, "offset": 0, "total": 0 }
}
```

* **`meta` fields** on messages/memories: send a JSON **string** in requests; responses return parsed JSON.
* **Errors** always look like:

```json theme={null}
{ "errorMessage": "Human-readable message" }
```

***

## Core memory loop

1. [Create a workspace access key in the Actx0 Dashboard](https://app.actx0.com/settings)
2. **[Create Agent](/api-reference/create-agent)** — create an agent in the workspace
3. **[Create Session](/api-reference/create-session)** — open a conversation session
4. **[Create Memory](/api-reference/create-memory)** — store facts and preferences
5. **[Search Memories](/api-reference/search-memories)** — retrieve relevant context

***

## API categories

<CardGroup cols={2}>
  <Card title="Me" icon="user" href="/api-reference/get-me">
    Inspect the authenticated access key or API key
  </Card>

  <Card title="Workspaces" icon="building-2" href="/api-reference/create-workspace">
    Create, list, update, and delete workspaces
  </Card>

  <Card title="Agents" icon="bot" href="/api-reference/create-agent">
    Create and manage agents in a workspace
  </Card>

  <Card title="Sessions" icon="messages-square" href="/api-reference/create-session">
    Agent conversation sessions and labels
  </Card>

  <Card title="Messages" icon="message-square" href="/api-reference/create-message">
    Session messages with semantic search
  </Card>

  <Card title="Memories" icon="cpu" href="/api-reference/create-memory">
    Session memory CRUD, search, and batch
  </Card>

  <Card title="Prompts" icon="file-text" href="/api-reference/create-prompt">
    Versioned prompts and production labels
  </Card>

  <Card title="Knowledge" icon="book" href="/api-reference/upload-document">
    Document upload and semantic search
  </Card>
</CardGroup>
