Getting Started

Getting Started

Get AgentWallie running in your app in 5 minutes.

All API requests use the base URL https://api.agentwallie.com. You need a private key (sk_...) for management calls and a public key (pk_...) for client SDKs.

Create a project and get your API keys

Sign up at agentwallie.com (opens in a new tab) and create a project. You can also create one via the API:

curl -X POST https://api.agentwallie.com/v1/projects \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_your_private_key" \
  -d '{"name": "My App"}'

Expected response:

{
  "id": "proj_abc123",
  "name": "My App",
  "apiKeys": [
    { "key": "pk_abc123...", "type": "public" },
    { "key": "sk_abc123...", "type": "private" }
  ]
}

Save both keys. The public key goes in your mobile app. The private key is for server-side and management API calls.

Create a product and paywall

Set up an in-app purchase product, then create a paywall that references it. Paywalls are JSON documents rendered natively by the SDK.

curl -X POST https://api.agentwallie.com/v1/projects/proj_abc123/paywalls \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_abc123..." \
  -d '{
    "name": "Onboarding Paywall",
    "slug": "onboarding-v1",
    "schema": {
      "version": "1.0",
      "name": "onboarding-v1",
      "settings": { "presentation": "modal", "close_button": true },
      "theme": { "primary": "#007AFF", "background": "#FFFFFF" },
      "products": [
        { "slot": "primary", "label": "Yearly" },
        { "slot": "secondary", "label": "Monthly" }
      ],
      "components": [
        { "type": "text", "id": "title", "props": { "content": "Unlock Everything", "text_style": "title1", "alignment": "center" } },
        { "type": "product_picker", "id": "products", "props": { "layout": "horizontal" } },
        { "type": "cta_button", "id": "cta", "props": { "text": "Start Free Trial", "action": "purchase", "product": "selected" } }
      ]
    }
  }'

Expected response:

{
  "id": "pw_xyz789",
  "name": "Onboarding Paywall",
  "slug": "onboarding-v1",
  "status": "draft"
}

Publish the paywall to make it visible to SDKs:

curl -X POST https://api.agentwallie.com/v1/projects/proj_abc123/paywalls/pw_xyz789/publish \
  -H "Authorization: Bearer sk_abc123..."

Expected response:

{ "id": "pw_xyz789", "status": "published" }

See the Paywall Schema reference for the full specification.

Create a campaign

Campaigns connect placements (triggers in your app) to audiences and paywalls:

curl -X POST https://api.agentwallie.com/v1/projects/proj_abc123/campaigns \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_abc123..." \
  -d '{"name": "Onboarding Campaign", "status": "active"}'

Expected response:

{
  "id": "camp_def456",
  "name": "Onboarding Campaign",
  "status": "active"
}

Add placements and audience filters to target the right users. See the Campaigns API for details.

Integrate the SDK

Add the Swift Package:

https://github.com/cynisca/AgentWallieKit.git

Configure on launch:

import AgentWallieKit
 
@main
struct MyApp: App {
    init() {
        AgentWallie.configure(apiKey: "pk_your_public_key")
    }
 
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

Register a placement:

AgentWallie.shared.register(placement: "onboarding_complete") {
    showProFeature()
}

See the iOS SDK guide for the full reference.

Verify the integration

When a free user triggers the onboarding_complete placement, the SDK:

  1. Fetches the compiled config from https://api.agentwallie.com
  2. Evaluates the campaign and audience filters
  3. Renders the paywall natively from the JSON schema
  4. Handles the purchase flow via StoreKit 2 / Google Play Billing

Confirm it works by checking your dashboard for incoming events, or query the analytics API:

curl https://api.agentwallie.com/v1/projects/proj_abc123/analytics/events?limit=5 \
  -H "Authorization: Bearer sk_abc123..."

Expected response:

{
  "events": [
    { "type": "paywall_view", "placement": "onboarding_complete", "timestamp": "2026-03-27T12:00:00Z" },
    { "type": "purchase_start", "placement": "onboarding_complete", "timestamp": "2026-03-27T12:00:05Z" }
  ]
}

Using the MCP Server (AI Agents)

If you use Claude Code or Cursor, add the MCP server to manage paywalls, campaigns, and experiments directly from your agent:

{
  "mcpServers": {
    "agentwallie": {
      "command": "npx",
      "args": ["tsx", "/path/to/agentwallie/packages/mcp-server/src/index.ts"],
      "env": {
        "AGENTWALLIE_API_URL": "https://api.agentwallie.com",
        "AGENTWALLIE_API_KEY": "sk_your_private_key"
      }
    }
  }
}

See the MCP Server page for the full tool reference.