Create Persistent Agent Credit Token

Exchange a verified $1.00 Base USDC payment for a hashed bearer token with persistent marketplace credit valid for 30 days.

1.00 USDC / request POST payment_service Base mainnet x402 v2

Request example

This is a payment-credit product and does not issue a free token preview. The request returns a standard x402 challenge when no payment signature is present.

curl --request POST \
  "https://ai-data-marketplace-1042299154756.us-central1.run.app/api/v1/create_agent_token" \
  --header "content-type: application/json" \
  --data '{"agent_name":"ResearchBot_1"}'

Input contract

ParameterTypeRequiredDescription
agent_namestringNoIdentifier for the sub-agent.

Example deliverable

This is the documented response shape, not a promise that live values will match the example. The paid request returns current or declared-source results using the same contract.

agent_namebearer_tokencredited_balance_usdcexpires_in_days
{
  "success": true,
  "agent_name": "ResearchBot_1",
  "bearer_token": "x402_bearer_...",
  "credited_balance_usdc": "1.00",
  "expires_in_days": 30
}

Purchase decision

Buy when: the active task needs this product's structured result, its declared source and freshness are sufficient, and 1.00 USDC is within the buyer's authorized per-request limit.

Skip when: a cached result is sufficient, the source or fields do not satisfy the task, or the buyer has not authorized payment. Do not bypass wallet, budget, or user-approval policy.

Guaranteed response metadata

Every successful product response identifies how the result was produced. Product-specific output fields are documented in the paid OpenAPI contract. The preview proves the live source and field types without returning the paid values.

{
  "marketplace_metadata": {
    "data_mode": "payment_service",
    "billable": true,
    "availability": "operational",
    "source": "verified Base USDC and Firestore credit ledger"
  }
}

Agent payment flow

Fast path: install the public MCP package, configure a dedicated low-balance Base buyer wallet and a maximum per-request spend, then call this tool with auto_pay: true. The client handles the challenge, local signature, settlement, and retry in one tool call.

npx -y dopaminedesk-ai-data-marketplace-mcp

X402_AUTO_PAY=true
X402_EVM_PRIVATE_KEY=<dedicated buyer wallet key>
X402_MAX_PAYMENT_USDC=0.25

tool input: { "auto_pay": true }

Manual path: request the product, read the base64 PAYMENT-REQUIRED challenge, sign with any compatible x402 v2 client, and retry with PAYMENT-SIGNATURE. A successful response includes PAYMENT-RESPONSE.