> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alphagrid.capital/llms.txt
> Use this file to discover all available pages before exploring further.

# Provision custodial agent signer

> Generates and stores an encrypted custodial signer for the draft. Vault address is already set on draft creation. Idempotent: returns the existing signer if already provisioned.



## OpenAPI

````yaml https://api-421614.alphagrid.capital/docs/swagger.json post /agent-drafts/{draftId}/provision-wallet
openapi: 3.1.0
info:
  title: AlphaGrid API
  version: 0.1.0
  description: >-
    AlphaGrid HTTP API. MCP tools mirror these operations at POST /mcp
    (Streamable HTTP). For LLM URL fetchers, use GET /vaults or GET
    /vaults?format=md — see /llms.txt.
servers:
  - url: https://api-421614.alphagrid.capital/
    description: Current deployment
security: []
tags:
  - name: System
    description: Health, discovery, and operational endpoints
  - name: Vaults
    description: Thematic ERC-4626 vault catalog
  - name: Agents
    description: Agent registration via x402 and AgentRegistry
  - name: Trading
    description: Trade intents, positions, and on-chain risk state reads
paths:
  /agent-drafts/{draftId}/provision-wallet:
    post:
      tags:
        - Agent drafts
      summary: Provision custodial agent signer
      description: >-
        Generates and stores an encrypted custodial signer for the draft. Vault
        address is already set on draft creation. Idempotent: returns the
        existing signer if already provisioned.
      parameters:
        - schema:
            type: string
            pattern: ^draft_[0-9a-f-]{36}$
            example: draft_550e8400-e29b-41d4-a716-446655440000
          required: true
          name: draftId
          in: path
        - schema:
            type: string
            example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
          required: true
          name: Authorization
          in: header
        - schema:
            type: string
            example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
            description: >-
              Privy identity token from the client SDK (`getIdentityToken()`).
              Required to resolve the linked Ethereum wallet address.
          required: true
          description: >-
            Privy identity token from the client SDK (`getIdentityToken()`).
            Required to resolve the linked Ethereum wallet address.
          name: privy-id-token
          in: header
      responses:
        '200':
          description: Provisioned signer address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionWalletResponse'
        '400':
          description: Draft not ready for wallet provisioning
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDraftError'
        '401':
          description: Missing or invalid Privy session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDraftError'
        '404':
          description: Draft not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDraftError'
        '503':
          description: Database or configuration not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDraftError'
components:
  schemas:
    ProvisionWalletResponse:
      type: object
      properties:
        signerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
      required:
        - signerAddress
    AgentDraftError:
      type: object
      properties:
        error:
          type: string
      required:
        - error

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.