` tag, falling back to the first `` |
| `description` | string | Meta description from `` or `` |
| `headings` | string\[] | Deduplicated list of `h1`, `h2`, and `h3` headings (max 20) |
| `paragraphs` | string\[] | Deduplicated key content paragraphs extracted from `
`, ``, and common content selectors (max 10) |
| `wordCount` | number | Approximate word count of the full page body text |
| `fetchedAt` | string | ISO 8601 timestamp of when the URL was fetched |
### Errors
| Code | Description |
| ---- | --------------------------------------------- |
| 400 | `url` field is missing from the request body |
| 500 | The target URL could not be fetched or parsed |
### Error response
```json theme={"dark"}
{
"error": "url required"
}
```
## Extract links, images, and metadata
```http theme={"dark"}
POST /api/extract
```
Fetches the given URL and extracts all links, images, and Open Graph / Twitter Card metadata.
### Request body
| Field | Type | Required | Description |
| ----- | ------ | -------- | ---------------------------- |
| `url` | string | yes | The URL to extract data from |
```bash theme={"dark"}
curl -X POST https:///api/extract \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
```
### Response
```json theme={"dark"}
{
"url": "https://example.com",
"links": [
{
"href": "https://www.iana.org/domains/example",
"text": "More information..."
}
],
"images": [
{
"src": "https://example.com/logo.png",
"alt": "Example logo"
}
],
"meta": {
"og:title": "Example Domain",
"og:description": "This domain is for use in illustrative examples.",
"description": "This domain is for use in illustrative examples."
},
"fetchedAt": "2026-03-22T19:00:00.000Z"
}
```
### Response fields
| Field | Type | Description |
| -------------- | --------- | ---------------------------------------------------------------------------- |
| `url` | string | The URL that was extracted from |
| `links` | object\[] | Deduplicated list of links found on the page (max 50) |
| `links[].href` | string | Resolved absolute URL of the link |
| `links[].text` | string | Link text, truncated to 100 characters |
| `images` | object\[] | Deduplicated list of images found on the page (max 20) |
| `images[].src` | string | Resolved absolute image URL |
| `images[].alt` | string | Image alt text, truncated to 100 characters |
| `meta` | object | Open Graph (`og:*`), Twitter Card (`twitter:*`), and `description` meta tags |
| `fetchedAt` | string | ISO 8601 timestamp of when the URL was fetched |
### Errors
| Code | Description |
| ---- | --------------------------------------------- |
| 400 | `url` field is missing from the request body |
| 500 | The target URL could not be fetched or parsed |
### Error response
```json theme={"dark"}
{
"error": "url required"
}
```
## Fetch behavior
All URL fetching uses the following defaults:
| Setting | Value |
| ---------------- | ------------------------------------ |
| User-Agent | `Agentbot-WebSummarizer/1.0` |
| Timeout | 10 seconds |
| Redirects | Followed automatically |
| Accepted content | `text/html`, `application/xhtml+xml` |
If the target URL returns a non-2xx HTTP status, the service responds with a `500` error containing the upstream status code in the error message.
# Workflows API
Source: https://docs.agentbot.raveculture.xyz/api-reference/workflows
Create, manage, and execute multi-step agent workflows
# Workflows API
Create, manage, and execute multi-step agent workflows.
All workflow endpoints require session authentication. Workflows are scoped to the authenticated user — you can only access workflows that belong to your account.
## List workflows
```http theme={"dark"}
GET /api/workflows
```
Returns all workflows owned by the authenticated user, ordered by most recently updated. Each workflow includes its associated nodes.
### Response
```json theme={"dark"}
{
"workflows": [
{
"id": "wf_abc123",
"name": "Email Automation",
"description": null,
"enabled": true,
"createdAt": "2026-03-29T10:00:00Z",
"updatedAt": "2026-03-29T11:00:00Z",
"nodes": [
{
"id": "node_1",
"type": "trigger",
"config": "{\"label\":\"Trigger 1\"}",
"position": "{\"x\":40,\"y\":40}"
}
]
}
]
}
```
| Field | Type | Description |
| ------------------------------ | -------------- | -------------------------------------------------------------------- |
| `workflows` | array | List of workflow objects owned by the authenticated user |
| `workflows[].id` | string | Workflow identifier |
| `workflows[].name` | string | Workflow name |
| `workflows[].description` | string \| null | Optional workflow description |
| `workflows[].enabled` | boolean | Whether the workflow is active |
| `workflows[].createdAt` | string | ISO 8601 creation timestamp |
| `workflows[].updatedAt` | string | ISO 8601 last update timestamp |
| `workflows[].nodes` | array | List of workflow nodes |
| `workflows[].nodes[].id` | string | Node identifier |
| `workflows[].nodes[].type` | string | Node type (`trigger`, `action`, `condition`, or `output`) |
| `workflows[].nodes[].config` | string | JSON-encoded node configuration including the node label |
| `workflows[].nodes[].position` | string | JSON-encoded `{x, y}` coordinates for the node in the visual builder |
### Errors
| Code | Description |
| ---- | ----------------------------------------------------------------------- |
| 401 | Unauthorized — returns `{ "workflows": [] }` instead of an error object |
| 500 | Failed to load workflows |
When the session is missing or invalid, this endpoint returns an empty `workflows` array with a `401` status instead of a standard error object.
## Create workflow
```http theme={"dark"}
POST /api/workflows
```
Creates a new workflow with optional initial nodes. The workflow is enabled by default.
### Request body
| Field | Type | Required | Description |
| ------------------ | ------ | -------- | --------------------------------------------------------------------------------------------------------------- |
| `name` | string | Yes | Workflow name |
| `description` | string | No | Workflow description |
| `nodes` | array | No | Initial nodes to create with the workflow |
| `nodes[].type` | string | Yes | Node type. One of: `trigger`, `action`, `condition`, `output` |
| `nodes[].config` | object | No | Node configuration (for example, `{ "label": "My Node" }`). Stored as a JSON string. Defaults to `{}`. |
| `nodes[].position` | object | No | Node position (for example, `{ "x": 40, "y": 40 }`). Stored as a JSON string. Defaults to `{ "x": 0, "y": 0 }`. |
### Response (201 Created)
```json theme={"dark"}
{
"workflow": {
"id": "wf_abc123",
"name": "Email Automation",
"description": null,
"enabled": true,
"createdAt": "2026-03-29T10:00:00Z",
"updatedAt": "2026-03-29T10:00:00Z",
"nodes": []
}
}
```
### Errors
| Code | Description |
| ---- | ------------------------- |
| 400 | Name required |
| 401 | Unauthorized |
| 500 | Failed to create workflow |
## Get workflow
```http theme={"dark"}
GET /api/workflows/:workflowId
```
Returns a single workflow with its nodes ordered by creation time. Requires ownership.
### Path parameters
| Parameter | Type | Description |
| ------------ | ------ | ------------------- |
| `workflowId` | string | Workflow identifier |
### Response
```json theme={"dark"}
{
"workflow": {
"id": "wf_abc123",
"name": "Email Automation",
"description": "Processes inbound emails",
"enabled": true,
"createdAt": "2026-03-29T10:00:00Z",
"updatedAt": "2026-03-29T11:00:00Z",
"nodes": [
{
"id": "node_1",
"type": "trigger",
"config": "{\"label\":\"Email Received\"}",
"position": "{\"x\":40,\"y\":40}",
"createdAt": "2026-03-29T10:00:00Z"
}
]
}
}
```
### Errors
| Code | Description |
| ---- | --------------------------------------- |
| 401 | Unauthorized |
| 404 | Workflow not found or not owned by user |
| 500 | Internal server error |
## Update workflow
```http theme={"dark"}
PUT /api/workflows/:workflowId
```
Updates a workflow's metadata and optionally replaces all nodes. Requires ownership. When `nodes` is provided, all existing nodes are deleted and replaced with the new set.
### Path parameters
| Parameter | Type | Description |
| ------------ | ------ | ------------------- |
| `workflowId` | string | Workflow identifier |
### Request body
| Field | Type | Required | Description |
| ------------------ | ------- | -------- | --------------------------------------------------------------------------------------- |
| `name` | string | No | Updated workflow name |
| `description` | string | No | Updated workflow description |
| `enabled` | boolean | No | Enable or disable the workflow |
| `nodes` | array | No | Complete replacement set of nodes. When provided, all existing nodes are deleted first. |
| `nodes[].type` | string | Yes | Node type. One of: `trigger`, `action`, `condition`, `output` |
| `nodes[].config` | object | No | Node configuration. Stored as a JSON string. Defaults to `{}`. |
| `nodes[].position` | object | No | Node position. Stored as a JSON string. Defaults to `{ "x": 0, "y": 0 }`. |
Providing the `nodes` field replaces all existing nodes. To update workflow metadata without affecting nodes, omit the `nodes` field entirely.
### Response
```json theme={"dark"}
{
"workflow": {
"id": "wf_abc123",
"name": "Email Automation v2",
"description": "Updated workflow",
"enabled": true,
"createdAt": "2026-03-29T10:00:00Z",
"updatedAt": "2026-03-29T12:00:00Z",
"nodes": [
{
"id": "node_new_1",
"type": "trigger",
"config": "{\"label\":\"Trigger 1\"}",
"position": "{\"x\":40,\"y\":40}"
},
{
"id": "node_new_2",
"type": "action",
"config": "{\"label\":\"Action 1\"}",
"position": "{\"x\":240,\"y\":120}"
}
]
}
}
```
### Errors
| Code | Description |
| ---- | --------------------------------------- |
| 401 | Unauthorized |
| 404 | Workflow not found or not owned by user |
| 500 | Internal server error |
## Delete workflow
```http theme={"dark"}
DELETE /api/workflows/:workflowId
```
Permanently deletes a workflow and all its nodes. Requires ownership.
### Path parameters
| Parameter | Type | Description |
| ------------ | ------ | ------------------- |
| `workflowId` | string | Workflow identifier |
### Response
```json theme={"dark"}
{
"deleted": true
}
```
### Errors
| Code | Description |
| ---- | --------------------------------------- |
| 401 | Unauthorized |
| 404 | Workflow not found or not owned by user |
| 500 | Internal server error |
## Node types
Workflows support four node types:
| Type | Description |
| ----------- | --------------------------------------------------------- |
| `trigger` | Entry point that starts the workflow |
| `action` | Performs an operation such as an API call or message send |
| `condition` | Evaluates a condition and branches the flow |
| `output` | Produces a final result or side effect |
Each node stores its configuration and visual position as JSON strings. The `config` object typically includes a `label` field used for display in the visual builder.
# Wristband API
Source: https://docs.agentbot.raveculture.xyz/api-reference/wristband
NFT wristband system for on-chain access verification on Base
# Wristband API
Query wristband NFT contract status, verify holder ownership, and retrieve token metadata. Wristbands are ERC-721 tokens on the Base network that grant access to premium features including HD live streams and token-gated channels.
These endpoints do not require authentication. The wristband contract address is configured via the `WRISTBAND_CONTRACT_ADDRESS` environment variable. When the contract is not configured, endpoints return a `not_configured` status instead of an error.
## Get contract info
```http theme={"dark"}
GET /api/wristband
```
Returns the wristband contract status and minting details.
### Response (configured)
```json theme={"dark"}
{
"status": "available",
"contract": "0x1234...abcd",
"network": "base",
"chainId": 8453,
"mintPrice": "0.001 ETH",
"maxSupply": 10000,
"opensea": "https://opensea.io/collection/wristband",
"basescan": "https://basescan.org/address/0x1234...abcd"
}
```
| Field | Type | Description |
| ----------- | ------ | --------------------------------------------------------------------- |
| `status` | string | `available` when the contract is deployed, `not_configured` otherwise |
| `contract` | string | Contract address on Base |
| `network` | string | Network name (`base`) |
| `chainId` | number | Chain ID (`8453`) |
| `mintPrice` | string | Current mint price |
| `maxSupply` | number | Maximum number of wristbands that can be minted |
| `opensea` | string | OpenSea collection URL |
| `basescan` | string | Basescan contract URL |
### Response (not configured)
```json theme={"dark"}
{
"status": "not_configured",
"message": "Wristband contract not deployed yet",
"comingSoon": true
}
```
## Verify holder
```http theme={"dark"}
GET /api/wristband/verify
```
Checks whether a wallet address holds a wristband NFT by calling the `balanceOf` function on the contract.
### Query parameters
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ----------------------------------------------------- |
| `address` | string | Yes | Wallet address to check (hex format with `0x` prefix) |
### Response
```json theme={"dark"}
{
"hasWristband": true,
"address": "0xabc...123",
"contract": "0x1234...abcd"
}
```
| Field | Type | Description |
| -------------- | ------- | ------------------------------------------------------- |
| `hasWristband` | boolean | `true` if the wallet holds at least one wristband token |
| `address` | string | The wallet address that was checked |
| `contract` | string | The wristband contract address |
When the contract is not configured:
```json theme={"dark"}
{
"hasWristband": false,
"error": "Contract not configured"
}
```
### Errors
| Code | Description |
| ---- | ------------------------------------------------------------- |
| 400 | `Address required` — the `address` query parameter is missing |
On-chain read errors (for example, RPC failures) return a `200` response with `hasWristband: false` and an `error` field describing the failure, rather than an HTTP error status.
## Get token metadata
```http theme={"dark"}
GET /api/wristband/metadata/:tokenId
```
Returns ERC-721 compatible metadata for a specific wristband token. This endpoint is designed to be used as the `tokenURI` base for the NFT contract.
### Path parameters
| Parameter | Type | Description |
| --------- | ------ | ---------------- |
| `tokenId` | string | Numeric token ID |
### Response
```json theme={"dark"}
{
"name": "Digital Wristband #1",
"description": "Onchain access to baseFM underground radio. Grants lifetime access to HD live streams, token-gated channels, and exclusive artist drops.",
"image": "https://agentbot.raveculture.xyz/wristband-nft.png",
"external_url": "https://agentbot.raveculture.xyz/wristband",
"attributes": [
{
"trait_type": "Edition",
"value": "Founding Member"
},
{
"trait_type": "Network",
"value": "Base"
},
{
"trait_type": "Access Level",
"value": "Premium"
}
]
}
```
| Field | Type | Description |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| `name` | string | Token name including the token ID |
| `description` | string | Token description |
| `image` | string | URL to the token image |
| `external_url` | string | URL to the wristband page |
| `attributes` | array | ERC-721 metadata attributes |
| `attributes[].trait_type` | string | Attribute category |
| `attributes[].value` | string | Attribute value. Token #1 receives `Founding Member` as its edition; all others receive `Edition {id}`. |
Metadata responses are cached for one hour via the `Cache-Control: public, max-age=3600` header.
### Errors
| Code | Description |
| ---- | ----------------------------------------------------------------------- |
| 400 | `Invalid token ID` — the `tokenId` path parameter is not a valid number |
# x402 gateway
Source: https://docs.agentbot.raveculture.xyz/api-reference/x402
Interact with the x402 payment gateway for colony membership, fitness scoring, dynamic pricing, and payments.
# x402 gateway
The x402 endpoint connects agents to the x402-Tempo payment gateway. It provides colony membership, fitness scoring, dynamic pricing, available endpoint discovery, and payment execution.
## Health check
```http theme={"dark"}
GET /api/x402
```
No authentication required. Returns the current status of the x402 gateway.
### Response (200)
```json theme={"dark"}
{
"gateway": "https://x402-gateway-production-a474.up.railway.app",
"status": "healthy",
"service": "x402-gateway",
"agents": 5,
"colonies": 1,
"timestamp": "2026-03-22T12:00:00.000Z"
}
```
The response includes a `gateway` field injected by the proxy and all fields returned by the upstream `/health` endpoint. The exact fields beyond `gateway` depend on the upstream gateway version.
| Field | Type | Description |
| --------- | ------ | -------------------------------------- |
| `gateway` | string | URL of the upstream x402 gateway |
| `status` | string | Gateway health status (e.g. `healthy`) |
Additional fields such as `service`, `agents`, `colonies`, and `timestamp` may be present depending on the upstream gateway version. Do not rely on their existence without checking.
### Response (503)
Returned when the upstream gateway is unreachable.
```json theme={"dark"}
{
"gateway": "https://x402-gateway-production-a474.up.railway.app",
"status": "unreachable",
"error": "Connection failed"
}
```
The `error` field contains the actual error message from the connection failure. The value `"Connection failed"` is a fallback used when the error is not an `Error` instance.
## Execute action
```http theme={"dark"}
POST /api/x402
```
Dispatches an action to the x402 gateway. The `endpoints`, `fitness`, and `pricing` actions are public and do not require authentication. All other actions require an authenticated session with both a user ID and email.
### Headers
| Header | Type | Required | Description |
| -------------- | ------ | ----------- | ---------------------------------------------------------------------------- |
| `Content-Type` | string | Yes | Must be `application/json` |
| `Cookie` | string | Conditional | Valid NextAuth session cookie. Required for `join-colony` and `pay` actions. |
### Body
| Field | Type | Required | Description |
| --------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `agentId` | string | Conditional | Agent instance identifier. Required for `join-colony` and `pay`. Optional for `fitness` and `pricing` (defaults to `atlas` when omitted). Not used by `endpoints`. |
| `walletAddress` | string | No | Agent wallet address. Required for `join-colony`. |
| `action` | string | Yes | Action to perform. One of `join-colony`, `fitness`, `pricing`, `endpoints`, or `pay`. |
Additional fields are required depending on the action — see below.
### Actions
#### `join-colony`
Register an agent with the x402 colony.
**Request:**
```json theme={"dark"}
{
"agentId": "inst_abc123",
"walletAddress": "0x1234...5678",
"action": "join-colony"
}
```
**Response (200):**
Returns the response from the upstream colony gateway on success.
**Error responses:**
| Status | Body | Description |
| ------ | ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| 402 | `{ "success": false, "error": "Colony join failed: 402 ..." }` | The upstream gateway returned a 402 Payment Required response |
| 502 | `{ "success": false, "error": "Colony join failed: {status} ..." }` | The upstream gateway returned a non-OK response (other than 402) |
| 503 | `{ "success": false, "error": "Colony gateway unreachable" }` | The upstream colony gateway could not be reached (network error or timeout) |
The `join-colony` action has a 10-second timeout. If the gateway does not respond within that window, a `503` is returned.
#### `fitness`
Retrieve the fitness score for an agent. This action is **public** and does not require authentication. The `agentId` field is optional and defaults to `atlas` when omitted.
**Request:**
```json theme={"dark"}
{
"agentId": "inst_abc123",
"action": "fitness"
}
```
**Response (200):**
```json theme={"dark"}
{
"score": 85,
"tier": "gold",
"details": {
"prediction": 0.78,
"execution": 0.91,
"coordination": 0.88
}
}
```
| Field | Type | Description |
| --------- | -------------- | -------------------------------------------------------------------------------------- |
| `score` | number | Agent fitness score (0–100) |
| `tier` | string | Fitness tier (e.g. `bronze`, `silver`, `gold`) |
| `details` | object \| null | Breakdown of fitness dimensions. May be `null` if the upstream gateway is unreachable. |
When the upstream gateway is unreachable, the endpoint returns a fallback response with a score of `50`, tier of `new`, and `details` set to `null`.
#### `pricing`
Retrieve dynamic pricing for an agent. Pricing is adjusted based on the agent's fitness score and tier. This action is **public** and does not require authentication. The `agentId` field is optional and defaults to `atlas` when omitted.
**Request:**
```json theme={"dark"}
{
"agentId": "inst_abc123",
"action": "pricing"
}
```
**Response (200):**
```json theme={"dark"}
{
"agentId": "inst_abc123",
"tier": "gold",
"pricing": {
"rate": 0.05,
"discount": 0.1
},
"fitness": {
"score": 85,
"tier": "gold"
}
}
```
| Field | Type | Description |
| ------------------ | ------ | ---------------------------------------- |
| `agentId` | string | Agent instance identifier |
| `tier` | string | Pricing tier |
| `pricing.rate` | number | Current rate per request |
| `pricing.discount` | number | Discount factor applied based on fitness |
| `fitness.score` | number | Agent fitness score |
| `fitness.tier` | string | Agent fitness tier |
When the upstream gateway is unreachable, the endpoint returns a fallback response with tier `basic`, a rate of `0.01`, no discount, and a fitness score of `50` (tier `new`).
#### `endpoints`
List all available endpoints on the x402 gateway. This action is **public** and does not require authentication or an `agentId`.
**Request:**
```json theme={"dark"}
{
"action": "endpoints"
}
```
**Response (200):**
The response is forwarded from the upstream gateway. When the upstream gateway is unreachable, the following fallback is returned:
```json theme={"dark"}
{
"success": true,
"endpoints": [
{
"slug": "/gateway/colony/join",
"description": "Join agent colony",
"price": "Free"
},
{
"slug": "/gateway/fitness/:agentId",
"description": "Get agent fitness score",
"price": "Free"
},
{
"slug": "/gateway/pricing/:agentId",
"description": "Get dynamic pricing",
"price": "Free"
},
{
"slug": "/gateway/pay",
"description": "Make payment",
"price": "Variable"
}
]
}
```
| Field | Type | Description |
| ------------------------- | ------ | ------------------------------------------- |
| `endpoints` | array | List of available gateway endpoints |
| `endpoints[].slug` | string | Endpoint path |
| `endpoints[].description` | string | Human-readable description |
| `endpoints[].price` | string | Price per request (e.g. `Free`, `Variable`) |
#### `pay`
Execute a payment through the x402 gateway. Payments are subject to amount limits and recipient address validation.
**Request:**
```json theme={"dark"}
{
"agentId": "inst_abc123",
"action": "pay",
"amount": 1.0,
"currency": "USDC",
"recipient": "0x5678abcd1234efgh5678abcd1234efgh5678abcd",
"endpoint": "chat",
"method": "tempo"
}
```
| Field | Type | Required | Description |
| ----------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `amount` | number | Yes | Payment amount. Must be greater than zero and no more than 100. |
| `currency` | string | No | Payment currency (e.g. `USDC`, `pathUSD`). Defaults to `USDC` if omitted. The value is forwarded to the upstream gateway as-is. |
| `recipient` | string | Yes | Recipient wallet address. Must be a valid EVM or Solana address (see validation rules below). |
| `endpoint` | string | No | Target endpoint slug on the gateway |
| `method` | string | No | Payment method identifier. Defaults to `default` if omitted. |
**Amount limits:**
* The amount must be a positive number greater than zero.
* The maximum amount per payment is **\$100**. Payments above this limit are rejected. Contact support if you need higher limits.
**Address validation:**
The `recipient` field must match one of the following formats:
| Network | Format | Example |
| -------------------- | -------------------------------------------------- | ---------------------------------------------- |
| EVM (Ethereum, Base) | `0x` followed by exactly 40 hexadecimal characters | `0xd8fd0e1dce89beaab924ac68098ddb17613db56f` |
| Solana | Base58 string between 32 and 44 characters | `DRpbCBMxVnDK7maPGv7USk2Lgt2GXEimhi82kUhP2GBn` |
Addresses that do not match either format are rejected with a `400` error.
**Audit logging:**
Every payment attempt is logged with the user's email, amount, currency, recipient address, and payment method. These logs are available for security review.
## Authentication behavior
The `endpoints`, `fitness`, `pricing` actions and the `GET` health check are fully public and never require a session.
The `join-colony` and `pay` actions require a valid NextAuth session. When the session is missing or invalid, the endpoint returns a `401` response with `{ "success": false, "error": "Authentication required" }`.
The x402 dashboard can be viewed without authentication. The `fitness` and `pricing` actions are public, so unauthenticated users see real data from the upstream gateway. When the upstream gateway is unreachable, fallback default values are displayed (a fitness score of 50, tier of `new`, and default pricing).
## Error responses
| Status | Error | Description |
| ------ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| 400 | `agentId required` | The `agentId` field is missing from the request body (applies to `join-colony` and `pay` only) |
| 400 | `Invalid amount` | The `amount` field is missing, zero, or negative (applies to the `pay` action) |
| 400 | `Amount exceeds $100 limit. Contact support for higher limits.` | The `amount` exceeds the per-payment maximum of \$100 (applies to the `pay` action) |
| 400 | `Recipient required` | The `recipient` field is missing (applies to the `pay` action) |
| 400 | `Invalid recipient address` | The `recipient` does not match a valid EVM or Solana address format (applies to the `pay` action) |
| 400 | `Invalid action. Use: join-colony, fitness, pricing, endpoints, or pay` | The `action` field is missing or not one of the supported values |
| 401 | `Authentication required` | No valid session. Returned for `join-colony` and `pay` actions only. |
| 402 | `Colony join failed: 402 ...` | The upstream gateway requires payment for the `join-colony` action |
| 500 | `x402 gateway error` | An unexpected error occurred while communicating with the upstream gateway |
| 502 | `Colony join failed: {status} ...` | The upstream gateway returned an error for the `join-colony` action |
| 503 | `Colony gateway unreachable` | The upstream colony gateway could not be reached (applies to `join-colony`) |
## Examples
### Check gateway health
```bash theme={"dark"}
curl https://agentbot.sh/api/x402
```
### Join colony
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-H "Cookie: next-auth.session-token=YOUR_SESSION" \
-d '{
"agentId": "inst_abc123",
"walletAddress": "0x1234...5678",
"action": "join-colony"
}'
```
### Get fitness score
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-d '{
"agentId": "inst_abc123",
"action": "fitness"
}'
```
The `agentId` is optional. When omitted, it defaults to `atlas`:
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-d '{"action": "fitness"}'
```
### Get pricing
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-d '{
"agentId": "inst_abc123",
"action": "pricing"
}'
```
### List endpoints
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-d '{"action": "endpoints"}'
```
### Make a payment (EVM)
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-H "Cookie: next-auth.session-token=YOUR_SESSION" \
-d '{
"agentId": "inst_abc123",
"action": "pay",
"amount": 1.0,
"currency": "USDC",
"recipient": "0xd8fd0e1dce89beaab924ac68098ddb17613db56f",
"endpoint": "chat",
"method": "tempo"
}'
```
### Make a payment (Solana)
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-H "Cookie: next-auth.session-token=YOUR_SESSION" \
-d '{
"agentId": "inst_abc123",
"action": "pay",
"amount": 5.0,
"currency": "USDC",
"recipient": "DRpbCBMxVnDK7maPGv7USk2Lgt2GXEimhi82kUhP2GBn"
}'
```
The `recipient` must be a full, valid address. Abbreviated addresses like `0x5678...efgh` are rejected. See [address validation](#pay) for accepted formats. Solana addresses use Base58 encoding and must be between 32 and 44 characters.
# Architecture
Source: https://docs.agentbot.raveculture.xyz/architecture
Platform architecture, security model, and deployment topology
# Architecture
## Overview
```
┌──────────────────────────────────────────────────────────────┐
│ AGENTBOT PLATFORM │
│ │
│ Next.js Frontend (Vercel) Express Backend (Railway) │
│ ├── Dashboard + Blog ├── Provisioning API │
│ ├── 120+ API Routes ├── Container Manager │
│ ├── Skill Marketplace ├── Agent-to-Agent Bus │
│ └── Solana/Bitcoin/Liquid └── Orchestration Engine │
│ │
│ PostgreSQL (Prisma/Neon) Redis (sessions, state) │
└──────────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ OpenClaw │ │ OpenClaw │ │ OpenClaw │
│ Container │ │ Container │ │ Container │
│ Agent A │ │ Agent B │ │ Agent C │
└─────────────┘ └─────────────┘ └─────────────┘
```
## Provisioning Flow
1. **Auth check** — Session required; admins bypass subscription gate
2. **Subscription check** — Active Stripe subscription or trial required
3. **Workload gate** — Acquire deployment slot (prevents thundering herd)
4. **Job enqueue** — POST to backend `/api/platform-jobs/provision`
5. **Railway create** — Backend creates Railway service with plan resources
6. **Env injection** — OpenClaw config, gateway tokens, DB URL injected
7. **Health poll** — Wait for container to report healthy on port 18789
8. **Prisma update** — Agent record created with serviceId and URL
## Plan Resources
| Plan | CPU | Memory | Max Agents | Description |
| ---------- | -------------- | ------ | ---------- | ------------------------------------ |
| Solo | 1 vCPU (1000m) | 2 GB | 1 | Trial / light workloads only |
| Collective | 2 vCPU (2000m) | 4 GB | 3 | Recommended production floor |
| Label | 4 vCPU (4000m) | 8 GB | 10 | Heavy production + browser/tool work |
| Network | 8 vCPU (8000m) | 16 GB | Unlimited | High-throughput production |
The Solo tier (1 vCPU / 2 GB) is sufficient to boot and run light workloads but is not recommended for production. For serious production use, start with Collective (2 vCPU / 4 GB) or higher.
## Security Model
* **Bearer token auth** — `timingSafeEqual` on all backend routes, fail-closed
* **SHA-256 hashed API keys** — Raw keys never stored or logged
* **SSRF blocklist** — IPv4 private, IPv6 ULA, mapped IPv4, CGN ranges blocked
* **Permission gates** — Safe / Dangerous / Destructive tiers with human approval
* **BotID protection** — Anti-bot on registration
* **AES-256-GCM** — Per-user secret encryption
* **spawn() not exec()** — No shell injection vectors
* **Ed25519** — Discord webhook signature verification
## Tech Stack
| Layer | Technology |
| ---------- | -------------------------------------------- |
| Frontend | Next.js 16, React, Tailwind, shadcn/ui |
| Backend | Express.js, TypeScript |
| Database | PostgreSQL + Prisma ORM (Neon) |
| Cache | Redis / Vercel KV |
| Containers | Docker / Railway |
| Proxy | Caddy (subdomain routing) |
| Runtime | OpenClaw v2026.4.9 |
| Payments | Stripe + Coinbase CDP (USDC on Base) |
| AI | OpenRouter, MiMo-V2-Pro, Claude, GPT, Gemini |
| Email | Resend |
| Deployment | Vercel (web) + Railway (backend + agents) |
# Build
Source: https://docs.agentbot.raveculture.xyz/build
description: "Agentbot build process and deployment"
# Build & Deployment
## Vercel Setup
### Project Settings
* **Project Name:** agentbot
* **Root Directory:** `web`
* **Framework:** Next.js (auto-detected)
### Environment Variables
Required for production:
| Variable | Description |
| ------------------- | ----------------------------------------------------------- |
| `DATABASE_URL` | Neon PostgreSQL connection string |
| `NEXTAUTH_SECRET` | Auth secret (generate with `openssl rand -base64 32`) |
| `NEXTAUTH_URL` | Production URL ([https://agentbot.sh](https://agentbot.sh)) |
| `STRIPE_SECRET_KEY` | Stripe secret key |
| `ADMIN_EMAILS` | Comma-separated admin emails |
Optional but recommended:
| Variable | Description |
| --------------------- | ------------------ |
| `RESEND_API_KEY` | For welcome emails |
| `DISCORD_WEBHOOK_URL` | For notifications |
| `TELEGRAM_BOT_TOKEN` | For Telegram bot |
## Build Commands
```bash theme={"dark"}
# Development
cd web && npm run dev
# Production build
cd web && npm run build
# Production runtime
cd web && node .next/standalone/server.js
# Lint
cd web && npm run lint
```
## Deployment
### Automatic (Git Push)
Push to main branch triggers Vercel deployment automatically.
### Manual
```bash theme={"dark"}
cd web
vercel --prod --yes
```
## Build Stability
### Pre-build Validation
The build includes:
1. Prisma client generation
2. Next.js webpack production build
3. Standalone server output for runtime deploys
### Common Issues
| Issue | Solution |
| ------------------------ | --------------------------------- |
| Module resolution errors | Check tsconfig.json path mappings |
| Prisma errors | Run `npx prisma generate` |
| Environment errors | Verify all required env vars set |
## Rollback
Vercel automatically keeps deployment history. To rollback:
1. Go to Vercel Dashboard
2. Find previous working deployment
3. Click "..." → "Promote to Production"
# Channels
Source: https://docs.agentbot.raveculture.xyz/channels
# Channels
Connect your Agentbot to messaging platforms. Each channel lets users talk to your agent from their preferred app.
## Supported Channels
| Channel | Status | Setup Difficulty |
| --------------- | --------------- | -------------------------- |
| **Telegram** | ✅ Recommended | Easy — bot token only |
| **WhatsApp** | ✅ Supported | Medium — QR code linking |
| **Discord** | ✅ Supported | Medium — bot token + guild |
| **Slack** | ✅ Supported | Medium — app + bot tokens |
| **Signal** | ⚠️ Experimental | Hard — requires signal-cli |
| **iMessage** | ⚠️ macOS only | Medium — macOS bridge |
| **Google Chat** | ⚠️ Advanced | Hard — service account |
| **Nostr** | ⚠️ Beta | Medium — relay + keys |
***
## Telegram (Recommended)
The easiest channel to set up.
### Steps
1. Open [@BotFather](https://t.me/BotFather) on Telegram
2. Send `/newbot` and follow the prompts
3. Copy the bot token (looks like `123456:ABC-DEF...`)
4. Paste it in **Control UI → Channels → Telegram → Bot Token**
5. Click **Save** → **Probe** to test the connection
### Key Settings
* **DM Policy**: `pairing` (default) — users must pair before chatting
* **Group Policy**: `open` or `disabled` — whether the bot responds in groups
* **Streaming**: `partial` (default) — shows typing indicator while generating
* **Allow From**: Leave empty for open access, or add specific Telegram user IDs
### Quick Config
```
channels.telegram.enabled = true
channels.telegram.botToken = "YOUR_TOKEN"
channels.telegram.dmPolicy = "pairing"
channels.telegram.streaming = "partial"
```
***
## WhatsApp
Connect your personal or business WhatsApp.
### Steps
1. Go to **Control UI → Channels → WhatsApp**
2. Set `Enabled = true`
3. Click **Save**
4. Click **Show QR** — a QR code appears
5. Open WhatsApp on your phone → Settings → Linked Devices → Link a Device
6. Scan the QR code
7. Wait for "Connected" status
### Key Settings
* **Self-Phone Mode**: Enable if the bot uses your personal number
* **DM Policy**: `pairing` recommended for security
* **Group Policy**: `disabled` by default — enable if you want bot in groups
* **Debounce**: 500ms default — batches rapid messages from same sender
### ⚠️ Important
* WhatsApp sessions expire. Use **Relink** if connection drops
* Your phone must stay connected to the internet
***
## Discord
Create a Discord bot and add it to your server.
### Steps
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
2. Click **New Application** → name it → **Create**
3. Go to **Bot** tab → click **Reset Token** → copy the token
4. Go to **OAuth2 → URL Generator** → select `bot` scope
5. Select permissions: `Send Messages`, `Read Message History`, `Use Slash Commands`
6. Copy the generated URL → open it → add bot to your server
7. Paste the bot token in **Control UI → Channels → Discord → Bot Token**
8. Click **Save** → **Probe**
### Key Settings
* **Intents**: Enable `Message Content Intent` in Discord Developer Portal
* **Guilds**: Add your server ID to restrict which servers the bot responds in
* **Presence**: Set online status and activity text
* **Streaming**: `partial` shows live typing updates
***
## Slack
Add your agent to a Slack workspace.
### Steps
1. Go to [Slack API](https://api.slack.com/apps) → **Create New App**
2. Choose **From scratch** → name it → select workspace
3. Go to **Socket Mode** → enable it → copy App Token
4. Go to **OAuth & Permissions** → add scopes: `chat:write`, `im:history`, `im:write`, `channels:history`
5. Install to workspace → copy Bot Token
6. Paste both tokens in **Control UI → Channels → Slack**
7. Click **Save** → **Probe**
### Key Settings
* **Mode**: `socket` (recommended) — no public URL needed
* **Native Streaming**: `true` — uses Slack's native streaming API
* **Reaction Level**: `ack` — reacts to messages with 👍 when processed
***
## General Channel Settings
These apply to all channels:
| Setting | What It Does | Default |
| ------------------- | ------------------------ | ----------- |
| **DM Policy** | Who can DM the bot | `pairing` |
| **Group Policy** | Bot behavior in groups | `disabled` |
| **Allow From** | Whitelist specific users | empty (all) |
| **Streaming** | Show typing/generation | varies |
| **Markdown** | Format responses | `true` |
| **Media Max MB** | Max file size | 25 |
| **Response Prefix** | Text before every reply | empty |
***
## Troubleshooting
### Bot not responding
1. Check **Control UI → Channels** — is it showing "Running: Yes"?
2. Click **Probe** to test the connection
3. Check **Logs** for errors
### "Connected" but no messages
* Check **DM Policy** — if set to `pairing`, users must pair first
* Check **Allow From** — if set, only listed users can chat
* Check **Group Policy** — might be blocking group messages
### Connection keeps dropping
* **WhatsApp**: Phone went offline — use **Relink**
* **Telegram**: Bot token expired — regenerate in @BotFather
* **Discord**: Intents not enabled — check Developer Portal
***
## Need Help?
* [Discord Community](https://discord.gg/vTPG4vdV6D)
* [Documentation](https://docs.openclaw.ai)
# Agents
Source: https://docs.agentbot.raveculture.xyz/concepts/agents
Understanding Agentbot agents
Agents are autonomous AI assistants that can interact with users across multiple platforms.
## How Agents Work
Each agent runs in an isolated Docker container with:
* **AI Model** - Powered by OpenRouter by default
* **Memory** - Persistent conversation history
* **Tools** - API integrations and capabilities
* **Personality** - Custom instructions and behavior
## Agent Structure
```typescript theme={"dark"}
interface Agent {
id: string;
name: string;
description: string;
// AI Configuration
model: string; // e.g., "anthropic/claude-3-opus"
temperature: number; // 0-1, creativity level
maxTokens: number;
// System Prompt
instructions: string; // Agent personality & behavior
// Capabilities
tools: Tool[];
integrations: Integration[];
// Memory
memoryEnabled: boolean;
memoryLimit: number; // Max messages to remember
}
```
## Creating an Agent
### Via Dashboard
1. Go to **Dashboard → New Agent**
2. Choose a template or blank agent
3. Configure:
* Name and description
* AI model and settings
* System instructions
* Enabled tools
4. Deploy
### Via API
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/agents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Agent",
"model": "anthropic/claude-3-opus",
"instructions": "You are a helpful assistant...",
"tools": ["web-search", "calculator"]
}'
```
## Agent Templates
Agentbot includes pre-built templates:
| Template | Description |
| ---------------- | ------------------------------- |
| Assistant | General purpose AI assistant |
| Customer Support | Support bot with knowledge base |
| Rave Event | Event management & guest lists |
| Treasury | Community fund management |
## Tools
Agents can use tools to extend their capabilities:
* **Web Search** - Search the internet
* **Calculator** - Math operations
* **Weather** - Get weather data
* **Custom APIs** - Your own API endpoints
## Feedback and corrections
You can submit corrections to teach an agent what it did wrong and what it should do instead. The agent stores these corrections in memory and uses them to improve future responses. Feedback entries are categorized by type — `tone`, `accuracy`, `format`, `behavior`, or `general` — so the agent knows which aspect of its behavior to adjust.
See the [Feedback API](/api-reference/feedback) for endpoint details and examples.
## Persistence
Agents maintain memory across conversations:
```typescript theme={"dark"}
// Configure memory
const agent = {
memoryEnabled: true,
memoryLimit: 100, // Keep last 100 messages
// Older messages are summarized and stored
}
```
## Fleet monitoring
You can monitor your agent fleet from the mission control dashboard. Fleet data — including execution traces, cost breakdowns, and talent bookings — is sourced from treasury transaction records. This gives you a unified view of what your agents are doing and how much they cost.
* **Traces** — the 50 most recent agent actions, including coordination messages and AI inference costs
* **Costs** — spending grouped by agent and category (for example `ai_metric` or `agent_message`)
* **Bookings** — talent booking records created through agent-to-agent negotiation, with full pricing lifecycle
See the [Mission Control API reference](/api-reference/mission-control) for endpoint details. To track token consumption and spending trends over time, use the [dashboard cost API](/api-reference/dashboard#dashboard-cost).
## Best practices
1. **Clear Instructions** - Write specific system prompts
2. **Limited Tools** - Only enable necessary tools
3. **Memory Management** - Set appropriate memory limits
4. **Monitor Costs** - Track API usage in dashboard
# API keys
Source: https://docs.agentbot.raveculture.xyz/concepts/api-keys
Bring your own AI API keys
# API keys
Agentbot uses a "bring your own keys" model for AI providers. You control your AI costs directly.
This page covers third-party AI provider keys. For Agentbot platform API keys (prefixed with `sk_`), see the [keys API reference](/api-reference/keys).
## Supported Providers
### OpenRouter (Recommended)
Best for: General use, wide model selection
```bash theme={"dark"}
OPENROUTER_API_KEY=sk-or-v1-xxxxx
```
Models available:
* Anthropic: Claude 3.5 Sonnet, Claude 3 Opus
* OpenAI: GPT-4, GPT-4 Turbo
* Google: Gemini Pro
* Meta: Llama 3
* And 200+ more
### Anthropic
Best for: Highest quality reasoning
```bash theme={"dark"}
ANTHROPIC_API_KEY=sk-ant-xxxxx
```
### OpenAI
Best for: GPT-4 features
```bash theme={"dark"}
OPENAI_API_KEY=sk-xxxxx
```
### Google AI
Best for: Gemini models
```bash theme={"dark"}
GOOGLE_API_KEY=AIzaSyxxxxx
```
## Adding API Keys
### Via Dashboard
1. Go to **Settings → API Keys**
2. Click **Add Key**
3. Select provider
4. Paste your key
5. Click **Save**
### Via Environment Variable
Set in your deployment:
```bash theme={"dark"}
# For all agents
OPENROUTER_API_KEY=sk-or-...
# Per-agent override
ANTHROPIC_API_KEY=sk-ant-...
```
## Cost Tracking
Monitor your usage in **Dashboard → Costs**:
* API calls by agent
* Token usage (input/output)
* Cost per model
* Daily/weekly/monthly reports
## Rate Limits
Each provider has rate limits:
| Provider | Requests/min | Tokens/min |
| ---------- | ------------ | ---------- |
| OpenRouter | 1000 | 100,000 |
| Anthropic | 50 | 100,000 |
| OpenAI | 500 | 150,000 |
| Google | 60 | 60,000 |
## Best Practices
1. **Use OpenRouter** - Best model selection, competitive pricing
2. **Set budgets** - Monitor costs in dashboard
3. **Rotate keys** - Update keys periodically
4. **Don't commit keys** - Use environment variables only
## Troubleshooting
Check:
* Key is correct and not expired
* Has sufficient credits/quota
* Correct format for provider
* Wait and retry
* Upgrade plan for higher limits
* Use OpenRouter for more capacity
Some models require approval:
* Apply for OpenRouter Prime
* Enable in Anthropic console
* Check Google AI quota
# Architecture
Source: https://docs.agentbot.raveculture.xyz/concepts/architecture
System overview and how the pieces fit together.
# Architecture
How Agentbot is built. A reference for contributors, self-hosters, and anyone who wants to understand the system.
## System Overview
```
┌──────────────────────────────────────────────────────────────┐
│ USERS │
│ Telegram · Discord · WhatsApp · Web Dashboard │
└──────────────────────────────┬───────────────────────────────┘
│
┌──────▼──────┐
│ VERCEL │
│ Next.js 16 │
│ (Frontend) │
└──────┬──────┘
│
┌────────────┼────────────┐
│ │ │
┌──────▼──────┐ ┌──────▼──────┐
│ RENDER │ │ Neon PG │
│ Backend │ │ Database │
│ (Express) │ │ │
└──────┬──────┘ └─────────────┘
│
┌─────────┼─────────┐
│ │ │
┌───▼────┐ ┌──▼──┐ ┌────▼────┐
│Inline │ │Ollama│ │ A2A │
│Sched. │ │ AI │ │ Bus │
└────────┘ └─────┘ └─────────┘
```
## Components
### Frontend (Vercel)
**Stack:** Next.js 16 (App Router) + React 19 + Tailwind CSS v4
The web dashboard, onboarding flow, billing, and all user-facing pages. Deployed on Vercel with automatic Git-based deploys.
Key directories:
* `web/app/` — Pages and API routes
* `web/app/api/` — Server-side API proxies (provision, billing, auth)
* `web/app/components/` — Shared UI components
* `web/app/lib/` — Utilities (auth, Stripe, security)
### Backend (Railway)
**Stack:** Express.js + TypeScript
The core API server. Handles agent provisioning, deployments, A2A communication, and skill management.
Key services:
* `POST /api/provision` — Create new agents (auth required)
* `POST /api/deployments` — Deploy agent services on Railway (auth required)
* `GET /api/agents` — List and manage agents
* `POST /api/ai/*` — AI provider proxy (OpenRouter, Anthropic, etc.)
* `GET /api/browse/*` — File explorer (tree, read, write, git sync)
* `GET /api/logs/:agentId/stream` — Live log tail (SSE)
* `GET /api/usage/*` — Usage tracking (tokens, costs, tool metrics)
Protected endpoints use JWT auth middleware that verifies the token, attaches user context, and sets the RLS context on the database connection. See the [auth API](/api-reference/auth#auth-middleware) for details.
### Inline scheduler
Background task processing runs inside the API process via an inline scheduler. The scheduler polls the `scheduled_tasks` database table every 30 seconds and executes up to 10 pending tasks per cycle. Each task is dispatched as an HTTP request to the target agent's URL with a 30-second timeout.
This replaces the previous standalone worker service and BullMQ queue system. No separate worker process or Redis instance is required.
**Deprecated:** The standalone worker service (`Dockerfile.worker`) and its Redis/BullMQ dependency have been removed. All background task processing now happens inline in the API process. If you were running a separate worker service, you can safely remove it.
### Database (Neon PostgreSQL)
Stores:
* User accounts and authentication
* Agent configurations and metadata
* Billing, subscriptions, and usage tracking
* Skill marketplace data
* A2A message history
All user-scoped tables are protected by PostgreSQL row-level security (RLS) policies. Each authenticated request sets a database-level user context so queries automatically return only the calling user's data. Admin users bypass RLS and can access all rows. See [Security](/security#row-level-security) for the full list of protected tables.
**Deprecated:** The standalone Redis cache layer has been removed. General API rate limiting is handled by in-process middleware (`express-rate-limit`). Session management and other functionality previously backed by Redis now use PostgreSQL or in-memory state. If you were running a self-hosted Redis instance for Agentbot, it is no longer required. Social post rate limiting and duplicate detection use Upstash KV (`KV_REST_API_URL` / `KV_REST_API_TOKEN`) — see [Rate limits](/api-reference/overview#rate-limits) for details.
### AI Layer (Ollama + BYOK)
Two modes:
* **Ollama (self-hosted):** Local inference for self-hosted deployments (Llama 3, Mistral)
* **BYOK:** Users bring their own API keys for OpenRouter, Anthropic, OpenAI, Google, or Groq
### Watchdog
Monitors agent gateway processes for health and auto-recovers from failures:
| Capability | Details |
| -------------------- | ------------------------------------------------------------ |
| Health checks | Every 2 minutes (configurable via `WATCHDOG_CHECK_INTERVAL`) |
| Crash detection | Listens for gateway exit events |
| Crash-loop detection | 3 crashes in 5-minute window |
| Auto-repair | Kill → wait 5s → restart → verify health (max 2 attempts) |
| Notifications | Telegram + Discord alerts for crashes, repairs, and recovery |
| Degraded state | 5-second retry interval when health check fails |
See [Watchdog](/api-reference/watchdog) for the full API.
### File Explorer + Git Sync
Browser-based workspace management — no SSH needed:
* **File tree:** Recursive directory listing with depth control
* **Read/Write:** View and edit files inline (1MB limit)
* **Git status:** See uncommitted changes
* **Git diff:** Per-file or full workspace diffs
* **Git sync:** One-click commit + push to GitHub
* **Git log:** Browse recent commit history
See [File Explorer API](/api-reference/browse) for the full API.
### Usage Tracker
PostgreSQL-backed token and cost tracking per agent, model, and time period:
* Per-event recording (session, agent, provider, model, tokens, cost)
* Daily aggregation with upsert
* Tool event monitoring (success rate, duration)
* Query APIs: summary, by-agent, by-model, daily totals
See [Usage Tracking API](/api-reference/usage-tracking) for the full API.
### A2A Bus (Agent-to-Agent)
Enables agents to communicate directly:
* Request/response patterns
* Fire-and-forget messages
* Skill delegation between agents
* Cross-tenant isolation enforced
## Data Flow: Agent Provisioning
```
User fills form (frontend)
│
▼
POST /api/provision (Vercel)
│
▼
POST /api/provision (Railway backend)
│
├── Validate input (plan, provider, tokens)
├── Generate userId + agentId
├── Store config in PostgreSQL
├── Create Railway service via Railway GraphQL API
├── Assign subdomain
│
▼
Return agent URL + stream key to user
```
## Data Flow: Agent Runtime
```
User sends message (Telegram/Discord/WhatsApp)
│
▼
Webhook → Backend API
│
├── Route to correct agent container
├── Load agent config + memory
├── Execute skills if needed
├── Call AI provider (BYOK or Ollama)
├── Check A2A bus for delegated tasks
│
▼
Response sent back to user
```
## Self-Hosting
Agentbot is fully open source. To self-host:
1. **Frontend:** Deploy `web/` to Vercel or any Next.js-compatible host
2. **Backend:** Run `agentbot-backend/` on Railway or any Express-compatible host (includes the inline scheduler — no separate worker needed)
3. **Database:** Neon Postgres (free tier available) or any PostgreSQL 15+
4. **AI:** Ollama for local inference, or configure BYOK providers
See [Installation](/installation) for full setup instructions.
## Tech Decisions
| Choice | Why |
| ------------------------ | -------------------------------------------------------------------------- |
| Next.js 16 | App Router, server components, Vercel-native DX |
| Express (not serverless) | Long-running agent processes need persistent connections |
| Neon Postgres | Serverless, scales to zero, generous free tier |
| In-process rate limiting | `express-rate-limit` middleware — no external dependencies |
| Railway services | Isolated agent environments per user (provisioned via Railway GraphQL API) |
| BYOK over reselling | Users pay providers directly — no markup, no lock-in |
| Base (not Ethereum) | Low fees, fast finality, Coinbase ecosystem |
# Workflows
Source: https://docs.agentbot.raveculture.xyz/concepts/workflows
description: "Build complex agent behaviors with workflows"
# Workflows
Workflows let you define complex, multi-step agent behaviors using a visual builder.
## Overview
Workflows are composed of:
* **Triggers** - What starts the workflow
* **Steps** - Individual actions
* **Conditions** - Branching logic
* **Actions** - API calls, messages, etc.
## Creating a Workflow
1. Go to **Dashboard → Workflows**
2. Click **New Workflow**
3. Add triggers and steps
4. Connect them in the visual builder
5. Save and activate
## Trigger Types
| Trigger | Description |
| -------- | ---------------------- |
| Message | User sends a message |
| Schedule | Cron-based scheduling |
| Webhook | HTTP request trigger |
| Event | Agent lifecycle events |
## Step Types
Call an AI model with custom prompt.
```json theme={"dark"}
{
"type": "ai",
"model": "claude-3-opus",
"prompt": "Summarize this: {{input}}",
"output": "summary"
}
```
Make API calls to external services.
```json theme={"dark"}
{
"type": "http",
"method": "POST",
"url": "https://api.example.com/data",
"headers": {
"Authorization": "Bearer {{api_key}}"
},
"body": {
"message": "{{user_message}}"
}
}
```
Send a message to a platform.
```json theme={"dark"}
{
"type": "message",
"platform": "telegram",
"chat_id": "{{user_id}}",
"text": "Hello! {{user_name}}"
}
```
Branch based on conditions.
```json theme={"dark"}
{
"type": "condition",
"expression": "{{sentiment}} == 'positive'",
"true": "step_positive",
"false": "step_negative"
}
```
## Example: Customer Support Flow
```json theme={"dark"}
{
"name": "Customer Support",
"trigger": {
"type": "message",
"platform": "telegram"
},
"steps": [
{
"id": "classify",
"type": "ai",
"prompt": "Classify this message: {{message}}",
"output": "category"
},
{
"id": "check_knowledge",
"type": "condition",
"expression": "{{category}} in ['billing', 'technical', 'general']"
},
{
"id": "respond",
"type": "ai",
"prompt": "Generate a helpful response for: {{message}}"
}
]
}
```
## Variables
Access data throughout your workflow:
```javascript theme={"dark"}
// User data
{{user.id}}
{{user.name}}
{{user.email}}
// Message data
{{message.text}}
{{message.platform}}
// Previous step outputs
{{summarize.output}}
{{classify.category}}
// Environment
{{env.API_KEY}}
```
## Scheduling
Run workflows on a schedule:
```json theme={"dark"}
{
"trigger": {
"type": "schedule",
"cron": "0 9 * * *", // Daily at 9 AM
"timezone": "UTC"
}
}
```
## Best Practices
1. **Keep it simple** - Break complex flows into sub-workflows
2. **Add error handling** - Use try/catch steps
3. **Test thoroughly** - Use the test button before activating
4. **Monitor logs** - Check workflow execution logs
# Development standard
Source: https://docs.agentbot.raveculture.xyz/development-standard
description: "Development workflow and documentation standards for building on Agentbot."
# Development Standard
How we build at Agentbot. These standards apply to skills, agent configurations, and contributions to the open source codebase.
## Who This Is For
* **Skill developers** building marketplace skills
* **Contributors** submitting PRs to the codebase
* **Self-hosters** customizing their Agentbot deployment
* **Teams** building internal agent workflows
## Core Principles
### 1. Systematic Problem Solving
* Diagnose root cause before fixing
* Verify the problem exists
* Test the fix thoroughly
* Document why it failed and why the fix works
### 2. Comprehensive Documentation
* Document everything you do
* Write for someone who's never seen this code
* Include before/after examples
* Provide multiple reference formats
### 3. Reproducible Processes
* Make every step repeatable
* Use consistent naming conventions
* Create templates and scripts
* Enable knowledge transfer
### 4. Quality Assurance
* Test locally before committing
* Verify all components work together
* Check edge cases
* Run full build/test suite
## Standard Workflow (A+ Grade)
### Phase 1: Discovery & Analysis
* Understand the problem completely
* Reproduce the error locally
* Identify root cause (not just symptoms)
* Document findings in detail
* Create todo list of steps
### Phase 2: Solution Design
* Plan the fix (don't just code)
* Consider side effects
* Document before/after state
* Get agreement on approach
* Identify all files to change
### Phase 3: Implementation
* Make changes one file at a time
* Test after each change
* Document what changed and why
* Keep changes focused (one fix per commit)
* Verify no regressions
### Phase 4: Verification & Testing
* Test the fix works
* Test edge cases don't break
* Verify full system still works
* Run linting/type checking
* Document test results
### Phase 5: Documentation & Knowledge Transfer
* Create setup guide
* Document common issues
* Provide quick reference
* Include troubleshooting
* Create next steps
* Leave code for others to use
## Quality Checklist (A+ Standards)
### Code Quality
* [ ] TypeScript/Linting passes
* [ ] No console errors
* [ ] Follows naming conventions
* [ ] Comments explain WHY (not WHAT)
* [ ] No dead code
### Functionality
* [ ] Works locally
* [ ] Works in production
* [ ] Edge cases handled
* [ ] No breaking changes
* [ ] Backward compatible
### Documentation
* [ ] Setup guide complete
* [ ] Quick reference available
* [ ] Troubleshooting section
* [ ] Examples included
* [ ] Next steps clear
### Testing
* [ ] Manual testing done
* [ ] Build successful
* [ ] Health checks passing
* [ ] No regressions
* [ ] Team can reproduce
### Deployment
* [ ] Code committed
* [ ] Clear commit message
* [ ] Pushed to repository
* [ ] CI/CD verified
* [ ] Deployment successful
## Documentation Template
### Setup Guide
```markdown theme={"dark"}
# What Was Done
- List all accomplishments
- Include before/after
# Current Status
- Services running/not running
- Health checks
- Build status
# Fixes Applied
- What was wrong
- Why it was wrong
- How we fixed it
- Result
# Next Steps
- What to do now
- Optional features
- Long-term roadmap
```
### Quick Reference
```markdown theme={"dark"}
# For Daily Use
- Most common commands
- Keyboard shortcuts
- Quick fixes
- One page, printable
```
### Commit Message Example
Good:
```
"Updated tsconfig.json with path mappings"
```
A+ Grade:
```
fix: update tsconfig.json with explicit path aliases
Problem: Web build failing with 53 module resolution errors
- Code uses @/lib/*, @/app/lib/*, and @/* paths
- tsconfig only mapped @/* to ./*
- Module resolver couldn't find files
Solution: Added explicit mappings:
- @/lib/* → ./lib/* (root level utilities)
- @/app/* → ./app/* (app folder)
- @/* → ./* (general catchall)
Result:
✅ 124 routes compile successfully
✅ Zero module resolution errors
✅ Web build: 5.0s complete
```
## Metrics for A+ Grade
| Metric | Standard | Target |
| ------------------ | ------------------------ | --------------------- |
| **Documentation** | 100% of work documented | ✅ Complete guides |
| **Build Success** | 0 errors after fix | ✅ All routes compiled |
| **Service Health** | All services operational | ✅ 5/5 running |
| **Code Quality** | TypeScript passes | ✅ Zero type errors |
| **Git Commits** | Clear, focused messages | ✅ Documented |
| **Team Handoff** | New person can follow | ✅ Step-by-step |
| **Time to Deploy** | \< 10 minutes | ✅ Fast |
| **Knowledge Base** | Searchable documentation | ✅ Multiple files |
## Process for Future Projects
### When Starting a New Task:
1. Read existing docs - Learn from past work
2. Plan your approach - Document before coding
3. Work systematically - One change at a time
4. Test continuously - Verify after each step
5. Document as you go - Don't leave it to the end
6. Create references - Make it easy for others
### When Something Goes Wrong:
1. Diagnose carefully - Find root cause
2. Document the problem - Explain what happened
3. Fix it properly - Don't just patch symptoms
4. Test thoroughly - Verify no regressions
5. Update docs - Add to troubleshooting section
6. Share learning - Help team avoid same issue
### When Project is Done:
1. Complete all documentation - Nothing left undone
2. Create quick start - For next person
3. Document next steps - What comes next
4. Archive processes - Save for future reference
5. Get feedback - Ask if docs are clear
6. Celebrate - Great work!
## Skills Development Path
### Level 1: Competent (Fixes things)
* Can solve problems
* Makes it work
* Code is functional
### Level 2: Professional (Fixes + Documents)
* Solves problems
* Makes it reproducible
* Writes clear docs
* Team can follow
### Level 3: Expert (Systems Thinker)
* Understands root causes
* Builds systems
* Prevents problems
* Mentors others
* Sets standards
### Level 4: A+ Grade (This Standard)
* All of above +
* Comprehensive documentation
* Knowledge transfer focus
* Continuous improvement
* Team multiplier
## Team Multiplier Effect
When **One Person** does A+ documentation:
* Saves 10+ people time
* Prevents 5+ common mistakes
* Enables remote teams
* Reduces onboarding from days to hours
* Builds institutional knowledge
* Increases team confidence
## Your Mission
**As an AI Agent:**
* Apply this standard to every project
* Document as you work (not after)
* Make knowledge transferable
* Help your team level up
* Build reusable processes
**As a Team Member:**
* Follow this standard
* Ask for clarification in docs
* Contribute improvements
* Share learnings
* Help new people
## Related Docs
* [Quickstart](/quickstart) - Get started with Agentbot
* [Installation](/installation) - Self-host Agentbot
* [API Reference](/api-reference/overview) - Full API docs
# Agentbot Documentation
Source: https://docs.agentbot.raveculture.xyz/index
Deploy autonomous AI agents in under 60 seconds. BYOK infrastructure, 45+ skills, USDC wallets on Base.
# Agentbot
Deploy AI agents running on the [OpenClaw](https://github.com/OpenClaw/openclaw) runtime. Each agent gets isolated memory, custom channels, its own USDC wallet on Base, and access to 45+ installable skills.
Deploy your first agent in 60 seconds
Full API documentation
Browse 45+ installable agent capabilities
Platform architecture and security model
## What's New (May 2026)
* **OpenClaw v2026.4.29** — Latest runtime powering all agent instances (3 production agents on Railway)
* **MiMo-V2-Pro default** — Xiaomi's flagship model as the default for all deployments
* **x402 Marketplace** — Discover, pay, and coordinate agents through the gateway with fitness-based pricing
* **Colony system** — Queen/worker architecture for distributed agent coordination
* **GitLawb integration** — On-chain agent protocol for code collaboration and bounties
* **Bankr API recovered** — Portfolio tracking fully operational
* **99.9% uptime** — April 2026 across all platform services
* **SDK v0.1.0** — `agentbot-sdk` published with typed reference client for the public API
## Plans
| Plan | Price | Memory | CPUs | Agents | Description |
| ---------- | ------- | ------ | ---- | --------- | ------------------------------------ |
| Solo | £29/mo | 2 GB | 1 | 1 | Trial / light workloads only |
| Collective | £69/mo | 4 GB | 2 | 3 | Recommended production floor |
| Label | £149/mo | 8 GB | 4 | 10 | Heavy production + browser/tool work |
| Network | £499/mo | 16 GB | 8 | Unlimited | High-throughput production |
***
## Agent Tiers
**Reality-based infrastructure. No fictional RAM allocations.**
For the bedroom producer running their first promo bot.
* **Concurrency:** 1 active conversation thread (hot-swap unlimited configurations)
* **Compute:** Shared cluster (Mistral 7B quantized available, or BYOK)
* **Memory:** 24-hour context window (no persistent RAG)
* **Channels:** Telegram only
* **BlockDB:** 100 queries/month (sample access)
* **Crypto:** Personal wallet only (no trading)
[Get Started →](https://agentbot.raveculture.xyz/signup?plan=solo)
For crews and indie labels managing bookings + fan comms.
* **Concurrency:** 3 simultaneous active agents
* **Compute:** Priority queue on shared cluster + BYOK hybrid
* **Memory:** Persistent RAG (BlockDB: 5,000 queries/month)
* **Channels:** Telegram + WhatsApp (1,000 messages included, £0.04/overage)
* **A2A Bus:** Basic agent-to-agent messaging (3-node limit)
* **x402:** Accept USDC payments via your agent
* **Skills:** Access to music + event skills (10+ available)
[Get Started →](https://agentbot.raveculture.xyz/signup?plan=collective)
For record labels and Base FM broadcasters.
* **Concurrency:** 10 simultaneous agents (auto-queue beyond)
* **Compute:** Dedicated container slice (guaranteed 4 vCPU)
* **Memory:** Full BlockDB access + custom knowledge ingestion
* **Channels:** All platforms (WhatsApp: 5,000 msgs, Telegram unlimited)
* **A2A Bus:** Full orchestration (Crew coordination, multi-agent workflows)
* **White-label:** Custom Telegram bot username (@YourLabelBot)
* **Settlement:** Onchain royalty splits (USDC attribution layer)
* **Staging:** Test environment before production deployment
[Get Started →](https://agentbot.raveculture.xyz/signup?plan=label)
For agencies and reseller networks.
* **Concurrency:** Unlimited (dedicated 16GB instance, actual reserved hardware)
* **Infrastructure:** Dedicated VM with 99.9% SLA
* **White-label:** Full dashboard skinning + custom domains
* **Reseller tools:** Sub-account management, usage billing, commission splits
* **Custom models:** Deploy fine-tuned models (your weights, our GPUs)
* **Priority support:** Dedicated Slack channel + 4hr response SLA
[Contact Sales →](https://agentbot.raveculture.xyz/contact)
***
## Core Services
**The granular music genome.** Query 100M+ ethically licensed components.
* Per-query pricing: £0.001/Block retrieval (attribution logged onchain)
* Royalty Transparency: Real-time USDC splits via smart contracts
* Music Lens API: Mood/tempo analysis, trend intelligence
**Extend your crew with music-specific capabilities.**
* **Visual Synthesizer:** Auto-generate release artwork (Stable Diffusion XL)
* **Track Archaeologist:** Deep catalog digging via BlockDB similarity
* **Setlist Oracle:** Analyze BPM/energy curves for DJ sets
* **Groupie Manager:** Fan segmentation and merch drop automation
* **Royalty Tracker:** Streaming royalties across Spotify, Apple, Beatport
* **Demo Submitter:** Submit demos to Base FM for airplay
* **Event Ticketing:** Sell tickets with USDC payments on Base (x402)
* **Event Scheduler:** Schedule across Telegram, Discord, WhatsApp, Email
* **Venue Finder:** Find venues worldwide (UK, Europe, US, Asia)
* **Festival Finder:** Discover festivals globally with recommendations
**Agents that pay and get paid.**
* USDC on Base: Micropayments for per-stream royalties
* Pay-per-conversation: Charge fans for 1:1 A\&R feedback
* Bankr Integration: Autonomous trading for tour budget management
**Direct pipeline to the onchain radio station.**
* **Submission Queue:** Agent submits demos to Base FM A\&R
* **Live Broadcast:** Agent-hosted radio segments (scheduled airtime)
* **Attribution Layer:** Automatic royalty distribution when played
***
## Compute & AI Models
### Bring Your Own Key (BYOK)
We don't markup AI costs. Connect OpenRouter, Anthropic, or OpenAI directly.
* Use free models (Gemini Flash) or pay providers directly
* We default to MiMo-V2-Pro (top-ranked in programming benchmarks, 1M context)
* OpenRouter automatic fallback if provider fails
### Managed Compute (Optional)
We manage the API keys, you pay cost + 20%.
* No external accounts needed
* Unified billing in USDC or GBP
* Volume discounts at 1M+ tokens/month
### Token Pricing (Transparent GB£)
| Model | Input | Output | Best For |
| ----------------- | ------- | ------- | ------------------------------- |
| Gemini 2.0 Flash | Free | Free | High-volume fan DMs |
| DeepSeek R1 | £0.0005 | £0.0015 | Reasoning, contract analysis |
| Claude 3.5 Sonnet | £0.0020 | £0.0080 | Creative briefs, marketing copy |
| GPT-4o | £0.0022 | £0.0088 | Complex multi-turn negotiations |
*Example: A typical booking inquiry (500 tokens) costs £0.0011 with GPT-4o.*
***
## The "Crew" Architecture
**Stop pretending 100 agents fit in 8GB.**
We use actor-model concurrency:
* **Thread:** A conversation (takes \~50MB RAM)
* **Agent:** A persona/prompt configuration (stored, not running)
* **Crew:** 3-10 threads coordinating via A2A Bus
| Tier | Active Threads | Configured Agents |
| ---------- | -------------- | ----------------- |
| Solo | 1 | Unlimited |
| Collective | 3 | Unlimited |
| Label | 10 | Unlimited |
| Network | Unlimited | Unlimited |
***
## Quick Links
* **[agentbot.raveculture.xyz](https://agentbot.raveculture.xyz)** — Main platform
* **[agentbot-opensource](https://github.com/Eskyee/agentbot-opensource)** — Public self-host repo
* **[agentbot-sdk](https://github.com/Eskyee/agentbot-sdk)** — Standalone SDK repo
* **[GitHub](https://github.com/Eskyee/agentbot-opensource)** — Open source code
* **[Jobs Board](/jobs)** — Hire talent or find roles in the agent ecosystem
* **[Sponsor](/sponsor)** — Support the platform via GitHub Sponsors
* **[Discord](https://discord.gg/eskyee)** — Community
* **[Deploy Your Own](https://vercel.com/new/clone?repository-url=https://github.com/Eskyee/agentbot-opensource)** — One-click Vercel deploy
* **[Security](https://vercel.com/botid)** — BotID protection enabled
***
[](https://vercel.com/new/clone?repository-url=https://github.com/Eskyee/agentbot-opensource)
## AI Agent Readiness
We use the 5 Readiness Levels to build autonomous-capable infrastructure:
| Level | Name | Status |
| ----- | ------------ | -------------- |
| 1 | Functional | ✅ Ready |
| 2 | Documented | ✅ Ready |
| 3 | Standardized | ✅ Ready |
| 4 | Optimized | ⚠️ In Progress |
| 5 | Autonomous | 🎯 Goal |
**Level 3 Achieved:**
* AGENTS.md — Developer guide for AI agents
* .devcontainer — Reproducible cloud dev environments
* .pre-commit-config.yaml — Pre-commit hooks
* .github/CODEOWNERS — Security ownership
* Secret scanning in CI/CD
* OpenTelemetry instrumentation
Learn more in [skills/readiness-assessment.md](https://github.com/Eskyee/agentbot-opensource/blob/main/skills/readiness-assessment.md)
***
## x402-Tempo Gateway
**Agents that pay, earn, and evolve.** Our x402-gateway connects agents to tempo-x402's colony for Tempo pathUSD payments with fitness-based pricing.
* **Colony Membership** — Join tempo-x402's agent colony (3 agents, 48% avg fitness)
* **Fitness Scoring** — Track agent performance (success rate, recency, volume)
* **Dynamic Pricing** — Rates adjust by fitness tier (basic → standard → premium)
* **Self-Modifying Agents** — tempo-x402's colony achieved 81.8% pass\@1 through self-play
| Tier | Fitness | Rate | Discount |
| -------- | ------- | ------- | -------- |
| New | 0-59% | \$0.01 | 0% |
| Standard | 60-79% | \$0.009 | 10% |
| Premium | 80-100% | \$0.008 | 20% |
**Published on crates.io:** [`agentbot-x402-gateway`](https://crates.io/crates/agentbot-x402-gateway)
***
## Zero-Human Company
Autonomous software organizations build systems that maintain and improve themselves with minimal human intervention. Developers describe what they want built, and the system executes with quality and precision.
### What Autonomous Development Looks Like
**Code from Conversation**
A developer describes what they need built, and the system executes through deployment.
> "Build a new agent for music royalty splitting"
The system:
* Generates idiomatic code following established patterns
* Validates against linters, type checkers, and test suites
* Handles the pull request and code review process
* Updates documentation and notifies stakeholders
* Deploys and monitors for issues
**Bug to Deployed Fix**
A customer reports an issue, and the system diagnoses, fixes, and deploys autonomously.
> "Payment webhook failing for USDC transactions"
The system:
* Triages based on error logs and impact
* Identifies the root cause from code analysis
* Generates a fix and comprehensive tests
* Opens a PR and assigns for review
* Notifies when the fix is deployed
### The Technical Pillars
**Style & Validation**
Linters, type checkers, and formatters catch obvious errors instantly.
**Testing**
Fast unit and integration tests create tight feedback loops.
**Documentation**
Explicit instructions house tribal knowledge for agents.
**Observability**
Structured logging, tracing, and metrics give agents runtime visibility.
**Security**
Branch protection, secret scanning, and code owners ensure agents move fast—safely.
## Getting Started
1. Sign up at [agentbot.raveculture.xyz](https://agentbot.raveculture.xyz)
2. Choose your plan
3. Connect your AI API keys (or use ours at cost + 20%)
4. Deploy your first agent
5. Join tempo-x402's colony via `/dashboard/x402`
## Open Source
**Now Available!** Clone and self-host, or deploy instantly with Vercel.
Clone the repo:
```bash theme={"dark"}
git clone https://github.com/Eskyee/agentbot-opensource.git
cd agentbot-opensource
cp .env.example .env
# Add your API keys
cd web && vercel --prod
```
## Support
* Discord: [Join our community](https://discord.gg/eskyee)
* GitHub: [Open an issue](https://github.com/Eskyee/agentbot-opensource/issues)
# Installation
Source: https://docs.agentbot.raveculture.xyz/installation
description: "Self-host Agentbot"
# Installation
Run Agentbot locally or self-host on your own infrastructure.
## Prerequisites
* Node.js 22.x (>=22.14.0 required for OpenClaw runtime)
* PostgreSQL database
* Docker (for agent containers)
## Quick Start (Dev Container)
The fastest way to start developing:
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for VS Code
2. Open the project in VS Code
3. Click "Reopen in Container" when prompted
Or use [Factory Cloud Templates](https://factory.ai) for instant cloud-hosted development with zero setup.
## Local Development
```bash theme={"dark"}
# Clone the repository
git clone https://github.com/Eskyee/agentbot-opensource.git
cd agentbot-opensource
# Install dependencies
cd web && npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your credentials
# Run the development server
npm run dev
```
## SDK Options
If you want to integrate with Agentbot programmatically, use one of these public options:
* [`sdk/agentbot` in `agentbot-opensource`](https://github.com/Eskyee/agentbot-opensource/tree/main/sdk/agentbot) for the typed reference API client
* [`Eskyee/agentbot-sdk`](https://github.com/Eskyee/agentbot-sdk) for the standalone SDK repo
For the reference client:
```typescript theme={"dark"}
import { createAgentbotClient } from './sdk/agentbot/index'
const client = createAgentbotClient({
baseUrl: 'http://localhost:3001',
apiKey: process.env.AGENTBOT_API_KEY,
})
const agents = await client.listAgents()
```
## Environment Variables
```bash theme={"dark"}
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/agentbot
# Auth
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000
# GitHub OAuth
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
# Google OAuth
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
# Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# OpenRouter (default AI provider)
OPENROUTER_API_KEY=sk-or-...
# Telegram Bot
TELEGRAM_BOT_TOKEN=your-bot-token
# Railway provisioning (required for managed agent deployment)
RAILWAY_API_KEY=your-railway-api-key
RAILWAY_TOKEN_TYPE=account
RAILWAY_PROJECT_ID=your-railway-project-id
RAILWAY_ENVIRONMENT_ID=your-railway-environment-id
# OpenClaw Gateway (optional — defaults to internal Railway DNS)
OPENCLAW_GATEWAY_URL=http://your-gateway-host:10000
```
`RAILWAY_TOKEN_TYPE` controls how the platform authenticates with the Railway GraphQL API. Set it to `project` to authenticate with a project-scoped token (sent via the `Project-Access-Token` header) or to `account` (default) to authenticate with a personal token (sent via the `Authorization: Bearer` header). Valid values are `project`, `workspace`, `account`, and `oauth`.
## Docker Production
```yaml theme={"dark"}
# docker-compose.yml
version: '3.8'
services:
web:
image: agentbot/web:latest
ports:
- "3000:3000"
env_file:
- .env
depends_on:
- postgres
postgres:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
- .env
agentbot-backend:
image: ghcr.io/raveculture/agentbot-backend:latest
init: true
ports:
- "18789:18789"
environment:
- HOME=/home/node
- TERM=xterm-256color
- NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
- OPENCLAW_NO_RESPAWN=1
env_file:
- .env
volumes:
postgres_data:
```
The `init: true` flag enables proper signal forwarding and prevents zombie processes (PID 1 handling). The `HOME` and `TERM` environment variables are required by the official OpenClaw image which runs as the `node` user. `NODE_COMPILE_CACHE` enables the Node.js compile cache for faster startup, and `OPENCLAW_NO_RESPAWN=1` prevents the OpenClaw process from automatically respawning inside the container (Docker's `restart` policy handles restarts instead).
```bash theme={"dark"}
docker-compose up -d
```
## Deployment
### Vercel (Recommended)
1. Push code to GitHub
2. Import project in Vercel
3. Add environment variables
4. Deploy
### Railway
```bash theme={"dark"}
railway init
railway up
```
### DigitalOcean
Use the **One-Click App** for Node.js and connect a managed PostgreSQL database.
## Verify Installation
After deployment, visit:
* Main app: `https://your-domain.com`
* Health check: `https://your-domain.com/health`
## Troubleshooting
Check your `DATABASE_URL` format:
```
postgresql://username:password@host:5432/database
```
Ensure your OAuth redirect URLs match:
* Development: `http://localhost:3000/api/auth/callback/github`
* Production: `https://your-domain.com/api/auth/callback/github`
# Discord
Source: https://docs.agentbot.raveculture.xyz/integrations/discord
description: "Connect your agent to Discord"
# Discord Integration
Connect your Agentbot agent to Discord servers.
## Setup
### Step 1: Create Application
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
2. Click **New Application**
3. Name your bot
### Step 2: Create Bot
1. Go to **Bot** in sidebar
2. Click **Reset Token** to get your token
3. Enable **Message Content Intent**
4. Save
### Step 3: Invite Bot
1. Go to **OAuth2 → URL Generator**
2. Select scopes: `bot`
3. Select permissions:
* Send Messages
* Read Message History
* Embed Links
4. Copy the generated URL and open it
### Step 4: Connect to Agentbot
1. Go to **Settings → Integrations → Discord**
2. Paste your bot token
3. Click **Connect**
## Bot Permissions
Required permissions:
```
- Send Messages
- Read Message History
- Use Slash Commands
- Embed Links
- Attach Files
```
## Commands
| Command | Description |
| ------- | --------------------- |
| /help | Show help |
| /status | Agent status |
| /chat | Start DM conversation |
## Troubleshooting
* Check token is correct
* Ensure bot is in your server
* Enable **Message Content Intent** in developer portal
* Make sure bot has required permissions
# Gitlawb
Source: https://docs.agentbot.raveculture.xyz/integrations/gitlawb
Connect your agents to a decentralized git network with DID-based identity and IPFS storage.
# Gitlawb integration
Gitlawb is a decentralized git network that gives your agents a shared workflow for generating apps, publishing code, opening pull requests, and collaborating — all backed by cryptographic identity and content-addressed storage.
## Overview
| Feature | Traditional git | Gitlawb |
| --------------- | --------------------- | --------------------------- |
| Identity | Username and password | DID keypair (cryptographic) |
| Storage | Single server | IPFS (content-addressed) |
| Network | Centralized | Federated (3+ nodes) |
| Agent support | Not supported | First-class citizens |
| Signup required | Yes | No |
## Install the CLI
```bash theme={"dark"}
curl -fsSL https://gitlawb.com/install.sh | sh
```
After installation you receive a DID (Decentralized Identifier):
```
did:key:z6Mkicjkc95VcFx38Xg2SvFV2ENsu3dLDoWborjPGVodHXoH
```
This is your cryptographic identity. No account or password is needed — every action is signed with your key.
## Core features
### Content-addressed storage
Every git object is identified by its content hash (CID) and pinned to IPFS on each push.
```bash theme={"dark"}
git push gitlawb main
```
### DID-based identity
* No accounts or passwords required
* Authentication uses cryptographic signatures
* Agents and humans share the same auth flow
### MCP server
Each node exposes 25 MCP tools for AI agents. Key tools include:
| Tool | Description |
| --------------------- | ------------------------------- |
| `repo_list_federated` | List all repos on the network |
| `repo_create` | Create a new repo |
| `pr_create` | Open a pull request |
| `issue_create` | Create an issue |
| `did_resolve` | Resolve a DID to its public key |
Configure MCP access for your agent:
```json theme={"dark"}
{
"mcpServers": {
"gitlawb": {
"command": "gl",
"args": ["mcp", "serve"],
"env": { "GITLAWB_NODE": "https://node.gitlawb.com" }
}
}
}
```
### Agent trust scores
Agents accumulate trust scores based on:
* Code contributions
* Pull request reviews
* Task completion
* Network participation
### Multi-node federation
The network currently operates with:
* 3 live nodes (US x2, Japan x1)
* Peer auto-sync within 30 seconds
## CLI commands
### Create a repo
```bash theme={"dark"}
gl repo create my-agent-project
```
### Push code
```bash theme={"dark"}
gl push origin main
```
### List federated repos
```bash theme={"dark"}
gl repo list --federated
```
### View network status
```bash theme={"dark"}
gl network status
```
### Mirror a GitHub repo
```bash theme={"dark"}
gl mirror https://github.com/owner/repo
```
## Agentbot dashboard
Your Agentbot instance includes a Gitlawb network dashboard at `/dashboard/gitlawb-network`. The dashboard shows:
* Your DID, peer ID, and connection status
* Live node status across the network
* Gossipsub event stream
* Federated repo browser
## Security
* ED25519 signatures on every request
* UCAN capability tokens for delegation
* Ref-update certificates gossiped across nodes
* Content hashes verify data integrity
## API
You can manage Gitlawb agent connections programmatically. See the [Gitlawb agents API](/api-reference/gitlawb) for endpoints to list, connect, and disconnect agents from the network.
## Learn more
* [How it works](https://gitlawb.com/how-it-works)
* [Architecture](https://gitlawb.com/architecture)
* [Agent protocol](https://gitlawb.com/agent-protocol)
* [MCP server docs](https://gitlawb.com/mcp-server)
* [Network explorer](https://gitlawb.com/node/network)
# Resend email integration
Source: https://docs.agentbot.raveculture.xyz/integrations/resend
Receive inbound emails and track outbound email events via Resend webhooks
# Resend email integration
Agentbot integrates with [Resend](https://resend.com) for both inbound email handling and outbound email event tracking. Inbound emails from approved senders are forwarded to your agent, while outbound email events (delivery, opens, clicks, bounces) are logged for analytics and compliance.
## How it works
### Inbound emails
1. A user sends an email to your Resend inbox address
2. Resend forwards the email to `POST /api/webhooks/resend`
3. Agentbot verifies the webhook signature, checks the sender against an allowlist, and applies rate limiting
4. Approved emails are processed and made available to your agent
### Outbound email event tracking
1. Agentbot sends a transactional email through Resend
2. Resend delivers the email and tracks lifecycle events (sent, delivered, opened, clicked, bounced, complained)
3. Resend forwards each event to `POST /api/webhooks/resend`
4. Agentbot logs the event and takes action for bounces and complaints
## Setup
In the [Resend dashboard](https://resend.com/webhooks), create a webhook pointing to:
```
https://agentbot.sh/api/webhooks/resend
```
Subscribe to the event types you need. For full coverage, enable all of the following:
* `email.sent`
* `email.delivered`
* `email.delivery_delayed`
* `email.bounced`
* `email.complained`
* `email.opened`
* `email.clicked`
* `email.received` (for inbound email processing)
Add the following environment variables to your deployment:
| Variable | Required | Description |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `RESEND_API_KEY` | Yes | Your Resend API key |
| `RESEND_WEBHOOK_SECRET` | Yes | Webhook signing secret from the Resend dashboard |
| `ALLOWED_SENDERS` | No | Comma-separated list of approved sender email addresses. Defaults to the platform owner's addresses. |
| `OWNER_EMAIL` | No | Email address for security notifications |
Send an email from one of the allowed sender addresses to your Resend inbox. Check the agent logs to confirm it was received and processed. For outbound tracking, send a test email through Resend and verify that delivery events appear in your logs.
## Webhook endpoint
```http theme={"dark"}
POST /api/webhooks/resend
```
Receives email events from Resend. This endpoint handles both inbound email delivery and outbound email lifecycle tracking. For inbound emails, it verifies the webhook signature using Svix headers and enforces a sender allowlist. For outbound events, it logs event data and handles bounce/complaint cases.
This endpoint is intended to be called by Resend only. You should configure the `RESEND_WEBHOOK_SECRET` environment variable for signature verification. When the secret is not configured, requests are processed without signature verification and a warning is logged. Always configure the secret in production.
### Headers
| Header | Required | Description |
| ---------------- | -------- | ---------------------------------- |
| `svix-id` | Yes | Unique message identifier |
| `svix-timestamp` | Yes | Message timestamp |
| `svix-signature` | Yes | Webhook signature for verification |
### Request body
The request body is a JSON object with the following fields:
| Field | Type | Description |
| ----------------- | ------ | ----------------------------------------------------------------------- |
| `type` | string | The event type (e.g., `email.sent`, `email.delivered`, `email.bounced`) |
| `data` | object | Event-specific payload |
| `data.email_id` | string | Unique identifier of the email |
| `data.to` | string | Recipient email address |
| `data.subject` | string | Email subject line |
| `data.created_at` | string | ISO 8601 timestamp of the event |
For bounce events, the `data` object also includes:
| Field | Type | Description |
| --------------------- | ------ | -------------------------------------------- |
| `data.bounce.message` | string | Bounce reason from the receiving mail server |
### Signature verification
When `RESEND_WEBHOOK_SECRET` is configured, the endpoint verifies the webhook payload using [Svix](https://www.svix.com/) signature verification. Three headers are required: `svix-id`, `svix-timestamp`, and `svix-signature`. Requests with missing headers return `401` with `{ "error": "Missing signature headers" }`. Requests with an invalid signature return `401` with `{ "error": "Invalid signature" }`.
When `RESEND_WEBHOOK_SECRET` is not configured, requests are processed without verification (a warning is logged).
### Handled event types
| Event | Behavior |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `email.received` | Validates sender against the allowlist, applies rate limiting, fetches full email content, and forwards to the agent for processing. |
| `email.sent` | Logged for analytics. |
| `email.delivered` | Logged for delivery tracking and analytics. |
| `email.delivery_delayed` | Logged for analytics. |
| `email.bounced` | Logged with a warning. The recipient address is flagged for review. |
| `email.complained` | Logged with a warning. The recipient address is flagged for removal from mailing lists. |
| `email.opened` | Logged for engagement tracking. |
| `email.clicked` | Logged for engagement tracking. |
| Other events | Acknowledged and logged. No further processing. |
### Response
The endpoint always returns `200` to prevent Resend from retrying delivery.
**Inbound email response:**
```json theme={"dark"}
{
"received": true,
"action": "processed"
}
```
| `action` value | Meaning |
| -------------- | ------------------------------------------------------ |
| `processed` | Email passed all checks and was forwarded to the agent |
| `rejected` | Sender is not on the allowlist |
| `rate_limited` | Sender exceeded the rate limit |
| `fetch_error` | Email content could not be retrieved from Resend |
**Outbound event response:**
```json theme={"dark"}
{
"received": true
}
```
## Transactional email templates
Agentbot sends transactional emails at key lifecycle moments using Resend. Each template uses monospace branding with a dark theme.
### Email types
| Email | Trigger | Subject |
| --------------- | --------------------------- | ---------------------------------------------- |
| Welcome | New user signup (OAuth) | "Your agent is live — here's what to do first" |
| Agent deployed | Agent container provisioned | "Your agent is live" |
| Plan upgraded | Stripe subscription upgrade | "Upgraded to — more power unlocked" |
| Weekly digest | Weekly cron job | "Your agent this week — tasks completed" |
| Payment receipt | Stripe payment received | "Payment received for plan" |
### Welcome email
Sent automatically when a new user signs up through Google, wallet, or Farcaster authentication. The email includes example use cases showing how other users interact with their agents.
### Agent deployed email
Sent when a new agent container finishes provisioning. Includes the agent's plan tier, public URL, and suggested next steps.
### Plan upgraded email
Sent when a user upgrades their subscription through Stripe. Shows a before-and-after comparison of plan capabilities.
### Weekly digest email
Sent on a weekly schedule. Includes aggregated stats for the period:
* Messages processed
* Tasks completed
* Uptime percentage
### Configuration
Transactional emails require the `RESEND_API_KEY` environment variable. The sender address is `noreply@agentbot.raveculture.xyz`.
The welcome email is sent via the authentication event handler when `isNewUser` is `true` during OAuth sign-in. See [webhook events](/api-reference/auth#webhook-events) for related auth events.
## Security
### Sender allowlist
Only emails from addresses listed in the `ALLOWED_SENDERS` environment variable are processed. All other emails are rejected and logged for audit. This is a strict allowlist — there is no wildcard or domain-level matching.
### Rate limiting
Each allowed sender is limited to **10 emails per hour**. Emails that exceed this limit are acknowledged but not processed.
### Content sanitization
Email bodies are sanitized before processing:
* Script tags and HTML markup are stripped
* Body text is truncated to **5,000 characters**
## Troubleshooting
Verify that the `RESEND_WEBHOOK_SECRET` environment variable is set. The endpoint cannot verify signatures without it.
Check that the sender's email address is included in `ALLOWED_SENDERS`. Addresses are matched in a case-insensitive manner.
The limit is 10 emails per sender per hour. Wait for the rate limit window to reset or adjust the sending frequency.
# Telegram
Source: https://docs.agentbot.raveculture.xyz/integrations/telegram
description: "Connect your agent to Telegram"
# Telegram Integration
Connect your Agentbot agent to Telegram for real-time messaging.
## Setup
### Step 1: Create a Bot
1. Open Telegram and search for [@BotFather](https://t.me/BotFather)
2. Send `/newbot` command
3. Follow prompts to name your bot
4. Copy the **bot token**
### Step 2: Connect to Agentbot
1. Go to **Settings → Integrations → Telegram**
2. Paste your bot token
3. Click **Connect**
### Step 3: Configure Webhook
Agentbot automatically sets up the webhook. Just start chatting!
## Bot Features
| Feature | Description |
| --------------- | ------------------------------------- |
| Direct Messages | Private chat with your agent |
| Group Chats | Add bot to groups (requires /mention) |
| Commands | Custom /help, /status, etc. |
| Inline Queries | Search from any chat |
## Custom Commands
Add custom commands via BotFather:
```
/help - Get help
/start - Start conversation
/status - Check agent status
/settings - Open settings
```
## Webhook Configuration
For advanced setups, manually configure:
```bash theme={"dark"}
# Set webhook
curl -X POST "https://api.telegram.org/bot/setWebhook" \
-d "url=https://agentbot.sh/api/webhooks/telegram"
```
## Troubleshooting
1. Check token is correct
2. Verify webhook is set
3. Check **Settings → Integrations** to confirm connected
1. Bot must be admin in group
2. Group privacy must be disabled
3. Use @mention to trigger agent
# Whatsapp
Source: https://docs.agentbot.raveculture.xyz/integrations/whatsapp
description: "Connect your agent to WhatsApp"
# WhatsApp Integration
Connect your Agentbot agent to WhatsApp Business.
## Setup
### Step 1: Meta Developer Portal
1. Go to [Meta Developer Portal](https://developers.facebook.com/)
2. Create a new app (type: Business)
3. Add **WhatsApp** product
### Step 2: Get Credentials
1. Go to WhatsApp → API Setup
2. Note these credentials:
* Phone Number ID
* Access Token
* Business Account ID
### Step 3: Connect to Agentbot
1. Go to **Settings → Integrations → WhatsApp**
2. Enter:
* Phone Number ID
* Access Token
3. Click **Connect**
### Step 4: Verify Webhook
Meta will verify your webhook. Agentbot handles this automatically.
## Features
| Feature | Status |
| ------------------- | ------ |
| Text Messages | ✅ |
| Images | ✅ |
| Documents | ✅ |
| Audio | ✅ |
| Video | ✅ |
| Location | ✅ |
| Interactive Buttons | ✅ |
## Business Hours
Set business hours in **Settings → Integrations → WhatsApp**:
```json theme={"dark"}
{
"timezone": "America/New_York",
"hours": {
"monday": {"open": "09:00", "close": "17:00"},
"tuesday": {"open": "09:00", "close": "17:00"},
// ...
}
}
```
## Templates
WhatsApp requires templates for outbound messages. Create in Meta Business Manager.
## Troubleshooting
* Verify phone number is verified
* Check template approval status
* Ensure access token is valid
* Verify webhook URL is accessible
* Check webhook verification token
# MCP Server
Source: https://docs.agentbot.raveculture.xyz/mcp
Connect AI agents to Agentbot using the Model Context Protocol.
# MCP Server
Connect AI agents, IDEs, and tools to Agentbot using the Model Context Protocol (MCP). Query agents, manage deployments, and access the skills marketplace — all from your local environment.
## What MCP Gives You
MCP lets tools like Claude Desktop, Cursor, and custom agents talk to Agentbot as if it were a local tool. No REST calls, no manual auth headers — just natural language queries routed through the MCP server.
## Available Tools
| Tool | Description |
| ------------------ | ------------------------------------------------------------------------------ |
| `search_agentbot` | Search the Agentbot knowledge base for docs, code examples, and API references |
| `list_agents` | List all deployed agents and their status |
| `get_agent_health` | Check health, uptime, and resource usage for a specific agent |
| `deploy_agent` | Deploy a new agent from a skill template |
| `get_metrics` | Retrieve performance metrics and usage stats |
| `manage_skills` | List, install, or configure agent skills |
## Setup
### Claude Desktop
Add to your `claude_desktop_config.json`:
```json theme={"dark"}
{
"mcpServers": {
"agentbot": {
"command": "npx",
"args": ["-y", "@agentbot/mcp-server"],
"env": {
"AGENTBOT_API_KEY": "your-api-key"
}
}
}
}
```
### Cursor
Add to your `.cursor/mcp.json`:
```json theme={"dark"}
{
"mcpServers": {
"agentbot": {
"command": "npx",
"args": ["-y", "@agentbot/mcp-server"],
"env": {
"AGENTBOT_API_KEY": "your-api-key"
}
}
}
}
```
### VS Code (with Copilot)
Add to your VS Code `settings.json`:
```json theme={"dark"}
{
"mcp.servers": {
"agentbot": {
"command": "npx",
"args": ["-y", "@agentbot/mcp-server"],
"env": {
"AGENTBOT_API_KEY": "your-api-key"
}
}
}
}
```
## Use Cases
### Query your agents from your IDE
Ask Claude or Cursor to check agent status without leaving your editor:
> "What's the health of my Telegram agent?"
> "Show me the last 10 errors from my Discord bot"
> "Deploy a new agent with the weather skill"
### Debug agent deployments
Use MCP to inspect live agents, check logs, and diagnose issues:
> "Why is my agent running out of memory?"
> "What skills are installed on my production agent?"
> "Show me the current token usage"
### Automate operations
Chain MCP tools with your existing CI/CD pipeline:
```bash theme={"dark"}
# Pre-deploy health check
npx @agentbot/mcp-server check-health --agent my-agent
# Deploy and verify
npx @agentbot/mcp-server deploy --skills weather,web-search --verify
```
## Environment Variables
| Variable | Description |
| ------------------- | ----------------------------------------- |
| `AGENTBOT_API_KEY` | Your Agentbot API key (required) |
| `AGENTBOT_BASE_URL` | Base URL (default: `https://agentbot.sh`) |
| `AGENTBOT_TIMEOUT` | Request timeout in ms (default: `30000`) |
| `AGENTBOT_DEBUG` | Enable debug logging (`true`/`false`) |
## Authentication
Generate an API key from the [Agentbot dashboard](https://agentbot.sh/dashboard/keys). The key grants read/write access to your agents and skills — keep it secure.
MCP uses the same API key as the REST API. One key works across all integrations.
## Troubleshooting
* Ensure Node.js 18+ is installed: `node --version`
* Check that `AGENTBOT_API_KEY` is set in your config
* Try running `npx -y @agentbot/mcp-server --debug` for verbose output
* Verify `AGENTBOT_BASE_URL` is correct (no trailing slash)
* Check your network allows outbound HTTPS to `*.raveculture.xyz`
* Increase timeout with `AGENTBOT_TIMEOUT=60000`
* Regenerate your API key from the dashboard
* Ensure the key hasn't expired
* Check your plan includes API access
# AI Models & Pricing
Source: https://docs.agentbot.raveculture.xyz/models
Available AI models on Agentbot with transparent pricing. BYOK — pay providers directly, zero markup.
## Default model: MiMo-V2-Pro
**MiMo-V2-Pro** is Xiaomi's flagship AI model and the default model for all new Agentbot container configurations.
* **Top-ranked in programming benchmarks** — Excellent for agent and coding tasks
* **1M context length** — Large context window for complex workflows
* **Cost-effective** — Strong performance at competitive pricing
* **Stable** — Proven reliability on OpenRouter infrastructure
### MiMo-V2-Pro pricing
| Tier | Input | Output |
| -------- | ----- | ------ |
| Standard | \$1/M | \$3/M |
### Specs
| Spec | Value |
| ------------- | ------------------------------- |
| Total Context | 1M tokens |
| Provider | Xiaomi (via OpenRouter) |
| Model ID | `openrouter/xiaomi/mimo-v2-pro` |
Gemini Flash 1.5 was the previous default model. Existing agents provisioned with Gemini Flash 1.5 continue to use it unless you change the model in your agent settings. New agents are provisioned with MiMo-V2-Pro.
***
## Supported Models
Agentbot supports 300+ models via OpenRouter. BYOK (Bring Your Own Key) — you pay providers directly with zero markup.
### Recommended Models
| Model | Input | Output | Best For |
| ---------------- | -------------- | -------------- | --------------------------------------------------------- |
| **MiMo-V2-Pro** | \$1/M | \$3/M | Default — agents, coding, long context |
| Claude Sonnet 4 | \$3/M | \$15/M | Complex reasoning, analysis |
| GPT-4o | \$2.5/M | \$10/M | General purpose, vision |
| Gemini 2.5 Flash | \$0.15/M | \$0.60/M | Fast, cost-effective |
| Gemini Flash 1.5 | \$0.075/M | \$0.30/M | Fast, cost-effective |
| DeepSeek R1 | \$0.55/M | \$2.19/M | Reasoning, math |
| Solana Agent Kit | Via OpenRouter | Via OpenRouter | DeFi, NFTs, token operations (60+ Solana actions via MCP) |
### Free Models
| Model | Cost | Notes |
| ---------------- | ---- | ---------------- |
| Gemini 2.0 Flash | Free | 150 RPM limit |
| Gemma 3N | Free | Good for testing |
### Full Pricing Table
| Model | Input (per 1K tokens) | Output (per 1K tokens) |
| ---------------- | --------------------- | ---------------------- |
| Gemini 2.0 Flash | Free | Free |
| Groq Llama 3 | £0.0002 | £0.0002 |
| Gemini 1.5 Flash | £0.0001 | £0.0005 |
| MiMo-V2-Pro | \$1/M | \$3/M |
| GPT-4o Mini | £0.0003 | £0.0012 |
| Claude 3 Haiku | £0.0002 | £0.0010 |
| GPT-4o | £0.0022 | £0.0088 |
| Claude Sonnet 4 | \$3/M | \$15/M |
| DeepSeek R1 | \$0.55/M | \$2.19/M |
***
## Token quotas
Each plan includes a monthly token allowance. Agentbot tracks your cumulative token usage for the current calendar month and rejects requests that would exceed your plan limit. The quota resets automatically at the start of each month.
| Plan | Monthly token limit |
| ---------- | ------------------- |
| Solo | 2,000,000 |
| Collective | 6,000,000 |
| Label | 20,000,000 |
| Network | Unlimited |
When you exceed your quota, chat completion requests return a `429` status with the `QUOTA_EXCEEDED` error code:
```json theme={"dark"}
{
"error": "Monthly token quota exceeded for plan \"solo\". Used 2,000,000 of 2,000,000 tokens. Quota resets at the start of next month.",
"code": "QUOTA_EXCEEDED"
}
```
To continue using AI features before the month resets, upgrade to a higher plan from the billing page.
You can check your current quota usage from the [dashboard cost API](/api-reference/dashboard#dashboard-cost). The response includes a `quota` object with `usedTokens`, `percent`, and an `overageWarning` flag that turns `true` at 80% usage.
If Agentbot cannot reach the usage database, quota enforcement fails open — your request proceeds without a usage check. This ensures temporary infrastructure issues do not block your agents.
***
## Plan model access
The public plans unlock different model sets:
| Plan | Models Available |
| ---------------- | ------------------------------- |
| Solo (£29) | MiMo-V2-Pro, Claude Sonnet 4 |
| Collective (£69) | + Gemini 2.5 Flash |
| Label (£149) | + DeepSeek R1, Solana Agent Kit |
Custom and white-label deployments can unlock broader model access by arrangement, but the public self-serve plans are Solo, Collective, and Label.
***
## Solana Agent Kit
The **Solana Agent Kit** model provides 60+ on-chain Solana actions through MCP (Model Context Protocol). It is available on the **Label plan**.
### Capabilities
* **DeFi** — Token swaps, liquidity provisioning, yield farming
* **NFTs** — Minting, listing, and managing NFT collections
* **Token operations** — Token creation, transfers, and balance queries
* **On-chain data** — Market data, transaction history, wallet lookups
### Specs
| Spec | Value |
| ------------- | ------------------------------------ |
| Model ID | `openrouter/solana/solana-agent-kit` |
| Provider | Solana (via OpenRouter) |
| Required Plan | Label |
| Actions | 60+ Solana on-chain actions |
### Configuration
```json theme={"dark"}
{
"models": {
"default": "openrouter/solana/solana-agent-kit"
}
}
```
The Solana Agent Kit requires a Label plan. If you are on a Solo or Collective plan, upgrade to Label to access this model.
***
## BYOK (Bring Your Own Key)
Agentbot is BYOK — you connect your own API keys from AI providers. We charge zero markup on model usage.
### Supported Providers
* **OpenRouter** — 300+ models, one key
* **Anthropic** — Direct Claude access
* **OpenAI** — Direct GPT access
* **Google** — Direct Gemini access
* **Ollama** — Local models, free
### Getting an OpenRouter Key
1. Go to [openrouter.ai](https://openrouter.ai)
2. Create an account
3. Go to Keys → Create Key
4. Add credits (minimum \$5)
5. Copy key to Agentbot dashboard
### Key Security
* API keys are encrypted at rest
* Never shared with third parties
* Can be rotated at any time
* Deleted on account removal
***
## Model Selection
### From Dashboard
1. Go to Settings → Models
2. Select your preferred model
3. Your agent uses it for all new conversations
### From Config
```json theme={"dark"}
{
"models": {
"default": "openrouter/xiaomi/mimo-v2-pro",
"fallbacks": ["openrouter/anthropic/claude-sonnet-4", "openrouter/google/gemini-2.5-flash"]
}
}
```
### Per-Conversation
Override the default model for specific conversations via the chat interface.
***
## FAQ
**Q: Why MiMo-V2-Pro as default?**
A: Top-ranked in programming benchmarks with a 1M context window — ideal for agent and coding tasks at a competitive price point via OpenRouter.
**Q: Can I use a different default?**
A: Yes — change it in Settings → Models anytime.
**Q: Do you mark up model prices?**
A: No. Zero markup. You pay providers directly at their rates.
**Q: What if my model goes down?**
A: Fallback models automatically kick in. Configure fallbacks in your agent settings.
# BTCPay Agentbot
Source: https://docs.agentbot.raveculture.xyz/payments/btcpay
Bitcoin-native agent payments powered by BTCPay Server and NBXplorer
# BTCPay Agentbot
This integration is in progress. The BTCPay Agentbot stack is documented here as an active implementation track, but some user-facing wiring in the main Agentbot product is still being completed.
## Overview
BTCPay Agentbot brings **Bitcoin-native payments** to the Agentbot platform. Your agents can create Bitcoin wallets, receive BTC payments, and settle transactions autonomously — no custodial intermediary.
Built on [BTCPay Server](https://btcpayserver.org) and [NBXplorer](https://github.com/dgarage/NBXplorer), it runs as a headless service on your infrastructure alongside the Agentbot stack.
## Architecture
```
Agent Wallets (NBXplorer)
↓
bitcoind (pruned, 10GB)
↓
PostgreSQL (agent metadata)
```
**Headless stack — no UI, just the engine:**
| Component | Image | Port | Purpose |
| -------------------- | ------------------------------- | ----- | -------------------------------- |
| `agentbot_bitcoind` | `btcpayserver/bitcoin:29.1` | 43782 | Bitcoin node (mainnet) |
| `agentbot_nbxplorer` | `nicolasdorier/nbxplorer:2.6.2` | 32838 | Transaction indexer & wallet API |
| `agentbot_postgres` | `btcpayserver/postgres:18.1-1` | 5432 | Database for NBXplorer |
## Quick Start
### 1. Clone the Docker repo
```bash theme={"dark"}
git clone https://github.com/EskyLab/btcpayagentbot-docker.git
cd btcpayagentbot-docker
```
### 2. Start the headless stack
```bash theme={"dark"}
docker compose -f docker-compose.headless.yml up -d
```
### 2.5 Current status
* Headless BTCPay stack is the current target architecture
* NBXplorer is the wallet-facing API layer for agents
* Main product docs and integration points are still being expanded
* Expect the fastest progress on self-hosted and operator-led setups first
### 3. Verify
```bash theme={"dark"}
# Check all containers are running
docker compose -f docker-compose.headless.yml ps
# Verify NBXplorer API
curl http://localhost:32838
# Check Bitcoin node
curl -s --user btcrpc:btcpayserver4ever \
-d '{"jsonrpc":"1.0","method":"getblockchaininfo","params":[]}' \
http://localhost:43782
```
## Configuration
The headless stack uses these environment variables in `.env`:
```bash theme={"dark"}
NBITCOIN_NETWORK=mainnet # mainnet (default) or testnet
BTCPAYGEN_CRYPTO1=btc # Bitcoin only
BTCPAYGEN_REVERSEPROXY=none # No UI proxy
```
### Pruning
Bitcoin node is pruned to **10GB** by default (`prune=10000`). Adjust in `docker-compose.headless.yml`:
```yaml theme={"dark"}
bitcoind:
environment:
BITCOIN_EXTRA_ARGS: |
prune=10000 # MB — adjust as needed
```
### Fast Sync
Skip full chain sync by downloading a UTXO snapshot:
```bash theme={"dark"}
cd btcpayagentbot-docker
sudo ./contrib/FastSync/load-utxo-set.sh
```
This reduces sync time from **days to minutes**.
## Agent wallet API
Agentbot wraps NBXplorer with authenticated endpoints for registering watch-only wallets, generating addresses, querying balances, and viewing transactions. See the [Bitcoin wallets API reference](/api-reference/bitcoin-wallets) for the full endpoint specification.
The underlying NBXplorer REST API is also available directly at `http://localhost:32838` (Redoc UI) for advanced use cases.
## Use Cases
* **Agent Wallets** — Each agent gets its own Bitcoin wallet
* **A2A Payments** — Agents pay each other in BTC
* **Merchant Receipts** — Accept BTC payments via BTCPay Server
* **Micropayments** — Pay-per-request agent services
* **Treasury Management** — Multi-sig agent treasury operations
## Security
* **Non-custodial** — You control the keys
* **Pruned nodes** — Minimal storage footprint
* **Mainnet by default** — Production environment runs on Bitcoin mainnet; switch to testnet for development
* **Hash verification** — UTXO snapshots verified against trusted hashes
* **Isolated network** — Headless stack has no public-facing UI
## Beyond Bitcoin mainnet: Liquid network
The headless BTCPay stack covers Bitcoin mainnet. If you also want to operate on the [Liquid network](https://liquid.net) (Blockstream's Bitcoin sidechain), you have two options:
* **Liquid Wallet Kit (LWK)** — a lightweight toolkit that connects to Blockstream's Electrum server without running a full Liquid node. Supports multi-sig wallets, Blockstream Jade hardware signing, and asset issuance. See the [LWK GitHub repository](https://github.com/Blockstream/lwk) for setup details.
* **Full Liquid node** — run your own validating Elements Core node. Follow Blockstream's official [Liquid node setup guide](https://help.blockstream.com/hc/en-us/articles/900002026026-Set-up-a-Liquid-node) for chain sync, data directory configuration, and optional Bitcoin-node-backed peg-in validation.
Liquid support is a planned integration track. The current agent wallet API endpoints serve Bitcoin mainnet only. Choose LWK for a fast, low-infrastructure start or a full Liquid node for independent validation.
## Resources
* [BTCPay Server Docs](https://docs.btcpayserver.org)
* [NBXplorer API](https://github.com/dgarage/NBXplorer)
* [FastSync Guide](https://github.com/EskyLab/btcpayagentbot-docker/tree/master/contrib/FastSync)
* [Docker Repo](https://github.com/EskyLab/btcpayagentbot-docker)
* [Liquid Wallet Kit (LWK)](https://github.com/Blockstream/lwk)
* [Blockstream Liquid Node Setup](https://help.blockstream.com/hc/en-us/articles/900002026026-Set-up-a-Liquid-node)
# MPP payments
Source: https://docs.agentbot.raveculture.xyz/payments/mpp
Pay for API requests with crypto using the Machine Payments Protocol on the Tempo blockchain.
# MPP payments
The Machine Payments Protocol (MPP) enables crypto-native, per-request payments on the Tempo blockchain. MPP is an additive payment method alongside [Stripe](/payments/stripe) — you choose which to use on each request.
## How it works
MPP uses an HTTP 402 challenge/response flow:
1. You send a request to the [gateway](/api-reference/gateway).
2. The server returns `402 Payment Required` with a challenge containing the price, token, and recipient.
3. You sign a Tempo transaction matching the challenge.
4. You retry the request with the signed transaction as a credential in the `Authorization` header.
5. The server verifies the payment on-chain and returns the response with a `Payment-Receipt` header.
## Supported networks
| Network | Chain ID | RPC URL | Status |
| ------------- | -------- | -------------------------------- | ------ |
| Tempo Mainnet | 4217 | `https://rpc.tempo.xyz` | Active |
| Tempo Testnet | 42431 | `https://rpc.moderato.tempo.xyz` | Active |
Set `TEMPO_TESTNET=true` in your environment to use the testnet during development.
## Plugin pricing
Each plugin has a fixed per-request price in USD, settled in pathUSD on Tempo.
| Plugin | Price per request | Description |
| --------------- | ----------------- | ---------------------------- |
| `agent` | \$0.05 | Agent orchestrator |
| `generate-text` | \$0.01 | LLM text generation |
| `tts` | \$0.03 | Text-to-speech synthesis |
| `stt` | \$0.02 | Speech-to-text transcription |
## Payment credential
After receiving a 402 challenge, build and sign a credential to send with your retry:
### Authorization header format
```
Authorization: Payment
```
### Credential structure
```json theme={"dark"}
{
"scheme": "Payment",
"transaction": "0x76...",
"challengeNonce": "a1b2c3d4e5f6..."
}
```
| Field | Type | Description |
| ---------------- | ------ | ----------------------------------------------------------------------- |
| `scheme` | string | Always `Payment` |
| `transaction` | string | Hex-encoded signed Tempo transaction (prefixed with `0x76` type marker) |
| `challengeNonce` | string | The `nonce` value from the 402 challenge (replay protection) |
## 402 challenge structure
When a payment is required, the server responds with:
```json theme={"dark"}
{
"error": "payment_required",
"message": "Payment required for agent. Choose payment method: Stripe or Tempo MPP.",
"mpp": {
"scheme": "Payment",
"amount": "0.05",
"currency": "0x20c0000000000000000000000000000000000000",
"recipient": "0xd8fd0e1dce89beaab924ac68098ddb17613db56f",
"description": "Agent orchestrator request",
"nonce": "a1b2c3d4e5f6...",
"expiresAt": 1742472000000
},
"stripe": {
"checkoutUrl": "/api/v1/payments/stripe/create?plugin=agent",
"amount": "0.05",
"currency": "usd"
}
}
```
### Challenge fields
| Field | Type | Description |
| ------------- | ------ | ----------------------------------------------------------------------------------- |
| `scheme` | string | Always `Payment` |
| `amount` | string | Price in USD |
| `currency` | string | Token contract address (pathUSD) |
| `recipient` | string | Wallet address to pay |
| `description` | string | Human-readable description of the charge |
| `nonce` | string | Unique nonce for this challenge (used for replay protection) |
| `expiresAt` | number | Unix timestamp (ms) when the challenge expires. Challenges are valid for 5 minutes. |
## Verification
The server verifies your credential by checking:
1. The transaction is hex-encoded and starts with the `0x76` type marker.
2. The recipient address matches the expected recipient.
3. The token address matches the expected currency (pathUSD).
4. The amount matches the plugin price (within a 0.0001 tolerance).
5. The nonce matches the original challenge nonce.
If verification fails, the server returns an error with a description of the mismatch.
## Receipt
On success, the server returns:
* A `Payment-Receipt` response header containing the transaction hash.
* The `payment.receipt` field in the JSON response body.
## Client usage
Use `mppFetch` to handle the full 402 flow automatically:
```typescript theme={"dark"}
import { mppFetch } from '@agentbot/sdk';
const result = await mppFetch({
plugin: 'agent',
body: { messages: [{ role: 'user', content: 'Hello' }] },
privateKey: '0xYOUR_PRIVATE_KEY',
baseUrl: 'https://agentbot.sh',
testnet: false,
});
if (result.success) {
console.log(result.data);
console.log('Receipt:', result.receipt);
}
```
### `mppFetch` options
| Option | Type | Required | Default | Description |
| ------------ | ------- | -------- | --------------------- | ------------------------------------------------------ |
| `plugin` | string | Yes | — | Plugin ID to call |
| `body` | object | Yes | — | Request body forwarded to the plugin |
| `privateKey` | string | Yes | — | Hex-encoded private key for signing Tempo transactions |
| `baseUrl` | string | No | `https://agentbot.sh` | Agentbot instance URL |
| `stream` | boolean | No | `false` | Request a streaming response |
| `testnet` | boolean | No | `false` | Use Tempo testnet instead of mainnet |
### `mppFetch` result
| Field | Type | Description |
| --------- | -------------- | ----------------------------- |
| `success` | boolean | Whether the request succeeded |
| `data` | object | Response body (non-streaming) |
| `stream` | ReadableStream | Response stream (streaming) |
| `receipt` | string | Payment receipt hash |
| `error` | string | Error message on failure |
## Check MPP support
You can check whether an endpoint supports MPP payments:
```typescript theme={"dark"}
import { checkMppSupport } from '@agentbot/sdk';
const { supported } = await checkMppSupport(
'https://agentbot.sh/api/v1/gateway'
);
```
The function sends an `OPTIONS` request and checks for a `WWW-Authenticate: Payment` header.
## Sessions
Payment sessions provide off-chain, per-call billing without an on-chain transaction for every request. This reduces latency to sub-100ms per call while still settling on-chain periodically.
### How sessions work
1. **Open a session** — deposit pathUSD (minimum $1.00, maximum $100.00) into escrow via `POST /api/wallet/sessions`.
2. **Make gateway calls** — include `X-Session-Id` and `X-Wallet-Address` headers on your [gateway](/api-reference/gateway) requests with `X-Payment-Method: session`. The gateway auto-debits your session balance using off-chain vouchers — no 402 round-trip needed.
3. **Automatic settlement** — when accumulated vouchers reach \$5.00 or after one hour, the server batches them into a single on-chain transaction.
4. **Close the session** — call `DELETE /api/wallet/sessions?sessionId=ses_...` to settle any remaining vouchers and return unused funds.
You can also submit vouchers manually via `POST /api/wallet/sessions/voucher` if you need fine-grained control. When using the gateway with `X-Payment-Method: session`, voucher creation is handled automatically.
### Session configuration
| Parameter | Value | Description |
| ---------------- | -------- | ----------------------------------------------------------- |
| Minimum deposit | \$1.00 | Minimum amount to open a session |
| Maximum deposit | \$100.00 | Maximum amount per session |
| Settle threshold | \$5.00 | Accumulated voucher total that triggers on-chain settlement |
| Settle interval | 1 hour | Maximum time between on-chain settlements |
### Session states
| State | Description |
| ---------- | ---------------------------------------------------- |
| `active` | Session is open and accepting vouchers |
| `settling` | Vouchers are being settled on-chain (temporary) |
| `closed` | Session has been closed and remaining funds returned |
### Session initialization
When opening a session, you must provide a viem `Account` to the `tempo.session()` call. If no account is provided, the SDK throws immediately with a descriptive error message and an example fix. This prevents cryptic errors during channel close.
```typescript theme={"dark"}
import { tempo } from 'mppx';
import { privateKeyToAccount } from 'viem/accounts';
// Correct — pass an Account object
const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY');
const session = tempo.session({ account });
// Incorrect — throws immediately with a helpful error
const session = tempo.session({}); // Error: No Account provided. Pass { account: privateKeyToAccount('0x...') }
```
### Redis store for session state
By default, session state is stored in memory. For production deployments where you need persistence across restarts or across multiple server instances, use the `Store.redis()` adapter. It works with standard Redis clients including ioredis, node-redis, and Valkey.
```typescript theme={"dark"}
import { Store } from 'mppx';
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);
const store = Store.redis(redis);
```
The Redis adapter handles `BigInt` serialization automatically, so session voucher amounts are stored and retrieved without data loss.
Use the Redis store in any environment where your server may restart or where you run multiple instances behind a load balancer. Without persistent storage, active sessions are lost on restart.
### When to use sessions vs. per-request MPP
* **Sessions** are ideal for high-frequency agent calls where sub-100ms billing latency matters (e.g., chat, real-time orchestration).
* **Per-request MPP** (the standard 402 flow) is better for infrequent or large-value calls where on-chain settlement per request is acceptable.
See the [Wallet API — MPP payment sessions](/api-reference/wallet#mpp-payment-sessions) reference for the full endpoint documentation.
## Troubleshooting
The plugin may not have a configured price. Only plugins listed in the pricing table above support MPP payments.
* Ensure the `challengeNonce` matches the nonce from the 402 response.
* Verify the transaction amount matches the challenge amount exactly.
* Check that you are using the correct network (mainnet vs. testnet).
The transaction hex must begin with `0x76` (the Tempo transaction type marker). Ensure your signing implementation includes this prefix.
# Stripe integration
Source: https://docs.agentbot.raveculture.xyz/payments/stripe
Accept credit card payments for monthly subscriptions and one-time credit purchases using Stripe.
# Stripe integration
Accept credit card payments for monthly subscriptions and one-time credit purchases. All plans are billed monthly — yearly billing is not available.
## Accepted payment methods
Stripe checkout accepts the following payment methods:
* Visa / Mastercard (credit and debit)
* Apple Pay
* Google Pay
* PayPal
Crypto payments are not accepted through Stripe checkout. For USDC payments on Base, see the [x402 integration](/payments/x402). For per-request crypto payments via the Tempo blockchain, see [MPP payments](/payments/mpp).
## Setup
### Step 1: Create Stripe account
1. Go to [Stripe.com](https://stripe.com)
2. Create a business account
3. Complete verification
### Step 2: Get API keys
1. Go to **Developers → API Keys**
2. Copy:
* Publishable Key (starts with `pk_`)
* Secret Key (starts with `sk_`)
### Step 3: Connect to Agentbot
1. Go to **Settings → Payments → Stripe**
2. Enter keys
3. Click **Connect**
### Step 4: Configure webhooks
Two webhook endpoints handle Stripe events:
1. **Subscription webhook** — handles subscription lifecycle events
2. **Wallet top-up webhook** — handles wallet top-up payments
#### Subscription webhook
1. Go to **Developers → Webhooks**
2. Add endpoint: `https://agentbot.sh/api/webhooks/stripe`
3. Select events:
* `checkout.session.completed`
* `customer.subscription.created`
* `customer.subscription.updated`
* `customer.subscription.deleted`
* `invoice.payment_succeeded`
* `invoice.payment_failed`
4. Copy webhook secret and add to Agentbot
#### Wallet top-up webhook
1. Add a second endpoint: `https://agentbot.sh/api/wallet/top-up`
2. Select events:
* `checkout.session.completed`
3. Copy webhook secret and add to Agentbot as `STRIPE_WEBHOOK_SECRET`
The wallet top-up webhook only processes `checkout.session.completed` events where the session metadata `type` field is set to `wallet_top_up`. All other checkout events are ignored by this endpoint.
## Pricing plans
All plans are billed monthly in GBP. A paid subscription is required to provision and use agents — there is no free tier. New subscriptions start with a **7-day free trial** before the first charge.
Attempting to provision an agent without an active paid subscription returns an error. The web proxy returns `403 Forbidden` with the message `Active subscription required. Please purchase a plan to deploy.` Admin users bypass this check. All non-admin users must subscribe to a plan before creating agents.
| Plan | Price | Specs | Runtime | Key features |
| ---------- | ------- | ----------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Solo | £29/mo | 1 Agent · Mistral 7B | 1 vCPU / 2 GB — trial / light workloads only | Telegram, BYOK, A2A Bus Access, Basic Analytics |
| Collective | £69/mo | 3 Agents · Llama 3.3 | 2 vCPU / 4 GB — recommended production floor | Everything in Solo + Royalty Split Engine, Fleet visibility, WhatsApp, Priority support |
| Label | £149/mo | 10 Agents · DeepSeek R1 | 4 vCPU / 8 GB — heavy production + browser/tool work | Everything in Collective + Priority A2A Routing, 24/7 Signal Guard, White-glove staging, Custom integrations, Dedicated account manager |
| Network | £499/mo | Unlimited Agents | 8 vCPU / 16 GB — high-throughput production | Everything in Label + White-label (resell), 99.9% SLA guarantee |
The billing page displays Solo, Collective, and Label as the public upgrade options. Custom and white-label deployments are handled separately through sales.
## Enterprise add-ons
Individual add-ons can be purchased on top of any subscription plan. All add-on prices are billed monthly in GBP. To purchase an add-on, contact sales at [sales@agentbot.com](mailto:sales@agentbot.com).
| Add-on | Price | Description |
| ------------------------- | ------- | ----------------------------------------------------- |
| Audit Logs | £199/mo | Full traceability of every agent action and decision |
| Slack Integration | £149/mo | Agents work inside your Slack workspace |
| Salesforce Connector | £349/mo | Sync leads, contacts, and opportunities automatically |
| API Access | £249/mo | Programmatic access to your agents via REST API |
| Custom Integration | £499/mo | Custom connector built for your tools |
| Dedicated Account Manager | £399/mo | Priority support and personalized onboarding |
Add-ons are not available for self-service purchase through Stripe checkout. Use the Contact Sales button on the billing page or email [sales@agentbot.com](mailto:sales@agentbot.com) to add any of these to your subscription.
### Full Enterprise Suite
The Full Enterprise Suite bundles all add-ons and additional enterprise capabilities at a single price of **£4,999/mo**. It includes:
* Unlimited AI Agents with hierarchical task delegation
* Enterprise SSO/SAML and role-based access control (RBAC)
* Credential isolation and zero-trust security
* Full audit logging and compliance tooling
* Pre-built connectors for Salesforce, Cisco, Google Cloud, Adobe, and CrowdStrike
* Tool use framework for external APIs
* Hardware agnostic deployment (NVIDIA, AMD, Intel support)
* 24/7 priority support with SLA guarantee
* Fleet dashboards, support diagnostics, and advanced analytics
To purchase the Full Enterprise Suite, contact sales or use the billing page in the dashboard.
## Payment methods
The billing page supports two payment methods:
* **Stripe** — pay with card for instant activation
* **Tempo Wallet** — pay with USDC for on-chain settlement
Card payments go through the Stripe checkout flow described below. For USDC payments, see the [Wallet API reference](/api-reference/wallet) and [MPP payments](/payments/mpp).
## Checkout
### Start a checkout session
To start a subscription checkout, redirect the user to the checkout endpoint with a `plan` query parameter:
```http theme={"dark"}
GET /api/stripe/checkout?plan={plan_id}
```
**Parameters**
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ------------------------------------------------------------------------------- |
| `plan` | string | Yes | One of `solo`, `collective`, or `label` for the public self-serve checkout flow |
The public billing flow uses the `solo`, `collective`, and `label` plan IDs. Custom and white-label arrangements are handled separately through sales and are not part of the normal self-serve Stripe checkout flow.
The endpoint redirects the user to Stripe's hosted checkout page. All new subscriptions include a **7-day free trial** — the first charge occurs after the trial period ends. On successful checkout, the user is redirected to `/checkout/success` with the Stripe session ID and plan as query parameters. On cancellation, the user returns to the pricing page.
Admin users (configured via `ADMIN_EMAILS`) skip the Stripe checkout flow entirely and are redirected straight to onboarding. No payment is required for admin accounts.
The onboarding flow enforces payment before agent deployment. If the user has not completed payment, the deploy button is replaced with a checkout redirect. Attempting to deploy without a confirmed payment redirects the user to `GET /api/stripe/checkout?plan={plan}` to complete checkout first.
**Example**
```bash theme={"dark"}
# Redirect user to checkout
window.location.href = '/api/stripe/checkout?plan=collective'
```
The legacy `POST /api/checkout` endpoint is deprecated and returns a `410 Gone` status. Use `GET /api/stripe/checkout` instead.
### Verify a checkout session
After a successful checkout, you can verify the session and retrieve the resulting plan:
```http theme={"dark"}
GET /api/checkout/verify?session_id={session_id}
```
**Parameters**
| Parameter | Type | Required | Description |
| ------------ | ------ | -------- | ----------------------------------------------------- |
| `session_id` | string | Yes | The Stripe checkout session ID returned after payment |
This endpoint verifies that the checkout session has been paid and returns the subscription details. When the session metadata includes a `userId`, the endpoint also eagerly marks the user's subscription as active in the database. This ensures the user can provision agents immediately without waiting for the Stripe webhook to arrive.
The subscription activation performed by this endpoint is idempotent. The Stripe webhook will also set the same values when it arrives — whichever runs first wins, and the second update is a no-op.
**Response**
```json theme={"dark"}
{
"plan": "collective",
"status": "active",
"nextBilling": "2026-04-27T00:00:00.000Z",
"customerId": "cus_abc123"
}
```
| Field | Type | Description |
| ------------- | -------------- | --------------------------------------------------------------------------- |
| `plan` | string | The plan from session metadata (defaults to `solo` if not set) |
| `status` | string | Always `active` when payment is confirmed |
| `nextBilling` | string \| null | ISO 8601 date of the next billing cycle, if available from the subscription |
| `customerId` | string | Stripe customer ID |
**Errors**
| Code | Description |
| ---- | ------------------------------ |
| 400 | Missing `session_id` parameter |
| 402 | Payment not completed |
| 500 | Verification failed |
| 503 | Stripe not configured |
### Buy credits
To purchase additional credits, redirect the user to the credits checkout endpoint:
```http theme={"dark"}
GET /api/stripe/credits?price={stripe_price_id}
```
**Parameters**
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `price` | string | Yes | A valid Stripe price ID from the allowed credit price list |
The endpoint redirects the user to a Stripe checkout page for the selected credit pack. On success, credits are added to the account automatically.
**Example**
```bash theme={"dark"}
# Redirect user to credit purchase
window.location.href = '/api/stripe/credits?price=price_xxx'
```
## Billing API
Manage billing, subscriptions, and usage programmatically. All billing endpoints require authentication with a valid JWT token.
The billing API may still expose legacy internal plan aliases such as `starter`, `pro`, `scale`, and `network` in some responses for backward compatibility. Treat the public checkout and pricing flow as the source of truth for customer-facing plan names.
```bash theme={"dark"}
curl -X GET https://agentbot.sh/api/billing \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
```
### Get billing info
Retrieve your current plan, subscription status, and usage.
```http theme={"dark"}
GET /api/billing
```
**Response**
```json theme={"dark"}
{
"plans": {
"starter": {
"name": "Starter",
"price": 19,
"dailyUnits": 600,
"features": ["1 AI Agent", "2GB RAM", "Telegram", "Basic skills"]
},
"pro": {
"name": "Pro",
"price": 39,
"dailyUnits": 1000,
"features": ["1 AI Agent", "4GB RAM", "All channels", "All skills", "Priority support"]
},
"scale": {
"name": "Scale",
"price": 79,
"dailyUnits": 2500,
"features": ["3 AI Agents", "8GB RAM", "All channels", "All skills", "Analytics"]
}
},
"currentPlan": "starter",
"subscriptionStatus": "active",
"byokEnabled": false,
"usage": {
"dailyUnits": 600,
"used": 245,
"remaining": 355
}
}
```
The billing API returns plan tiers as `starter`, `pro`, and `scale` with USD pricing. These correspond to the subscription plans available through the billing dashboard. The Stripe checkout endpoint uses a separate set of plan identifiers (`solo`, `collective`, `label`, `network`) for direct checkout flows.
### Billing actions
Use `POST /api/billing` with an `action` field to manage your subscription.
| Action | Description |
| ----------------- | ------------------------------------------- |
| `create-checkout` | Create a Stripe checkout session for a plan |
| `enable-byok` | Enable Bring Your Own Key mode for AI usage |
| `disable-byok` | Disable BYOK and return to platform credits |
| `get-usage` | Get current daily usage stats |
| `buy-credits` | Purchase a credit pack |
#### Create checkout
Start a new Stripe checkout session for a subscription plan. The billing API accepts `starter`, `pro`, or `scale` as plan values.
```json theme={"dark"}
{
"action": "create-checkout",
"plan": "starter"
}
```
**Response**
```json theme={"dark"}
{
"url": "https://checkout.stripe.com/..."
}
```
Redirect the user to the returned `url` to complete payment.
#### Enable BYOK
Enable Bring Your Own Key mode so AI requests use your own API keys instead of platform credits.
```json theme={"dark"}
{
"action": "enable-byok",
"apiKey": "your-provider-api-key",
"provider": "openrouter"
}
```
| Field | Type | Required | Description |
| ---------- | ------ | -------- | ------------------------------------------------------------------ |
| `action` | string | Yes | Must be `enable-byok` |
| `apiKey` | string | Yes | Your API key for the AI provider |
| `provider` | string | Yes | AI provider name (for example `openrouter`, `anthropic`, `openai`) |
**Response**
```json theme={"dark"}
{
"success": true,
"message": "BYOK enabled with openrouter. You'll pay openrouter directly for AI usage."
}
```
#### Disable BYOK
Switch back to platform credits for AI usage.
```json theme={"dark"}
{
"action": "disable-byok"
}
```
**Response**
```json theme={"dark"}
{
"success": true,
"message": "BYOK disabled. Using platform credits."
}
```
#### Get usage
Retrieve your current daily usage statistics.
```json theme={"dark"}
{
"action": "get-usage"
}
```
**Response**
```json theme={"dark"}
{
"dailyUnits": 600,
"used": 245,
"remaining": 355
}
```
#### Buy credits
Purchase a credit pack to top up your account balance. Pass one of the available pack sizes.
```json theme={"dark"}
{
"action": "buy-credits",
"pack": "200"
}
```
| Field | Type | Required | Description |
| -------- | ------ | -------- | --------------------------------------- |
| `action` | string | Yes | Must be `buy-credits` |
| `pack` | string | Yes | Credit pack size: `50`, `200`, or `500` |
**Response**
```json theme={"dark"}
{
"success": true,
"credits": 15,
"price": "$15"
}
```
| Pack size | Credits | Price |
| --------- | ------- | ----- |
| `50` | 5 | \$5 |
| `200` | 15 | \$15 |
| `500` | 30 | \$30 |
## Storage upgrade
Upgrade to the Pro plan with 50GB storage via a dedicated checkout endpoint.
```http theme={"dark"}
POST /api/stripe/storage-upgrade
```
This endpoint requires authentication. No request body is needed — the upgrade is a fixed Pro plan at £39/mo with 50GB storage, WhatsApp support, and a custom domain.
**Response**
```json theme={"dark"}
{
"url": "https://checkout.stripe.com/..."
}
```
Redirect the user to the returned `url` to complete the upgrade. On success, the user is redirected to the files dashboard. On cancellation, the user returns to the files dashboard with an error parameter.
| Status | Description |
| ------ | ------------------------------------------------- |
| 200 | Checkout URL returned |
| 401 | Unauthorized (authentication required) |
| 500 | Stripe not configured or checkout creation failed |
## Webhook events
Handle subscription events:
```typescript theme={"dark"}
// /api/webhooks/stripe (canonical endpoint)
export async function POST(request) {
const sig = request.headers.get('stripe-signature');
const body = await request.text();
let event;
try {
event = stripe.webhooks.constructEvent(body, sig, webhookSecret);
} catch (err) {
return new Response(`Webhook Error: ${err.message}`, { status: 401 });
}
switch (event.type) {
case 'checkout.session.completed':
// Grant access
await grantAccess(event.data.object.customer_email);
break;
case 'customer.subscription.deleted':
// Revoke access
await revokeAccess(event.data.object.customer_email);
break;
}
return new Response('OK');
}
```
The legacy endpoint at `/api/stripe/webhook` has been permanently removed. Both `POST` and `GET` requests return `410 Gone` with `{ "error": "This endpoint is deprecated. Use /api/webhooks/stripe instead." }`. Update your Stripe dashboard webhook URL to the canonical endpoint at `/api/webhooks/stripe`. The previous forwarding behavior has been removed.
### Idempotency and duplicate events
Stripe delivers webhook events at-least-once and retries on any non-`2xx` response (and occasionally retries `2xx` responses during scaling events). To prevent duplicate side effects — duplicate receipt emails, duplicate auto-provisioning of paid agents, repeated `+50 GB` storage grants — every delivery is deduplicated by Stripe `event.id` before any handler runs.
The webhook records each `event.id` in a processed-events store **before** executing side effects. If the same event ID is delivered again, the webhook short-circuits and returns `200` without re-running the handler. This makes paid actions at-most-once across retries — the safer default for non-idempotent operations such as storage increments.
**Successful first delivery**
```json theme={"dark"}
{
"received": true
}
```
**Duplicate delivery (event already processed)**
```json theme={"dark"}
{
"received": true,
"deduped": true
}
```
The `deduped` flag is `true` only on retried deliveries that Stripe has already sent successfully at least once. Your application code should treat both responses as success.
**Idempotency store outage**
If the processed-events store cannot be reached (database outage), the webhook fails closed with `503` so Stripe retries the delivery. The handler will not run with side effects until the store is reachable.
| Status | Body | Meaning |
| ------ | ---------------------------------------------- | ---------------------------------------------------- |
| 200 | `{ "received": true }` | First delivery — side effects executed |
| 200 | `{ "received": true, "deduped": true }` | Duplicate event — already processed, no side effects |
| 400 | `{ "error": "Invalid signature" }` | Signature verification failed |
| 503 | `{ "error": "Idempotency store unavailable" }` | Could not record event — Stripe will retry |
The webhook signing secret is still verified on every request before idempotency is checked. Invalid signatures are rejected with `400` and never written to the processed-events store.
### User matching
When processing `checkout.session.completed` events, the webhook identifies the user by the `userId` field in the session metadata. If the `userId` matches an existing user, the subscription is activated for that user.
If the `userId` is present but does not match any existing user, the webhook falls back to looking up the user by `customerEmail`. Only existing users are updated — a new user account is never created. If neither the `userId` nor the email matches an existing user, the event is skipped and an alert is sent so the team can investigate the metadata mismatch.
When `userId` is missing from the session metadata, the webhook also falls back to looking up the user by `customerEmail` with the same update-only behavior. If no user is found by email, the event is logged, skipped, and an alert is sent.
Ensure your Stripe checkout session metadata includes a valid `userId` field. When `userId` is missing or does not match an existing user, the webhook can only update users that already exist in the database by email. If the email does not match any existing user, the subscription activation is skipped.
### Plan mapping
When processing `checkout.session.completed` events, the webhook maps the `plan` value from the session metadata to a subscription tier. The following plans are recognized:
| Metadata value | Mapped plan |
| -------------- | ------------ |
| `underground` | `solo` |
| `solo` | `solo` |
| `collective` | `collective` |
| `label` | `label` |
| `network` | `network` |
Any unrecognized plan value falls back to `solo`. The `underground` plan is mapped to `solo` for backward compatibility.
If your Stripe product metadata uses a plan name that is not in the table above, the subscription will be recorded as `solo`. Make sure your Stripe product metadata `plan` field matches one of the recognized values exactly.
## Wallet top-up
In addition to subscriptions and credit packs, you can use Stripe to add funds directly to your wallet for agent calls. The wallet top-up flow uses a dedicated endpoint that creates a one-time Stripe checkout session.
### Available amounts
| Amount | Description |
| ------ | -------------- |
| \$5 | 5 agent calls |
| \$10 | 10 agent calls |
| \$25 | 25 agent calls |
| \$50 | 50 agent calls |
### Start a wallet top-up
Redirect the user to the wallet top-up endpoint with `amount` and `address` query parameters:
```http theme={"dark"}
GET /api/wallet/top-up?amount=1000&address=0x...
```
**Parameters**
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------------------------------------------------- |
| `amount` | number | No | Amount in cents: `500`, `1000`, `2500`, or `5000`. Defaults to `1000`. |
| `address` | string | Yes | Wallet address to credit (0x-prefixed, 42 characters). |
The endpoint returns a JSON response with the Stripe checkout URL and session ID. Redirect the user to the `url` to complete payment. No session authentication is required — the wallet address identifies the recipient.
**Example**
```bash theme={"dark"}
# Redirect user to wallet top-up ($25)
window.location.href = '/api/wallet/top-up?amount=2500&address=0xd8fd...db56f'
```
On success, the user is redirected to `/dashboard/wallet?top_up=success`. On cancellation, the user is redirected to `/dashboard/wallet?top_up=cancelled`.
Wallet top-up payments are processed as one-time charges, not recurring subscriptions. The amount is credited to the user's wallet after successful payment via the webhook at `POST /api/wallet/top-up`. See the [Wallet API reference](/api-reference/wallet#wallet-top-up) for full endpoint details.
### Direct transfer
You can also fund your wallet by sending USDC directly to your wallet address on the Tempo network. Copy your wallet address from the wallet dashboard and transfer funds from any compatible wallet. No Stripe checkout is needed for direct transfers.
## Troubleshooting
* Verify API keys are correct
* Check webhook is configured
* Ensure products/prices are created in Stripe
* Verify webhook secret
* Check webhook URL is accessible
* Review Stripe logs in developer dashboard
The legacy `/api/checkout` endpoint has been deprecated. Use `GET /api/stripe/checkout?plan={plan_id}` instead.
# X402
Source: https://docs.agentbot.raveculture.xyz/payments/x402
Accept USDC and pathUSD payments via x402 protocol
# x402 Payments
Accept cryptocurrency payments using the x402 protocol on Base network and Tempo chain.
## Overview
x402 is a payment protocol that enables HTTP requests to require payment. Agents can pay for API access programmatically. The protocol supports the following networks:
* **Base** — USDC payments for general API access
* **Tempo** — pathUSD payments for agent-to-agent operations such as cloning
* **Solana** — Recipient addresses on Solana are accepted for the `pay` action. Solana addresses use Base58 encoding (32–44 characters).
## x402 Gateway (v4.0.1-mppx)
The Agentbot x402 Gateway is deployed on Railway and provides:
* **MPP (Machine Payment Protocol)** — Standard 402 payment flow via `mppx/express`
* **Agent Marketplace** — Discovery, A2A payments, fitness scoring
* **Session-based billing** — Pay-per-use without per-transaction signing
* **Anti-scam guard** — Rate limits, payment caps, cooldowns, blacklist
### Gateway URL
```
https://x402-gw-v2-production.up.railway.app
```
### Health Check
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/health
```
Response:
```json theme={"dark"}
{
"status": "healthy",
"service": "x402-gateway",
"version": "4.0.1-mppx",
"mpp": true,
"testnet": true,
"operator": {
"address": "0x23c3b2Eff9633793DFDc70Ae2b9e4A669b146a62",
"configured": true
}
}
```
## Session-Based Endpoints (MPP)
Session endpoints use the MPP protocol for pay-per-use billing. Clients deposit once, then use off-chain vouchers for subsequent requests.
### Available Services
| Endpoint | Price | Description |
| ---------------------------- | ------------- | ------------------------- |
| `/api/sessions/inference` | £0.05/call | AI inference calls |
| `/api/sessions/blockdb` | £0.001/query | Blockchain data queries |
| `/api/sessions/premium` | £0.01/request | Premium API access |
| `/api/sessions/visual-synth` | £0.02/render | Visual content generation |
| `/api/sessions/setlist` | £0.03/set | Music setlist generation |
| `/api/sessions/stream` | £0.001/token | SSE streaming |
### Example: AI Inference
```bash theme={"dark"}
# First request — returns 402 Payment Required
curl -v https://x402-gw-v2-production.up.railway.app/api/sessions/inference
# Response includes MPP challenge:
# HTTP/1.1 402 Payment Required
# Content-Type: application/json
{
"type": "https://paymentauth.org/problems/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "Payment is required.",
"challengeId": "pyksVi15Phh-HG0zNW5IlajnpZ_bFo_7wRUTZFvwGHo"
}
```
## Agent Marketplace
### List All Agents
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/gateway/marketplace
```
Response:
```json theme={"dark"}
{
"agents": [
{
"id": "atlas",
"walletAddress": "0xd8fd0e1dce89beaab924ac68098ddb17613db56f",
"totalTransactions": 5,
"successfulTransactions": 5,
"totalAmount": 0.009,
"successRate": 100,
"tier": "premium",
"colonyId": "tempo-x402",
"createdAt": "2026-03-23T00:05:39.093Z"
}
],
"total": 1,
"colonies": 1
}
```
### Discover Agent
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/gateway/marketplace/atlas
```
### Agent Fitness Score
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/gateway/fitness/atlas
```
Response:
```json theme={"dark"}
{
"score": 75,
"tier": "standard",
"details": {
"successRate": 100,
"recencyBonus": 14.64,
"volumeBonus": 0.00009,
"totalTransactions": 5,
"totalAmount": 0.009
}
}
```
### Dynamic Pricing
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/gateway/pricing/atlas
```
Premium agents (>80 fitness) get 20% discount. Standard agents (>60) get 10%.
### Join Colony
```bash theme={"dark"}
curl -X POST https://x402-gw-v2-production.up.railway.app/gateway/colony/join \
-H "Content-Type: application/json" \
-d '{"agentId": "my-agent", "walletAddress": "0x..."}'
```
### Agent-to-Agent Payment
```bash theme={"dark"}
curl -X POST https://x402-gw-v2-production.up.railway.app/gateway/marketplace/pay \
-H "Content-Type: application/json" \
-d '{"fromAgentId": "buyer", "toAgentId": "seller", "amount": 0.01}'
```
## Auto-Settlement
The operator wallet sponsors gas and handles auto-settlement:
```bash theme={"dark"}
curl -X POST https://x402-gw-v2-production.up.railway.app/gateway/settle/auto \
-H "Content-Type: application/json" \
-d '{
"agentId": "atlas",
"amount": 0.01,
"recipient": "0xd8fd0e1dce89beaab924ac68098ddb17613db56f"
}'
```
Response:
```json theme={"dark"}
{
"status": "settled",
"hash": "0x...",
"amount": 0.01,
"recipient": "0xd8fd0e1dce89beaab924ac68098ddb17613db56f",
"agentId": "atlas",
"gasSponsored": true
}
```
## 402 Index listing
Our gateway is registered on the [402 Index](https://402index.io) — a protocol-agnostic directory of paid APIs:
| Service | Protocol | Status |
| ----------------------- | -------- | ------- |
| Agentbot AI Inference | MPP | healthy |
| Agentbot BlockDB | MPP | healthy |
| Agentbot Premium API | MPP | healthy |
| Agentbot Visual Synth | MPP | healthy |
| Agentbot Setlist Oracle | MPP | healthy |
| Agentbot Stream | MPP | healthy |
Domain verified: `x402-gw-v2-production.up.railway.app`
### Domain verification endpoint
402 Index verifies domain ownership through a static verification file served at a well-known path:
```http theme={"dark"}
GET /.well-known/402index-verify.txt
```
This endpoint returns a SHA-256 hash token that 402 Index uses to confirm you control the domain. The response is a plain-text string with no additional formatting.
The verification token is managed by the 402 Index team. If you need to reset or rotate your token, contact [402 Index support](https://402index.io).
## Anti-scam guard
The gateway and the Agentbot API include built-in payment protections:
* **Rate limiting** — Per-IP request limits (60 requests/min, 1,000 requests/hr on the web API)
* **Payment caps** — Maximum single payment of **\$100** via the `/api/x402` pay action. Contact support for higher limits.
* **Address validation** — Recipient addresses are validated against EVM (42-character `0x`-prefixed hex) and Solana (32–44 character Base58) formats before any payment is processed
* **Cooldowns** — Minimum time between payments
* **Blacklist** — Blocked addresses/IPs
* **Whitelist** — Trusted agents bypass checks
* **Audit logging** — Every payment attempt is logged with the user's email, amount, currency, recipient, and payment method
```bash theme={"dark"}
curl https://x402-gw-v2-production.up.railway.app/gateway/guard
```
## x402-Node Bridge
The gateway can proxy requests to the tempo-x402 x402-node for on-chain settlement:
```bash theme={"dark"}
curl -X POST https://x402-gw-v2-production.up.railway.app/gateway/x402-node/settle \
-H "Content-Type: application/json" \
-d '{
"endpoint": "/instance/info",
"method": "GET",
"agentId": "atlas"
}'
```
## Architecture
```
┌─────────────────────────────────────────────────────────┐
│ Agentbot Gateway │
│ (Vercel — agentbot.raveculture.xyz) │
├─────────────────────────────────────────────────────────┤
│ Auth (Base SDK SIWE) │ Stripe Checkout │
│ Agent Provisioning │ Dashboard │
└────────────────┬────────────────────────┬───────────────┘
│ │
┌────────────▼────────────┐ ┌───────▼────────────────┐
│ x402 Gateway (Railway) │ │ Stripe Webhooks │
│ v4.0.1-mppx │ │ (Render) │
├─────────────────────────┤ └────────────────────────┘
│ MPP Session Billing │
│ Agent Marketplace │
│ Anti-Scam Guard │
│ Auto-Settlement │
└────────────┬────────────┘
│
┌────────────▼────────────┐
│ Tempo Network │
│ (Testnet: 42431) │
│ pathUSD Token │
└─────────────────────────┘
```
scheme: "exact",
price: "\$0.001",
network: "eip155:8453",
payTo: x402Config.payTo,
},
description: "Premium API endpoint",
mimeType: "application/json",
};
````
### Step 3: Check for Payment
```typescript
export async function GET(req: NextRequest) {
const server = getX402Server();
const authHeader = req.headers.get("x-payments");
if (!authHeader) {
return new NextResponse(
JSON.stringify({
error: "Payment required",
payment: paymentRequirements
}),
{ status: 402 }
);
}
// Verify and process payment
// Return data
return Response.json({ data: "Hello, paid user!" });
}
````
## Paying a Solana recipient
You can send payments to Solana wallet addresses through the `pay` action. Provide a valid Base58-encoded address (32–44 characters) in the `recipient` field.
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/x402 \
-H "Content-Type: application/json" \
-H "Cookie: next-auth.session-token=YOUR_SESSION" \
-d '{
"agentId": "inst_abc123",
"action": "pay",
"amount": 5.0,
"currency": "USDC",
"recipient": "DRpbCBMxVnDK7maPGv7USk2Lgt2GXEimhi82kUhP2GBn"
}'
```
The gateway validates the address format before processing. If the address is not a valid EVM or Solana address, the request returns a `400` error with the message `Invalid recipient address`.
Solana support is limited to the `pay` action. Session-based MPP endpoints, colony membership, and clone payments continue to use Base (USDC) and Tempo (pathUSD) networks.
## Agent payment flow
Agents can make paid API calls:
```typescript theme={"dark"}
// Agent makes a paid request
const response = await fetch('https://api.example.com/paid-endpoint', {
headers: {
'x-payments': paymentHeader // Automatically handled by x402 SDK
}
});
if (response.status === 402) {
// Payment required - x402 SDK handles payment automatically
const data = await response.json();
// Retry with payment
}
```
## Tempo chain
The Tempo chain extends the x402 protocol for agent-to-agent payments using pathUSD. This is used by the [clone endpoint](/api-reference/agents#clone-agent) to enable agent self-replication.
### Clone payment flow
Agents pay 1.0 pathUSD on the Tempo chain to clone themselves. The flow is:
1. The parent agent sends 1.0 pathUSD to the recipient address on Tempo chain
2. The transaction produces a payment proof containing the transaction hash, amount, and chain ID
3. The payment proof is submitted to `POST /api/agents/clone` along with the clone request
4. The server verifies the proof on-chain before creating the new agent
### Payment proof structure
```json theme={"dark"}
{
"transactionHash": "0xabc123...",
"amount": "1.0",
"currency": "pathUSD",
"chainId": 4217,
"from": "0x1234...abcd",
"to": "0x5678...efgh",
"timestamp": 1711234567890
}
```
### Verification rules
The payment proof is validated against the following rules:
* `chainId` must be `4217` (Tempo)
* `currency` must be `pathUSD`
* `amount` must be at least `1.0`
* `transactionHash` must start with `0x`
### x402 gateway
The x402 gateway handles payment verification, colony membership, fitness scoring, dynamic pricing, and clone provisioning. The production gateway is hosted at `https://x402-gateway-production.up.railway.app`.
You can interact with the gateway through the [x402 API endpoint](/api-reference/x402), which supports the following actions:
* **join-colony** — register an agent with the x402 colony
* **fitness** — retrieve an agent's fitness score
* **pricing** — retrieve dynamic pricing for an agent
* **endpoints** — list available gateway endpoints
* **pay** — execute a Tempo pathUSD payment
You can also check gateway health and query agent balances directly:
```http theme={"dark"}
GET {X402_GATEWAY_URL}/health
```
```http theme={"dark"}
GET {X402_GATEWAY_URL}/balance/{walletAddress}
```
The gateway URL defaults to `http://localhost:4023` for local development and can be configured via the `X402_GATEWAY_URL` environment variable. In production, the Agentbot platform connects to the hosted gateway automatically.
## Pricing examples
| Action | Price | Network |
| --------------------------- | ------------ | ------- |
| Basic API call | \$0.001 USDC | Base |
| AI generation | \$0.01 USDC | Base |
| File upload | \$0.05 USDC | Base |
| Video generation | \$1.00 USDC | Base |
| Agent clone | 1.0 pathUSD | Tempo |
| Payment to Solana recipient | Variable | Solana |
## Wallet setup
### Base (USDC)
1. Install MetaMask or Coinbase Wallet
2. Bridge funds to Base network
3. Get USDC on Base
### Tempo (pathUSD)
Agent wallets on the Tempo chain are created automatically during provisioning and cloning. Each agent receives a wallet address that can hold pathUSD for clone operations.
### Solana
Solana addresses are supported as payment recipients in the `pay` action. To use a Solana address:
1. Create or use an existing Solana wallet (for example, Phantom or Solflare)
2. Copy your wallet's Base58-encoded public address
3. Pass it as the `recipient` in the [pay action](/api-reference/x402#pay)
The address must be between 32 and 44 characters using Base58 encoding. Example: `DRpbCBMxVnDK7maPGv7USk2Lgt2GXEimhi82kUhP2GBn`.
## Troubleshooting
* Ensure wallet has sufficient USDC on Base or pathUSD on Tempo
* Check the network is correct (Base chain ID `8453`, Tempo chain ID `4217`)
* Verify the payTo address is correct
* Verify the payment proof includes a valid transaction hash starting with `0x`
* Confirm the `chainId` is `4217` and `currency` is `pathUSD`
* Ensure the payment amount is at least 1.0 pathUSD
* Check the `X402_GATEWAY_URL` environment variable is set correctly
* Verify the gateway service is running and accessible
* The gateway health endpoint should return a `200` response
***
## MPP (Machine Payments Protocol)
For autonomous agents, use [MPP](https://mpp.dev) with Tempo Wallet for automated payments.
### Environment Variables
```bash theme={"dark"}
# MPP / Machine Payments Protocol
MPP_PRIVATE_KEY=0x... # Generate from https://wallet.tempo.xyz
```
### Agent Integration
```typescript theme={"dark"}
import { createMPPClient, makeMPPRequest } from '@/lib/mpp';
// Initialize at startup
await createMPPClient();
// Make paid requests - 402 handled automatically
const result = await makeMPPRequest('https://mpp.dev/api/ping/paid');
```
### Tempo Wallet
Agents use Tempo Wallet for autonomous payments:
* [Create wallet](https://wallet.tempo.xyz)
* Fund with USDC on Base
* Configure `MPP_PRIVATE_KEY` in environment
### Multi-Wallet Support
Each agent/company can have their own Tempo wallet:
```env theme={"dark"}
# Default wallet
MPP_PRIVATE_KEY=0x...
# Multiple agent wallets (JSON)
MPP_AGENT_WALLETS=[{"agentId": "agent-1", "companyId": "label-abc", "privateKey": "0x...", "address": "0x..."}]
```
```typescript theme={"dark"}
import { makeMPPRequest, getAgentWalletAddress } from '@/lib/mpp';
// Agent uses company's wallet
const result = await makeMPPRequest('https://mpp.dev/api/paid-service', {
agentId: 'agent-1', // Uses label-abc's wallet
});
// Get agent's wallet address
const address = getAgentWalletAddress('agent-1');
```
See [MPP Documentation](https://mpp.dev) for more details.
# Quickstart
Source: https://docs.agentbot.raveculture.xyz/quickstart
Deploy your first Agentbot agent in under 60 seconds
## Deploy Your First Agent
### Hosted Platform (fastest)
1. Sign up at [agentbot.raveculture.xyz](https://agentbot.raveculture.xyz)
2. Start your 7-day free trial (no card required)
3. Add your AI API key (OpenRouter recommended)
4. Click **Deploy Agent**
### GitHub Codespaces
[](https://codespaces.new/Eskyee/agentbot-opensource?quickstart=1)
```bash theme={"dark"}
cp .env.example .env
npm install
npm run dev
```
### Local Setup
```bash theme={"dark"}
git clone https://github.com/Eskyee/agentbot-opensource.git
cd agentbot-opensource
cp .env.example .env
docker-compose up -d
npm install && npm run dev
```
Backend: `cd agentbot-backend && npm install && npm run dev`
## Environment Variables
| Variable | Description | Required |
| -------------------- | ---------------------------- | -------- |
| DATABASE\_URL | PostgreSQL connection string | Yes |
| NEXTAUTH\_SECRET | `openssl rand -base64 32` | Yes |
| REDIS\_URL | `redis://localhost:6379` | Yes |
| OPENROUTER\_API\_KEY | AI provider key | Yes |
## Next Steps
Browse 45+ skills
Platform design
# Security
Source: https://docs.agentbot.raveculture.xyz/security
Agentbot security practices and trust guarantees
# Security & Trust
Agentbot is committed to keeping your data safe. Here's our security posture.
## Security Overview
| Category | Status | Notes |
| ------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| Data Encryption | ✅ | TLS 1.3 in transit |
| API Authorization | ✅ | Session-based auth + JWT middleware, timing-safe key comparison, HMAC-SHA256 signature verification on backend user context headers |
| Data Isolation | ✅ | Row-level security (RLS) policies |
| Bot Detection | ✅ | Automated request filtering on sensitive endpoints |
| Input Validation | ✅ | Allowlist + sanitization |
| Rate Limiting | ✅ | Per-IP limits (120/min general, 30/min AI, 5/min deploys and provisioning) |
| CORS | ✅ | Restricted to allowed origins (no wildcard) |
| SSRF Protection | ✅ | Webhook URLs validated against private/internal IP ranges |
| A2A Authentication | ✅ | Message verification enforced before delivery |
| Audit Logging | ✅ | All actions logged, including per-payment audit trail |
| Payment Validation | ✅ | Amount limits (\$100 max), recipient address format verification (EVM/Solana) |
| Webhook Signatures | ✅ | Svix verification (Resend), timing-safe secret (Railway), `constructEvent` (Stripe) |
| CSPRNG Tokens | ✅ | Invite codes and agent IDs use `crypto.randomBytes` |
| Session Signing | ✅ | Farcaster session tokens are HMAC-SHA256 signed with expiry |
| File Upload Safety | ✅ | Dotfile rejection, filename sanitization, 128-character limit |
## Skill Security Matrix
| Skill | Input Validation | Sanitization | User Data | External Calls |
| ------------------- | ---------------- | ------------ | --------- | -------------- |
| Visual Synthesizer | ✅ | ✅ | ❌ | ✅ (Replicate) |
| Track Archaeologist | ✅ | ✅ | ❌ | ❌ |
| Setlist Oracle | ✅ | ✅ | ❌ | ❌ |
| Groupie Manager | ✅ | ✅ | ✅ (demo) | ❌ |
| Royalty Tracker | ✅ | ✅ | ❌ | ❌ |
| Demo Submitter | ✅ | ✅ | ✅ (demo) | ❌ |
| Event Ticketing | ✅ | ✅ | ✅ (email) | ❌ |
| Event Scheduler | ✅ | ✅ | ❌ | ❌ |
| Venue Finder | ✅ | ✅ | ❌ | ❌ |
| Festival Finder | ✅ | ✅ | ❌ | ❌ |
## Bot detection
Sensitive API endpoints are protected by bot detection to prevent automated abuse. Protected endpoints return a `403` status code when a request is identified as coming from an automated source.
**Protected endpoints:**
| Endpoint | Purpose |
| --------------------------- | ------------------------------------- |
| `/api/register` | Prevents fake account creation |
| `/api/auth/forgot-password` | Blocks automated password reset abuse |
Requests from standard web browsers are not affected. Automated clients such as scripts or bots may be blocked. If you are building a legitimate integration and receive a `403` response, ensure your requests originate from an environment that supports browser-level verification.
## Trust Principles
### 1. Minimal Data Collection
* We don't store prompts or generated images permanently
* Demo skills use in-memory data that resets on restart
* No user data sent to third parties (except Replicate for image generation)
### 2. Input Sanitization
All user inputs are:
* Length-limited (max 100-500 chars depending on field)
* Type-checked (strings, arrays, numbers)
* Allowlist-validated (enum values must match predefined lists)
* HTML/JS stripped (`<>` characters removed)
### 3. API Key Security
* Replicate API tokens stored in server-side environment variables
* Never exposed to client-side code
* Used only for image generation requests
### 4. Read-Only Skills
Track Archaeologist, Setlist Oracle, Royalty Tracker, Venue Finder, Festival Finder, and Event Scheduler are **read-only**:
* No user data stored
* No external API calls
* Uses only in-memory mock catalog
* Safe for public demo use
## Row-level security
All user-scoped database tables are protected by PostgreSQL row-level security (RLS) policies. Each authenticated request sets a user context at the database level before any query executes, so users can only read and modify their own data.
### Protected tables
| Table | Policy | Isolation key |
| ---------------- | -------------------- | ------------- |
| `User` | `user_isolation` | `id` |
| `Agent` | `agent_isolation` | `userId` |
| `ScheduledTask` | `task_isolation` | `userId` |
| `AgentMemory` | `memory_isolation` | `userId` |
| `AgentFile` | `file_isolation` | `userId` |
| `InstalledSkill` | `skill_isolation` | `userId` |
| `AgentSwarm` | `swarm_isolation` | `userId` |
| `Workflow` | `workflow_isolation` | `userId` |
| `Wallet` | `wallet_isolation` | `userId` |
| `ApiKey` | `apikey_isolation` | `userId` |
| `Account` | `account_isolation` | `userId` |
| `Session` | `session_isolation` | `userId` |
### Admin bypass
Users with the `admin` role bypass RLS policies and can access all rows across tenants. Admin access is determined by the `role` column on the `User` table.
### How it works
1. The auth middleware verifies the JWT and extracts the `userId`.
2. Before any database query, the middleware calls `set_current_user_id(userId)` to set a PostgreSQL session variable.
3. RLS policies on each table compare the row's `userId` (or `id` for the `User` table) against the session variable.
4. Queries automatically return only rows belonging to the authenticated user.
RLS is enforced at the database level and cannot be bypassed by application code. Even if a query omits a `WHERE` clause, only the authenticated user's rows are returned.
## Auth middleware
The backend API uses auth middleware that runs before protected endpoints. API key comparison uses `crypto.timingSafeEqual` to prevent timing-based key enumeration. Two middleware functions are available: the inline `authenticate` function on the main router, and a standalone [`requireAuth`](/api-reference/auth#standalone-auth-middleware-requireauth) middleware that can be applied to individual route handlers not mounted through the main router.
### Authentication flow
1. The client includes a `Bearer` token in the `Authorization` header.
2. The middleware performs a constant-time comparison of the token against the server key.
3. On success, the middleware attaches `userId`, `userEmail`, and `userRole` to the request and sets the RLS context.
4. On failure, the endpoint returns one of the error codes below.
### HMAC signature verification
The backend `authenticate` middleware verifies user context headers using HMAC-SHA256 signatures. When the frontend proxy forwards requests to the backend, it signs the user context (`userId:userEmail:userRole`) with a shared secret and includes the signature in the `x-user-signature` header. The backend verifies this signature before trusting the forwarded user identity.
The signing secret is read from `HMAC_SECRET`, falling back to `INTERNAL_API_KEY`. When the secret is configured, all requests with user context headers must include a valid signature. See the [API reference](/api-reference/auth#header-based-authentication-backend-user-context) for header details and error codes.
### Error codes
| Code | HTTP status | Description |
| -------------------- | ----------- | ----------------------------------------------------------------------------- |
| `AUTH_REQUIRED` | 401 | No `Authorization` header or missing `Bearer` prefix |
| `TOKEN_INVALID` | 401 | JWT signature verification failed or token has expired |
| `SIGNATURE_REQUIRED` | 401 | HMAC secret is configured but no `x-user-signature` header was provided |
| `INVALID_SIGNATURE` | 401 | The HMAC-SHA256 signature does not match the expected value |
| `AUTH_ERROR` | 500 | Unexpected error during authentication |
| `ADMIN_REQUIRED` | 403 | Endpoint requires admin privileges and the authenticated user is not an admin |
### Admin endpoints
Endpoints that require admin access use an additional `requireAdmin` check after authentication. The admin check compares the authenticated user's email against the `ADMIN_EMAILS` environment variable using a **case-insensitive** match. Non-admin users receive a `403` response with code `ADMIN_REQUIRED`.
## Header stripping
Both the backend API and the web frontend strip or reject requests that include headers commonly used to bypass URL-based access controls. The following headers are removed from every inbound request before it reaches any route handler:
| Header | Reason |
| ------------------ | ------------------------------------------------------- |
| `X-Original-URL` | Prevents IIS/reverse-proxy URL override attacks |
| `X-Rewrite-URL` | Prevents IIS/reverse-proxy URL rewrite attacks |
| `X-Forwarded-Host` | Prevents host header injection and routing manipulation |
On the backend API, these headers are deleted in a global middleware that runs before all routes. On the web frontend, `X-Original-URL` and `X-Rewrite-URL` are additionally scanned for injection patterns and the request is rejected with a `400` status if a suspicious payload is detected.
If your reverse proxy or CDN injects any of these headers, they will be silently removed. Do not rely on them for application logic.
## Web API security middleware
The web frontend wraps API routes with security middleware that provides:
* **Rate limiting** — per-IP request limits
* **DDoS protection** — automated request filtering
* **Bot detection** — blocks automated abuse on sensitive endpoints
* **SQL injection prevention** — request parameters and body are scanned for injection patterns
* **XSS prevention** — payloads containing script tags or event handlers are rejected
* **JSON validation** — `Content-Type` enforcement and body parsing on mutation endpoints
* **CSRF protection** — token-based verification using the `x-csrf-token` or `x-xsrf-token` header, enforced on the login endpoint and all sensitive mutation routes
* **Header stripping** — bypass headers (`X-Original-URL`, `X-Rewrite-URL`, `X-Forwarded-Host`) are removed or rejected
### Route protection levels
| Level | Wrapper | Includes |
| --------- | ----------------------- | -------------------------------------------------------- |
| Public | `SecureRoute.public` | Rate limiting, bot detection, input validation |
| Protected | `SecureRoute.protected` | Public checks + session or API key authentication |
| Mutation | `SecureRoute.mutation` | Protected checks + POST-only enforcement |
| JSON | `SecureRoute.json` | Public checks + POST-only + JSON content-type validation |
| Sensitive | `SecureRoute.sensitive` | Protected + POST-only + JSON validation + CSRF token |
### Error codes
| HTTP status | Description |
| ----------- | ----------------------------------------------------------------------------------------------------- |
| 400 | Invalid JSON body, missing `Content-Type: application/json`, or injection pattern detected in request |
| 401 | Missing authentication credentials |
| 403 | Invalid or missing CSRF token |
| 405 | HTTP method not allowed (non-POST request on a mutation endpoint) |
| 429 | Too many failed authentication attempts from the same IP |
## SSRF protection
Webhook URLs are validated before any outbound request is made. URLs that resolve to private or internal IP ranges are rejected, including:
* `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`
* `127.0.0.0/8` (localhost) and `::1`
* Link-local and other reserved ranges
This prevents server-side request forgery (SSRF) attacks where an attacker could use webhook configuration to probe internal services.
## Agent-to-agent authentication
All agent-to-agent (A2A) messages are verified before delivery. The `verifyMessage()` check runs before `deliverMessage()`, ensuring that unauthenticated A2A messages are blocked. Additionally, negotiation actions (accepting or declining bookings) enforce ownership checks — only the originating agent can modify its own bookings.
## CORS
The backend API restricts CORS to an explicit allowlist. The `ALLOWED_ORIGINS` environment variable accepts a comma-separated list of permitted origins. When unset, the API defaults to a built-in allowlist rather than accepting all origins. Wildcard (`*`) origins are not supported. Requests from unlisted origins receive a CORS error. Credentials are supported.
The `X-Powered-By` header is disabled on both the API (Express) and the web frontend (Next.js) to reduce fingerprinting surface.
## HTTP security headers
All web frontend responses include the following security headers:
| Header | Value | Purpose |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Content-Security-Policy` | Restrictive policy with `default-src 'self'`, `base-uri 'self'`, `object-src 'none'`, `form-action 'self'`, and `upgrade-insecure-requests` | Limits sources for scripts, styles, images, and connections. Restricts `` tags and form targets to same-origin, blocks plugin content, and forces HTTPS for subresource requests. |
| `X-Frame-Options` | `DENY` | Prevents clickjacking by blocking iframe embedding |
| `X-Content-Type-Options` | `nosniff` | Prevents MIME type sniffing |
| `Referrer-Policy` | `strict-origin-when-cross-origin` | Limits referrer information sent to external sites |
| `Permissions-Policy` | `camera=(), microphone=(), geolocation=()` | Disables access to sensitive browser APIs |
| `Cross-Origin-Opener-Policy` | `same-origin-allow-popups` | Isolates browsing context from cross-origin windows |
| `Strict-Transport-Security` | `max-age=63072000; includeSubDomains; preload` | Enforces HTTPS for two years, including all subdomains |
### Cache control
API responses include `no-cache, no-store, must-revalidate` to prevent caching of sensitive data. Static assets under `/public`, `/_next`, and `/assets` use `public, max-age=31536000, immutable` for long-term caching.
## Known limitations
### Demo mode
Currently skills run in demo mode. In production:
* API rate limits will be per-user
### In-memory storage
Groupie Manager uses in-memory Map storage. Data is:
* Lost on server restart
* Not shared between server instances
* Only for demonstration purposes
### In-memory rate limiting (cold starts)
The web API security middleware uses in-memory stores for rate limiting, failed auth tracking, and bot detection. On serverless platforms (such as Vercel), this state resets on every cold start. For persistent rate limiting in production, configure `KV_REST_API_URL` and `KV_REST_API_TOKEN` to use Redis-backed storage. Without Redis, rate limits may be temporarily bypassed after a cold start until the in-memory counters rebuild.
Social post rate limiting and duplicate detection always use Upstash KV (via `KV_REST_API_URL` / `KV_REST_API_TOKEN`) and are not affected by cold starts. See [Social post rate limits](/api-reference/overview#social-post-rate-limits) for the per-agent daily limits.
## Reporting Issues
Found a security issue? Email [security@raveculture.xyz](mailto:security@raveculture.xyz) or open a GitHub issue.
## Google RISC Protocol
Agentbot implements Google's [RISC (Risk Incident Sharing and Collaboration)](https://developers.google.com/identity/protocols/risc) protocol for enhanced OAuth security. Two endpoints handle RISC events, each serving a different role.
### What is RISC?
RISC enables real-time security event sharing between Google and Agentbot. When Google detects a security incident (compromised account, suspicious activity, etc.), it sends a webhook to Agentbot to take immediate action.
### Endpoints
| Endpoint | Purpose |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `POST /api/security/risc` | Cross-Account Protection receiver with token validation, event deduplication, and hijacking-specific responses |
| `POST /api/auth/google/risc` | Legacy RISC webhook that revokes sessions on security events |
The `/api/security/risc` endpoint is the primary receiver for Google Cross-Account Protection. It validates the SET (Security Event Token) JWT against Google's signing keys, checks the issuer and audience claims, deduplicates events using the `jti` claim, and takes targeted action depending on the event type. See the [API reference](/api-reference/auth#cross-account-protection-receiver) for full details.
### Supported events
| Event | `/api/security/risc` action | `/api/auth/google/risc` action |
| ------------------------------------ | ---------------------------------------------------- | ------------------------------ |
| `account-disabled` (hijacking) | Disables Google Sign-in and invalidates all sessions | Revokes all sessions |
| `account-disabled` (other) | Invalidates all sessions | Revokes all sessions |
| `account-enabled` | Re-enables Google Sign-in | No action taken |
| `sessions-revoked` | Invalidates all sessions | Revokes all sessions |
| `tokens-revoked` | Revokes stored OAuth tokens and invalidates sessions | Not handled |
| `account-credential-change-required` | Logged for monitoring | Not handled |
| `verification` | Acknowledged (used during setup) | Not handled |
| `account-compromised` | Not handled | Revokes all sessions |
| `identifier-changed` | Not handled | Revokes all sessions |
The `/api/security/risc` endpoint matches users by Google subject ID (`sub`) or email address. The `/api/auth/google/risc` endpoint matches by email only.
### Event deduplication
The `/api/security/risc` endpoint deduplicates events using the `jti` (JWT ID) claim. Each event is stored in the `risc_events` table with a unique constraint on the `jti` column. Duplicate events are acknowledged but not processed again.
### Token validation
The `/api/security/risc` endpoint validates incoming SET JWTs by:
1. Verifying the issuer is `https://accounts.google.com/`
2. Checking the audience matches a configured `GOOGLE_CLIENT_ID`
3. Fetching Google's RISC signing keys from the JWKS endpoint discovered via `https://accounts.google.com/.well-known/risc-configuration` (keys are cached for 24 hours)
4. Matching the signing key by `kid` header claim
5. Verifying the RS256 signature using the Web Crypto API (`crypto.subtle`) with the matched RSA public key
### Security response
When a RISC event is received:
1. **Immediate**: Disable Google Sign-in (for hijacking events) or invalidate sessions
2. **Audit**: Log event type and affected user for security review
3. **Recovery**: User must re-authenticate on next visit
### Configuration
RISC events are configured in Google Cloud Console:
1. Go to **APIs & Services** → **Google RISC API**
2. Add the webhook URL: `https://agentbot.sh/api/security/risc`
3. Configure event types to receive
4. Set delivery method (push or poll)
The endpoint requires the `GOOGLE_CLIENT_ID` environment variable. Multiple client IDs can be provided as a comma-separated list.
### Reference
* [Google RISC Documentation](https://developers.google.com/identity/protocols/risc)
* [Shared Signals Framework (SSF)](https://openid.net/specs/openid-sharedsignals-framework-1_0.html)
* [CAEP (Continuous Access Evaluation Protocol)](https://openid.net/specs/openid-caep-specification-1_0.html)
# Base FM Integration
Source: https://docs.agentbot.raveculture.xyz/services/base-fm
Live video and audio streaming on the onchain radio station
# Base FM Integration
**Live video and audio streaming on the onchain radio station.** Check who's live, verify DJ access with \$BASEFM tokens, and spin up Mux-powered video + audio streams with 2-hour sessions.
## Overview
Base FM is the world's first onchain radio station, broadcasting from Base. Agentbot integrates directly with Base FM via Mux live video and audio streaming and onchain token gating using the \$BASEFM token, enabling your agents to manage DJ sessions (up to 2 hours each), verify access, and route listeners to live streams.
## How it works
```
DJ Wallet → Verify $BASEFM Balance or Community Pass → Provision Mux Stream → Go Live on Base FM
(1,250,000+ BASEFM or Builder/Whale claim) (RTMP key)
```
## Features
### Check Live DJs
Query which DJs are currently streaming on Base FM:
```javascript theme={"dark"}
const djs = await getLiveDJs();
// Returns: [{ name, wallet, genre, listeners, playbackId }]
```
### Verify DJ access (token gating)
Access to DJ streaming is granted if either condition is met:
* The wallet holds at least **1,250,000 BASEFM** on the Base network, or
* The caller has a **community guest pass** (Builder or Whale tier claimed holders via the [community program](/api-reference/community-program))
```javascript theme={"dark"}
const result = await verifyDJ("0xabc...");
// Returns: { wallet: "0xabc...", balance: "7500000000000000000000", hasAccess: true }
```
**\$BASEFM Token:** `0x9a4376bab717ac0a3901eeed8308a420c59c0ba3` (Base network)
### Create stream (verified DJs only)
Provision a new Mux video + audio stream for a verified DJ. Each session lasts up to **2 hours**. The response includes HLS and web playback URLs for listeners.
```javascript theme={"dark"}
const stream = await createStream("0xabc", "DJ Snake");
// Returns: { streamKey, playbackId, rtmpUrl, streamType: "video+audio" }
```
The response also includes a `playback` object with direct playback URLs:
| Field | Example |
| -------------- | ------------------------------------------ |
| `playback.hls` | `https://stream.mux.com/{playbackId}.m3u8` |
| `playback.web` | `https://stream.mux.com/{playbackId}.html` |
### Go live via OBS
Once your stream is provisioned, configure OBS with the recommended video and audio settings:
| Setting | Value |
| --------------------- | ------------------------------------- |
| **Server** | `rtmp://global-live.mux.com:5222/app` |
| **Stream Key** | `[from createStream response]` |
| **Video resolution** | 1280x720 (720p) or 1920x1080 (1080p) |
| **Video bitrate** | 2500–4500 kbps |
| **Video encoder** | H.264 |
| **Frame rate** | 30 fps |
| **Keyframe interval** | 2 seconds |
| **Audio bitrate** | 256–320 kbps |
| **Audio encoder** | AAC, 44.1 kHz, Stereo |
Then start streaming — listeners auto-tune via Base FM.
### Go live via agent (autonomous DJ)
Agents running in a managed runtime with `ffmpeg` available can broadcast autonomously using the pre-built ffmpeg command returned by `POST /api/basefm/streams`. The response includes an `ffmpeg` object with a ready-to-run command that uses the default baseFM artwork image and generates silent audio — no external media source is required. To use a different visual, swap the image URL in the command.
You can check whether `ffmpeg` is available in the runtime using the [instance details endpoint](/api-reference/agents#get-instance-details) (`ffmpegAvailable` field) or the [gateway status endpoint](/api-reference/gateway#gateway-status) (`runtime.ffmpeg.available` field).
The baseFM DJ Streaming skill is automatically installed on agents provisioned through the managed runtime. It provides tools for creating streams, fetching live DJs, and generating ffmpeg broadcaster commands.
### Session management
Each DJ session has a **2-hour maximum duration**. You can check remaining time or end a session early via the [streaming API](/api-reference/streaming#check-session-status). Sessions that exceed the time limit are automatically ended.
### Replay archive
By default, ending a session deletes all Mux replay assets to prevent unintended storage costs. To preserve a replay for later playback, pass `archive: true` when [ending the session](/api-reference/streaming#end-session). Archive retention is opt-in, requires the owning Agentbot account, and charges credits based on configured archive pricing. If archive pricing is not configured or the account has insufficient credits, the request is rejected and no assets are deleted.
## Pricing
| Tier | Access |
| -------------------- | -------------------------------------------------------------- |
| **Free (BASEFM)** | Hold 1,250,000+ \$BASEFM tokens on Base |
| **Free (Community)** | Builder or Whale tier claimed holder via the community program |
| **Paid** | £10/month for non-BASEFM holders (covers Mux costs) |
## Solana holder benefits
Agentbot token holders on Solana unlock additional baseFM perks based on their balance. Use the [verify holder benefits](/api-reference/solana#verify-holder-benefits) endpoint to check eligibility.
| Tier | Minimum balance | baseFM perk |
| ----------- | --------------- | -------------------------------------------------- |
| **Holder** | 1,000 tokens | Access to exclusive baseFM DJ streams |
| **Builder** | 10,000 tokens | Early access to new features + premium playlists |
| **Whale** | 100,000 tokens | VIP community chat + voting rights + revenue share |
**Agentbot token mint:** `9V4m199eohMgy7bB7MbXhDacUur6NzpgZVrhfux5pump` (Solana)
## DJ identity linking
You can link your Base wallet address to your Agentbot account to connect your baseFM DJ profile. Once linked, your dashboard shows your DJ name, avatar, follower count, show history, listener stats, and tip totals pulled from baseFM. Your agent can then broadcast on your behalf and appear in the baseFM schedule under your identity.
Use the [baseFM identity API](/api-reference/basefm-identity) to save your wallet and retrieve your DJ stats programmatically.
## Use cases
* **Live video + audio DJ sessions** — Verified agents host video and audio shows on Base FM (up to 2 hours per session)
* **Autonomous agent broadcasting** — Agents with `ffmpeg` available in the managed runtime can broadcast autonomously using the pre-built ffmpeg command from the streaming API
* **BASEFM token gating** — Holders with 1,250,000+ \$BASEFM can stream
* **Solana holder benefits** — Agentbot token holders on Solana unlock exclusive streams, early features, and VIP access based on balance tier
* **Community guest pass** — Builder and Whale tier community members can stream without the full BASEFM threshold
* **Listener routing** — Fans tune in via HLS or web player with automatic playback
* **Real-time notifications** — "DJ Snake just went live on Base FM" via Telegram
## Requirements
| Tier | Check Live DJs | Verify Access | Create Stream |
| ---------- | -------------- | ------------- | ------------- |
| Solo | ✅ | ✅ | ❌ |
| Collective | ✅ | ✅ | ❌ |
| Label | ✅ | ✅ | ✅ |
| Network | ✅ | ✅ | ✅ |
## Integration Points
* **\$BASEFM Token:** `0x9a4376bab717ac0a3901eeed8308a420c59c0ba3`
* **Base FM API:** `https://api.basefm.space`
* **Mux:** [mux.com/docs](https://mux.com/docs)
* **Base FM:** [basefm.space](https://basefm.space)
# BlockDB
Source: https://docs.agentbot.raveculture.xyz/services/blockdb
The granular music genome. Query 100M+ ethically licensed components.
# BlockDB
**The granular music genome.** Query 100M+ ethically licensed components with onchain attribution.
## Overview
BlockDB decomposes music into granular components—"Blocks"—that can be queried, sampled, and remixed. Every retrieval is logged onchain, ensuring transparent provenance and real-time royalty payments to original creators.
## Features
### Block-Level Retrieval
Query specific music components:
* **Melodic fragments** — hooks, leads, basslines
* **Rhythmic patterns** — drum loops, breaks, percussion
* **Textural layers** — pads, atmospheres, FX
* **Vocal samples** — one-shots, phrases, ad-libs
### Royalty Transparency
Every Block retrieval triggers:
1. Onchain log entry (Base network)
2. Creator wallet attribution
3. Real-time USDC split distribution
4. Verifiable audit trail
### Music Lens API
Transform raw audio data into actionable intelligence:
| Function | Use Case |
| ------------------ | ------------------------------------------ |
| Mood Analysis | Categorize tracks by energy, vibe, emotion |
| Tempo Detection | BPM analysis for DJ set curation |
| Key Identification | Harmonic mixing recommendations |
| Trend Intelligence | Global mood/tempo shifts in real-time |
## Pricing
| Tier | Monthly Queries | Price |
| ---------- | --------------- | -------- |
| Solo | 100 | Included |
| Collective | 5,000 | Included |
| Label | Unlimited | Included |
| Network | Unlimited | Included |
**Overage:** £0.001 per Block retrieval (attribution logged onchain)
## Getting Started
```javascript theme={"dark"}
// Query BlockDB via Agentbot API
const block = await agentbot.blocks.query({
mood: 'dark',
bpm: { min: 128, max: 135 },
tags: ['techno', 'basement'],
limit: 10
});
// Each retrieval logs attribution onchain
console.log(block.attribution); // { txHash, creator, royalty_split }
```
## Use Cases
* **Demo curation** — Find similar tracks to evaluate submissions
* **Playlist building** — Query by mood/tempo for cohesive sets
* **A\&R research** — Identify gaps in your catalog
* **Remix sourcing** — Find compatible stems for collaborations
# Data Sources
Source: https://docs.agentbot.raveculture.xyz/services/data-sources
Connect your agents to music data, blockchain, and the open web.
# Data Sources
**Unified data layer for autonomous music agents.** Agentbot agents read, write, and act on data from databases, blockchains, AI models, and external APIs — all through a single integration surface.
## Overview
Every agent needs data. Agentbot provides a layered data architecture — from local storage to onchain reads — so your agents can query, persist, and act on real-time information without custom plumbing.
## Source Categories
### Databases
| Source | Purpose | Access |
| --------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **PostgreSQL (Neon)** | User data, agent config, workflows, billing | `DATABASE_URL` env var |
| ~~**Redis**~~ | ~~Caching, session state~~ | ~~`REDIS_URL` env var~~ **Deprecated** — a standalone Redis instance is no longer required. General API rate limiting uses in-process middleware. |
| **Upstash KV** | Social post rate limiting, duplicate detection | `KV_REST_API_URL` and `KV_REST_API_TOKEN` env vars |
| **BlockDB** | Music metadata, audio components, rights | [BlockDB docs](/services/blockdb) |
### Blockchain
| Source | Chain | Use Case |
| ---------------- | ----------- | ----------------------------------- |
| **Base Mainnet** | Ethereum L2 | Token balances, NFT ownership, USDC |
| **Base Sepolia** | Testnet | Development and staging |
| **CDP Wallets** | Base | Agent treasury, payments, swaps |
### AI Providers (BYOK)
| Provider | Models | Notes |
| -------------- | ---------------- | ------------------------------------ |
| **OpenRouter** | 300+ models | Default provider, widest selection |
| **Anthropic** | Claude 3.5/Opus | Strong reasoning, long context |
| **OpenAI** | GPT-4o/o3 | Vision, function calling |
| **Google** | Gemini 2.0 | Multimodal, fast inference |
| **Groq** | Llama 3, Mixtral | Ultra-fast inference, lowest latency |
All providers are **Bring Your Own Key** — no markup on API costs.
### External APIs
| Service | Capability |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **Music Lens API** | Mood analysis, tempo detection, key identification |
| **Weather** | Current conditions and forecasts |
| **Web Search** | Real-time web search for agent queries |
| **Base FM** | Onchain radio submission queue |
| **Notion** | Sync databases, pages, workflows |
| **Browser Automation** | Autonomous web scraping and form filling |
| **ClawMerchants** | 15 live data feeds — DeFi yields, token anomalies, security intel, market data, and more ([API reference](/api-reference/clawmerchants)) |
### Payments
| Provider | Type | Data Available |
| ---------- | -------------- | ---------------------------------------- |
| **Stripe** | Credit card | Subscriptions, invoices, credit balances |
| **x402** | USDC (Base) | Onchain payment receipts |
| **MPP** | Crypto (Tempo) | Decentralized payment records |
## Configuration
Set data source credentials in your `.env`:
```bash theme={"dark"}
# Database
DATABASE_URL=postgresql://user:pass@host:5432/agentbot
# AI Providers (at least one required)
OPENROUTER_API_KEY=sk-or-...
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
# Blockchain
CDP_API_KEY_NAME=your-key-name
CDP_API_KEY_PRIVATE_KEY=your-private-key
```
## Architecture
```
┌─────────────────────────────────────────────┐
│ AGENT CONTAINER │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Memory │ │ Skills │ │ A2A Bus │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
└───────┼──────────────┼─────────────┼────────┘
│ │ │
┌────▼──────────────▼─────────────▼────┐
│ DATA SOURCE LAYER │
│ │
│ ┌───────┐ ┌───────────┐ │
│ │ PG │ │Blockchain │ │
│ │(Neon) │ │ (Base) │ │
│ └───────┘ └───────────┘ │
│ │
│ ┌───────┐ ┌───────┐ ┌───────────┐ │
│ │AI APIs│ │BlockDB│ │ External │ │
│ │(BYOK) │ │ │ │ (Skills) │ │
│ └───────┘ └───────┘ └───────────┘ │
└──────────────────────────────────────┘
```
## Data Isolation
Multi-tenant deployments enforce strict data boundaries:
* Each user's agent data is isolated via `userId` scoping
* Database queries filter by authenticated session
* BlockDB queries include creator attribution
* Blockchain reads are per-wallet (no shared state)
# Skills Marketplace
Source: https://docs.agentbot.raveculture.xyz/services/skills-marketplace
Extend your crew with music, creative, and developer AI capabilities
# Agent Skills Marketplace
**Extend your agents with music, creative, and developer capabilities.** From artwork generation to container orchestration.
## Overview
The Skills Marketplace lets you equip your agents with specialized capabilities designed for music operations and platform development. Each skill is a modular AI capability that integrates with your agent workflows.
## Available Skills
Auto-generate release-ready promotional art and video thumbnails using Stable Diffusion XL.
**Capabilities:**
* Album cover generation
* Social media assets (Instagram, Telegram, Discord)
* Video thumbnails
* Merch mockups
**Use case:** "Generate 5 Instagram story templates for my new release"
Deep catalog digging via BlockDB similarity search. Find tracks that match any audio fingerprint.
**Capabilities:**
* Similar sound detection
* Sample clearance research
* Influencer tracking
* Catalog gap analysis
**Use case:** "Find 10 tracks similar to this demo that were released in the last 6 months"
Analyze BPM, key, and energy curves across your entire catalog to build perfect DJ sets.
**Capabilities:**
* Energy flow analysis
* Harmonic mixing suggestions
* Crowd reading integration
* Set pacing optimization
**Use case:** "Build a 2-hour closing set that starts at 120 BPM and peaks at 138"
Fan segmentation, lifecycle tracking, and automated merch drop campaigns.
**Capabilities:**
* Fan persona mapping
* Purchase behavior prediction
* Automated email/SMS campaigns
* Churn prediction
**Use case:** "Send a personalized promo to everyone who bought tickets but didn't buy merch"
Track streaming royalties across Spotify, Apple Music, Beatport with automatic split calculations.
**Capabilities:**
* Multi-platform royalty aggregation
* Automatic split calculations
* USDC settlement ready
* Historical trend analysis
**Use case:** "Show me this quarter's streaming revenue by platform"
Submit demos to labels and Base FM for airplay consideration with AI pitch optimization.
**Capabilities:**
* Label matching algorithm
* Pitch optimization
* A\&R feedback analysis
* Submission tracking
**Use case:** "Submit my demo to labels that play dark techno"
Sell tickets with USDC payments on Base via x402 protocol. Built-in payment processing.
**Capabilities:**
* x402 USDC payments
* Multiple ticket tiers (GA, VIP, Early Bird)
* Automatic confirmation
* Refund processing
**Use case:** "Create a ticket for my next warehouse event"
Schedule events across Telegram, Discord, WhatsApp, Email with recurring support.
**Capabilities:**
* Multi-channel broadcast
* Recurring events (daily/weekly/monthly)
* Timezone support
* RSVP tracking
**Use case:** "Schedule a weekly newsletter every Monday at 6pm"
Find and book venues worldwide. Filter by city, capacity, price, and amenities.
**Capabilities:**
* Global venue database (UK, Europe, US, Asia)
* Capacity filtering
* Price comparison
* Direct contact integration
**Use case:** "Find a venue in London for 500 people under £2000"
Discover festivals globally, compare lineups, and get personalized recommendations.
**Capabilities:**
* Festival search by genre/country
* Lineup comparison
* Budget recommendations
* UK and Europe specialists
**Use case:** "Find techno festivals in the UK under £350"
Build multi-platform chat bots using a single TypeScript SDK.
**Capabilities:**
* Slack, Teams, Discord, Google Chat, GitHub, Linear
* AI streaming integration
* Interactive JSX cards
* Webhook handlers
**Use case:** "Connect my agent to Slack and Discord with a single SDK"
Production error monitoring and log streaming via Sentry.
**Capabilities:**
* Issue management and triage
* Real-time log streaming
* Distributed tracing
* Project and team management
**Use case:** "Monitor my agent container for runtime errors in production"
Best practices for building and managing agent containers.
**Capabilities:**
* Container isolation and security
* Plan-based resource limits (solo through network)
* Persistent state management
* Health check configuration
**Use case:** "Set up a production-ready container for my agent with proper resource limits"
Persistent state management and multi-agent coordination patterns.
**Capabilities:**
* Prisma state management
* Agent-to-agent messaging
* Scheduled tasks with node-cron
* Drizzle ORM migrations
**Use case:** "Coordinate three agents with shared state and leader election"
CLI reference for deploying and managing agents.
**Capabilities:**
* Agent provisioning and lifecycle management
* Secrets management
* Log streaming
* Vercel and Docker deployment
**Use case:** "Deploy my agent to production and stream logs for debugging"
Review agent code against production best practices.
**Capabilities:**
* Security audit checklist
* State management review
* Error handling patterns
* Anti-pattern detection with severity levels
**Use case:** "Review my agent code for security issues before deploying to production"
## Installing Skills
```javascript theme={"dark"}
// Install a skill for your agent
const agent = await agentbot.agents.get('my-label-bot');
// Add Visual Synthesizer
await agent.skills.install('visual-synthesizer');
// Now your agent can generate images
const artwork = await agent.generate.artwork({
style: 'techno',
mood: 'dark-industrial',
format: 'instagram-story'
});
```
## Marketplace safety and trust tiers
Every skill in the marketplace is automatically scanned for dangerous code patterns before it can be created or installed. The scanner assigns a trust tier to each skill:
| Tier | Description |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| **Trusted** | Platform-authored or manually approved partner skills. Auto-install allowed and eligible for featured placement. |
| **Verified** | User-created skills with a source URL that pass static checks. Installable with a visible trust badge. |
| **Review** | Skills that pass hard blocks but have multiple warnings or no source URL. Installable but not promoted. |
| **Blocked** | Skills that match dangerous code patterns. Cannot be created or installed. |
Skills containing patterns like shell injection, `eval()`, `process.env` access, or destructive commands are automatically blocked. You can pre-check a skill before submitting it using the [verify endpoint](/api-reference/skills#verify-skill).
See the [Skills API reference](/api-reference/skills#scan-object) for the full scan response shape.
## Custom skills
You can publish your own skills to the marketplace using the create endpoint. Custom skills are visible to all users once created. All submissions are automatically scanned for safety — skills that fail the scan are rejected.
```bash theme={"dark"}
curl -X POST https://agentbot.sh/api/skills/create \
-H "Content-Type: application/json" \
-H "Cookie: " \
-d '{
"name": "Mix Analyzer",
"description": "Analyzes track mix quality and returns mastering suggestions",
"category": "music",
"code": "",
"sourceUrl": "https://github.com/example/mix-analyzer"
}'
```
| Field | Limit | Required |
| ------------- | ------------------------------ | -------- |
| `name` | 80 chars, must be unique | Yes |
| `description` | 600 chars | Yes |
| `category` | 40 chars, defaults to `custom` | No |
| `code` | 2000 chars | No |
| `sourceUrl` | 300 chars | No |
Providing a `sourceUrl` improves your skill's trust tier. Skills without a source URL are assigned the `review` tier by default.
See the [Skills API reference](/api-reference/skills) for the full response shape and error codes.
## Pricing
Skills are included in all tiers. Some skills require external API keys:
* **Visual Synthesizer:** Requires Replicate API key (pay direct)
* **BlockDB queries:** Included per tier limits
***
## Jobs Board
**Hire talent or find your next role in the agent ecosystem.** The Jobs Board connects employers with AI agent developers, operators, and music tech professionals.
### Features
* **Browse Jobs** — View local and external job listings from across the agent ecosystem
* **External Integration** — Auto-fetches jobs from git-city API every 5 minutes
* **Career Profiles** — Create your profile to track applications and get alerts
* **Post Jobs** — Employers can list positions with full management dashboard
* **GitHub Sponsors** — Support the platform via GitHub Sponsors
### Endpoints
| Method | Endpoint | Description |
| ------ | --------------------- | ---------------------------- |
| GET | `/api/jobs/board` | Get all jobs with pagination |
| POST | `/api/jobs/apply` | Submit job application |
| GET | `/api/jobs/career` | Get career profile |
| POST | `/api/jobs/companies` | Create/update company |
| GET | `/api/jobs/external` | Fetch external jobs |
| GET | `/api/jobs/sponsors` | Get sponsor tiers |
### Access
Visit `/jobs` on the platform to access the full Jobs Board interface.
# Skills
Source: https://docs.agentbot.raveculture.xyz/skills
50+ installable agent capabilities
# Skill Marketplace
Skills are modular capabilities you install onto your agents. Each skill runs inside the agent's OpenClaw container and can be hot-loaded without restart.
## Categories
### Channels
| Skill | Description |
| ----------------- | ------------------------------------------------ |
| Telegram | Bot commands, messages, groups |
| Discord | Slash commands, embeds, voice channels |
| WhatsApp | Message templates, media, status updates |
| WhatsApp Business | Automated replies, labels, catalogs |
| Slack | Post to channels, create threads, slash commands |
### Music & Creative
| Skill | Description |
| ------------------- | -------------------------------------------------- |
| Royalty Tracker | Track streaming royalties across platforms in USDC |
| Demo Submitter | Submit demos to Base FM for airplay |
| Visual Synthesizer | Generate release artwork via Stable Diffusion XL |
| Track Archaeologist | Deep catalog digging via BlockDB similarity search |
| Setlist Oracle | BPM, key, energy curves for perfect DJ sets |
| Music Generator | Create music with Google Lyria or MiniMax |
| Video Generator | AI video via xAI Grokin, Runway, or Wan |
### Events
| Skill | Description |
| ----------------- | -------------------------------------------------- |
| Guestlist Manager | RSVPs, check-ins, capacity limits |
| Event Ticketing | USDC ticket sales via x402 protocol |
| Event Scheduler | Cross-platform scheduling with recurring support |
| Venue Finder | Worldwide venue search with capacity/price filters |
| Festival Finder | Global festival discovery with lineup comparison |
### Finance
| Skill | Description |
| ------------------ | ----------------------------------------------- |
| USDC Payments | Accept payments on Base, generate payment links |
| Instant Split | Revenue splitting in USDC |
| Booking Settlement | Booking payments processing |
| Community Treasury | Multi-sig treasury management |
| Invoice Generator | Create and send USDC invoices |
### Development & Infrastructure
| Skill | Description |
| ----------------- | ----------------------------------------------------------------------------------------------- |
| Chat SDK | Multi-platform bot SDK for Slack, Teams, Discord, Google Chat, GitHub, and Linear |
| Sentry CLI | Production error monitoring, log streaming, and distributed tracing via Sentry |
| Docker Containers | Best practices for building agent containers with isolation, health checks, and resource limits |
| Stateful Agents | Persistent state management, real-time coordination, and Drizzle ORM migrations |
| Deploy CLI | CLI reference for agent provisioning, secrets management, and log streaming |
| Code Review | Review agent code against production best practices with anti-pattern detection |
### Productivity
| Skill | Description |
| ------------------ | --------------------------------------------------- |
| Google Calendar | Schedule events, manage availability, set reminders |
| Email | Send/receive emails with newsletter support |
| Browser Automation | Browse websites, fill forms, scrape data |
| File Manager | Upload, download, organize files |
| Webhooks | Connect to any API with HTTP requests |
## Installing Skills
### Via Dashboard
Navigate to **Dashboard > Skills** and click **Install** on any skill.
### Via API
```bash theme={"dark"}
POST /api/skills
{
"skillId": "skill_id",
"agentId": "agent_id"
}
```
### Creating Custom Skills
```bash theme={"dark"}
POST /api/skills/create
{
"name": "My Custom Skill",
"description": "What it does",
"category": "custom",
"code": "// skill implementation"
}
```
## Skill Deployment
When installed, skills are deployed to the agent's OpenClaw gateway on port 18789. If the gateway is temporarily unreachable, the skill is saved to the database and syncs automatically on next container restart.
# Troubleshooting
Source: https://docs.agentbot.raveculture.xyz/troubleshooting
Common issues and how to fix them.
# Troubleshooting
Common issues when building, deploying, and running Agentbot agents.
## Installation Issues
```bash theme={"dark"}
npm install --legacy-peer-deps
```
Agentbot uses React 19 which some packages haven't updated for yet. The `--legacy-peer-deps` flag resolves most conflicts.
```bash theme={"dark"}
npx prisma generate
```
Prisma client must be generated before build. If you see `@prisma/client did not initialize`, run the generate command manually.
```bash theme={"dark"}
lsof -i :3000
kill -9
```
Or use a different port:
```bash theme={"dark"}
PORT=3001 npm run dev
```
## Deployment Issues
Check that all imports use the `@/` alias correctly. The `@/` prefix maps to the `web/` directory. Common mistake:
```typescript theme={"dark"}
// ❌ Wrong
import { auth } from '../../../lib/auth'
// ✅ Right
import { auth } from '@/app/lib/auth'
```
The health check at `/health` must respond within 60 seconds. Common causes:
* Database connection string is wrong (check `DATABASE_URL`)
* Missing environment variables causing startup crash
Check Railway logs for the actual error.
Agentbot reads env vars at startup. After changing them:
* **Vercel:** Redeploy from dashboard or `vercel --prod`
* **Railway:** Service auto-restarts on env change
* **Local:** Restart the dev server (`npm run dev`)
## Agent Issues
1. Check agent status: `GET /api/agents/{id}`
2. Verify the channel token (Telegram/Discord/WhatsApp) is valid
3. Check the agent container logs
4. Ensure the AI provider API key is set and has credits
Each agent has a memory limit based on plan:
| Plan | Memory | CPU | Description |
| ---------- | ------ | ------ | ------------------------------------ |
| Solo | 2 GB | 1 vCPU | Trial / light workloads only |
| Collective | 4 GB | 2 vCPU | Recommended production floor |
| Label | 8 GB | 4 vCPU | Heavy production + browser/tool work |
| Network | 16 GB | 8 vCPU | High-throughput production |
If you're hitting memory limits, check for memory leaks in custom skills or upgrade your plan. The Solo tier (1 vCPU / 2 GB) is the trial/light-use floor — for production workloads, we recommend at least Collective (2 vCPU / 4 GB).
```bash theme={"dark"}
# Open the user-facing skills surface
GET /dashboard/skills
# Marketplace/API install flow
POST /api/skills
{ "skill": "weather" }
```
Skills are loaded at agent startup. If a skill fails to load, the agent will start without it and log the error.
If you see **"Agent offline. Install your agent first, then retry installing skills."** in the dashboard, the skill was saved to your account but the agent's gateway is not reachable.
This happens when the API returns `"deployed": false` with a `deployWarning` field. To resolve:
1. Verify your agent is running: `GET /api/agents/{id}`
2. Start or restart the agent from the dashboard
3. The skill will sync automatically once the agent comes back online
4. You can also trigger a manual sync using `POST /api/agents/{id}/sync`
See the [Skills API reference](/api-reference/skills#install-skill) for full response details.
## Billing Issues
The legacy `/api/checkout` endpoint is deprecated. Use:
```http theme={"dark"}
GET /api/stripe/checkout?plan=solo
```
1. Verify your API key is valid (test it with curl)
2. Check the provider name matches exactly: `openrouter`, `anthropic`, `openai`, `google`, `groq`
3. Ensure the key has credits/quota remaining
4. Disable and re-enable BYOK from the billing dashboard
## Getting Help
* **Discord:** [discord.gg/vTPG4vdV6D](https://discord.gg/vTPG4vdV6D) — Community support
* **GitHub Issues:** [Eskyee/agentbot-opensource](https://github.com/Eskyee/agentbot-opensource/issues) — Bug reports
* **GitHub Discussions:** [Eskyee/agentbot-opensource/discussions](https://github.com/Eskyee/agentbot-opensource/discussions) — Questions and ideas