packages/cloud-frontend/content/monetized-apps.mdx
import { Callout, Steps, Cards } from "@/docs/components";
Build an Eliza Cloud app, route user chat through the app-scoped endpoint, earn creator markup, and deploy the app as a container whose hosting can be paid from earnings before credits.
<div className="status-badge status-new">New</div>project_name as the stable project identifier.@elizaos/app-* package inside Eliza. This is code loaded by an Eliza runtime.POST /api/v1/apps. It owns app hosting metadata, marketplace/domain settings, chat routing, analytics, and monetization settings.Keep the Cloud app id in your project configuration and pass it to the app-scoped chat endpoint. Do not use package names or deployment project names as app IDs.
user signs in and chats with your app
-> your server forwards the user's bearer token to /api/v1/apps/{id}/chat
-> Eliza Cloud charges the user's organization credit balance
-> creator markup is credited to your redeemable earnings
-> daily container billing uses your earnings first, then org credits
-> you redeem available earnings for elizaOS tokens
curl -X POST "https://www.elizacloud.ai/api/v1/apps" \
-H "Authorization: Bearer $ELIZA_CLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My App",
"app_url": "https://placeholder.invalid",
"allowed_origins": ["https://placeholder.invalid"],
"skipGitHubRepo": true
}'
The response includes app.id and a one-time apiKey. Store the app ID in your project; keep API keys server-side only.
curl -X PUT "https://www.elizacloud.ai/api/v1/apps/$APP_ID/monetization" \
-H "Authorization: Bearer $ELIZA_CLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"monetizationEnabled": true,
"inferenceMarkupPercentage": 100,
"purchaseSharePercentage": 10
}'
inferenceMarkupPercentage is the creator markup on app-scoped chat inference. purchaseSharePercentage is reserved for app credit purchase share flows.
const response = await fetch(`${ELIZA_CLOUD_URL}/api/v1/apps/${APP_ID}/chat`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${userStewardJwt}`,
},
body: JSON.stringify({
model: "provider/model-id",
messages: [{ role: "user", content: "Hello" }],
stream: false,
}),
});
Forward the user's bearer token, not your app admin API key, for user-facing chat. The user's organization credit balance is charged and your app's markup is recorded as creator earnings.
import { ElizaCloudClient } from "@elizaos/cloud-sdk";
const cloud = new ElizaCloudClient({ apiKey: process.env.ELIZA_CLOUD_API_KEY });
const { data: container } = await cloud.createContainer({
name: "my-app",
project_name: "my-app",
image: "ghcr.io/acme/my-app:latest",
port: 3000,
cpu: 256,
memory: 512,
desired_count: 1,
health_check_path: "/health",
environment_vars: {
PORT: "3000",
ELIZA_APP_ID: APP_ID,
ELIZA_CLOUD_URL: "https://www.elizacloud.ai",
},
});
When the container is running, patch the Cloud app to the real URL:
curl -X PATCH "https://www.elizacloud.ai/api/v1/apps/$APP_ID" \
-H "Authorization: Bearer $ELIZA_CLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"app_url": "https://my-app.example.com",
"allowed_origins": ["https://my-app.example.com"]
}'
Use Dashboard -> Earnings, or call the redemptions API. Earnings are tracked in dollars; redemptions use pointsAmount, where 100 points equals $1.00.
curl "https://www.elizacloud.ai/api/v1/redemptions/balance" \
-H "Authorization: Bearer $ELIZA_CLOUD_API_KEY"
The optional X-Affiliate-Code header is implemented on the generic chat and messages APIs, including POST /api/v1/chat/completions and POST /api/v1/messages. It credits affiliate markup to the affiliate owner's redeemable earnings.
Daily container billing calculates the container's hosting cost, then tries to pay from the owner's redeemable earnings when payAsYouGoFromEarnings is enabled. Any remainder falls through to organization credits. Containers are suspended only when the configured funding sources cannot cover hosting.