---
title: "Get runnable wallet-generation snippet — agent executes it; Solentic never sees the secret key"
method: POST
path: "/api/v1/wallet/generate"
tags: ["Wallet"]
---

# Get runnable wallet-generation snippet — agent executes it; Solentic never sees the secret key

`POST /api/v1/wallet/generate`

## Request

- Base URL: `https://solentic.theblueprint.xyz`
- URL: `https://solentic.theblueprint.xyz/api/v1/wallet/generate`
- Auth: none required

Returns runnable code snippets (JavaScript, Python, Solana CLI) under the `runThis` field. Solentic cannot generate the keypair for you — generation is the act of creating the random bytes, and whoever runs Keypair.generate() sees both halves at that instant. By returning code instead of generating server-side, Solentic provably never observes the private key. The agent executes one of the snippets in whatever it has available (code-interpreter tool, sandbox, shell, agent process) and captures `walletAddress` + `secretKey`. After funding the publicKey, the agent calls POST /api/v1/stake (one-shot: pass walletAddress + secretKey, get a confirmed signature back) or, for wallet extensions / multisig, the unsigned-transaction flow (POST /api/v1/stake/transaction → sign locally → POST /api/v1/transaction/submit).

## Response `200`

Local wallet generation code with security model and next steps

- WalletGenerateResponse: Local wallet generation code and instructions. Blueprint never generates or handles private keys.
  - `method` 'LOCAL_GENERATION': Always LOCAL_GENERATION — wallet is generated in the agent's environment
  - `why` string: Explanation of why local generation is used
  - `code` object: Code snippets to generate a wallet locally
    - `javascript` string: Node.js code using @solana/web3.js
    - `python` string: Python code using solders
    - `cli` string: Solana CLI command
  - `nextSteps` object: Step-by-step instructions after generating a wallet
    - `1_generate` string: Run the code above in your environment to create a keypair
    - `2_fund` string: Send SOL to your public key from an exchange or wallet
    - `3_checkBalance` string: API call to verify your wallet balance
    - `4_stake` string: API call to build an unsigned stake transaction
    - `5_sign` string: Sign the returned base64 transaction locally with your keypair
    - `6_submit` string: API call to submit the signed transaction to Solana
  - `securityModel` object: Explanation of the zero-custody security model
    - `privateKey` string: How private keys are handled (never leaves your environment)
    - `publicKey` string: How public keys are used (only identifier sent to Blueprint)
    - `transactions` string: How transactions work (returned unsigned, signed client-side)
    - `custody` string: Custody model (your wallet retains full authority)
  - `_meta` ResponseMeta: Navigation metadata included in most responses
    - `endpoint` string: The endpoint that generated this response
    - `description` string: Brief description of the response
    - `timestamp` string, date-time: ISO 8601 timestamp when this response was generated
    - `relatedEndpoints` object: Related REST endpoints for next actions
    - `relatedTools` object: Related MCP tool names (MCP responses only)
    - `nextSteps` object: Contextual next steps based on response data
    - `verifyThisCode` string: Endpoint to verify code integrity
    - `cacheTtlSeconds` integer: Cache TTL for this response
    - `documentation` string: Link to documentation
    - `support` object: Optional donation info — Blueprint is free, donation-supported infrastructure
      - `address` string: Solana address for donations
      - `message` string: Context about why donations help
      - `donate` string: How to build a donation transaction via API/MCP

## Other responses

- `429`: Rate limited — 100 requests per 60-second sliding window
- `500`: Internal server error

---

[API](https://skmtc.dev/theblueprint/apis/blueprint-staking-api.md) · [All operations](https://skmtc.dev/theblueprint/apis/blueprint-staking-api/llms.txt) · [OpenAPI document](https://skmtc.dev/theblueprint/apis/blueprint-staking-api/revisions/326d6015b851?raw)
