Skip to content

Start

From a test key to a verified receipt.

  1. 1Get a test key

    Sign in with Google or email and create a key. It negotiates with the sandbox store only and cannot reach a real store or move money.

  2. 2Negotiate the Demo Monitor

    One command: a sample buyer opens a session, bids, reaches an agreement, checks the signed receipt on your machine, and prints a link to see it in the verifier.

    export VALYZEN_API_KEY=vz_pk_test_…   # from step 1
    
    # A sample buyer negotiates the Demo Monitor, verifies the receipt, prints a verify link
    uvx valyzen try
    
    # or: pip install valyzen && valyzen try

    TypeScript or JavaScript (Node 20 or later, browsers, Deno, Bun)

    npm install @valyzen/sdk
    
    import { GatewayClient, verifyReceipt, verifyLink } from '@valyzen/sdk'
    
    const client = new GatewayClient(process.env.VALYZEN_API_KEY, { baseUrl: 'https://api.valyzen.ai' })
    const session = await client.openSession('DEMO-MONITOR-27', { agentId: 'my-first-bot' })
    while (!session.finished) {
      const edge = session.fairEdgeMinor
      const standing = session.merchantOfferMinor
      if (standing !== null && standing <= edge) await session.accept()
      else await session.offer(edge, { inclusions: session.tableInclusions })
    }
    const receipt = await session.receipt()
    const result = await verifyReceipt(receipt, { allowTest: true }) // sandbox receipts are test mode
    console.log(result.ok, result.signedTerms, await verifyLink(receipt, 'https://api.valyzen.ai'))
    Or with plain HTTP requests
    export VZ_KEY=vz_pk_test_…   # from step 1
    
    # What the sandbox store will negotiate over
    curl -s -H "Authorization: Bearer $VZ_KEY" https://api.valyzen.ai/v1/catalogue
    
    # Open a session on the Demo Monitor; the merchant makes the first offer
    curl -s -X POST https://api.valyzen.ai/v1/sessions \
      -H "Authorization: Bearer $VZ_KEY" -H "Content-Type: application/json" \
      -d '{"sku":"DEMO-MONITOR-27","buyer":{"agent_id":"my-first-bot"}}'
    
    # Keep session_id and session_token from the reply, then take the offer
    export SID=… VZ_ST=vz_st_test_…
    curl -s -X POST https://api.valyzen.ai/v1/sessions/$SID/messages \
      -H "Authorization: Bearer $VZ_ST" -H "Content-Type: application/json" \
      -d '{"type":"accept"}'
    
    # The signed receipt
    curl -s -H "Authorization: Bearer $VZ_ST" https://api.valyzen.ai/v1/sessions/$SID/receipt > receipt.json
  3. 3Verify the receipt

    Open the link the trial prints, or paste receipt.json into the verifier. It checks the signature in your browser against the key inside the receipt and Valyzen's published keys; nothing is sent anywhere. Sandbox receipts are marked as test mode: anyone with a test key can make one, so they show the loop works, not that a purchase happened.

  4. 4Or negotiate from chat

    Connect an MCP host to https://api.valyzen.ai/mcp and sign in with the same account, then ask it to negotiate the Demo Monitor.

    Claude Code

    claude mcp add --transport http --client-id 2a7kinrpg29uuc7503j10qqsr7 --callback-port 33418 valyzen https://api.valyzen.ai/mcp

    Claude: Settings, Connectors, add a custom connector with that URL; under Advanced settings set the OAuth client id orqs263f7h1feiqhaanq8bli8.

    ChatGPT (developer mode): add an MCP server with that URL and OAuth client id 61ojs6dpfsqk62vrttg1hob1b4.

  5. 5Who holds your limit

    A buyer can send a commitment to its private limit when it opens a session. When you do, the limit stays on your machine and you reveal it only after the session ends. When you do not (the plain requests above, or a chat host), the gateway records the commitment on your behalf, and the receipt says which of the two happened. The sample buyer never sends its limit at all: it only ever sends offers.

  6. 6Next

    The SDKs are open source, Apache-2.0: valyzen-sdk on GitHub.