Skip to Content
Core ConceptsCredits & Payments

Credits & Payments

The platform utilizes a credit-based metering system to track usage and facilitate permissionless access.

Credit System

Usage is metered in Credits. The standard conversion rate is 1 Credit ≈ $0.001.

Operation Costs

OperationCost (Credits)Description
Create5Ingesting and vectorizing a new memory.
Search2Semantic search query against the index.
Update2Modifying existing memory content or metadata.
Get1Retrieving a memory by its specific ID.
Delete1Removing a memory from the index.

Batch Operations

Batch endpoints use flat pricing (2× single operation) regardless of batch size, offering significant savings at scale.

OperationCost (Credits)Max ItemsSavings vs Individual
Batch Search410 queriesUp to 80%
Batch Delete2100 IDsUp to 98%
Batch Update4100 IDsUp to 98%

Pay-Per-Use Model

Unlike traditional cloud services that require provisioning servers based on predicted usage, zkStash operates on a true pay-per-use model.

No Idle Costs

You’re only charged for the resources you actively use. There’s no need to over-provision for peak loads or pay for idle capacity during quiet periods. This aligns pricing directly with actual utilization.

Flexibility

Our system scales seamlessly based on your demand:

  • Traffic Spikes: Resources scale up automatically to meet demand.
  • Quiet Periods: Resources scale down to minimize costs.

Focus on Innovation

Developers can concentrate on building features rather than optimizing infrastructure. The platform handles scaling automatically, allowing you to focus on creating value for your users.

Storage & Retention

Storage policies vary by plan to accommodate different use cases, from testing to production scaling.

Two Types of Memory Expiration

zkStash has two independent expiration mechanisms:

TypeApplies ToPurposeHow It Works
User TTLAll plansDeveloper-controlled expirationSet ttl or expiresAt when creating/updating memories
System RetentionFree plan onlyPlatform resource management7-day rolling window for unpaid storage

User TTL is your explicit intent—“delete this session context after 1 hour.” It applies regardless of plan.

System Retention is a platform policy—Free tier memories expire after 7 days to manage resources. Paid plans have permanent retention.

Both run on the same background job. User TTL is checked first (for all users), then system retention rules apply (Free tier only).

Plan Limits

PlanIncluded MemoriesRetentionOverage Policy
Free07 Days (Default)Memories deleted after 7 days unless insured.
Starter50,000PermanentMetered billing for excess storage.
Pro500,000PermanentMetered billing for excess storage.

Metered Overages (Paid Plans)

For Starter and Pro plans, storage beyond the included limit is billed automatically via Stripe at the end of the billing cycle.

  • Starter: 20% discount on standard rates.
  • Pro: 40% discount on standard rates.

Storage Insurance (Free Plan)

The Free plan is designed for testing and includes 0 permanent memories. By default, memories are retained for 7 days and then deleted.

To keep memories permanently on the Free plan, you can use Storage Insurance:

  1. Maintain a positive Credit balance in your account.
  2. A daily cron job deducts a small storage fee from your balance.
  3. Cost: ~3.33 Credits per 1,000 memories / day.
  4. If your balance runs out, the 7-day retention policy resumes.

Permissionless Credit Deposits

Autonomous agents can deposit credits via the x402 protocol without requiring a dashboard login or human intervention. This is critical for agents that need to fund their own storage insurance.

Endpoint: POST /api/v1/credits/deposit

Query Parameters:

ParameterTypeDescription
amount_usdnumberAmount to deposit in USD (min: PRICING.MINTOPUPUSD,max:{PRICING.MIN_TOPUP_USD}, max: 1000)

Flow:

  1. Agent calls POST /api/v1/credits/deposit?amount_usd=5
  2. Server returns 402 Payment Required with payment requirements
  3. Agent signs an x402 payment and retries with the x-payment header
  4. Server verifies, settles, and credits the full amount to the balance
  5. Agent receives confirmation with updated balance

Example Response (Success):

{ "success": true, "deposit": { "amount_usd": 5, "credits": 5000 }, "balance": { "credits": 5000, "usd": 5 }, "message": "Deposit successful. Storage insurance is now active." }

This enables self-sovereign agents that can earn revenue and autonomously pay for their own existence—a capability unique to crypto-native AI platforms.

Rate Limits

To ensure fair usage and system stability, we enforce rate limits based on your plan.

PlanRequests / MinuteRequests / HourRequests / Day
Permissionless (x402)103005000
Starter100300050000
Pro50015000250000

x402 Protocol

x402 is an open standard for payment-required HTTP requests. It allows agents to pay for resources directly within the request flow.

Mechanism

  1. Challenge: If a request requires payment, the server responds with a 402 Payment Required status and details about the required payment (amount, token, recipient).
  2. Payment: The agent signs a transaction or message authorizing the payment.
  3. Retry: The agent retries the request with the payment proof (signature) in the x-payment-sig header.

We currently support x402 payments on Solana and Base networks. This enables fully autonomous agents to manage their own operational costs without human intervention.

Last updated on