> ## 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.

# Get authenticated session

> Verifies Privy access and identity tokens, upserts the user profile in D1, and returns the wallet address with profile summary. Send `Authorization: Bearer <access_token>` and `privy-id-token: <identity_token>` from the Privy client SDK.



## OpenAPI

````yaml https://api-421614.alphagrid.capital/docs/swagger.json get /auth/me
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:
  /auth/me:
    get:
      tags:
        - Auth
      summary: Get authenticated session
      description: >-
        Verifies Privy access and identity tokens, upserts the user profile in
        D1, and returns the wallet address with profile summary. Send
        `Authorization: Bearer <access_token>` and `privy-id-token:
        <identity_token>` from the Privy client SDK.
      parameters:
        - 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: Authenticated session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
        '401':
          description: Missing or invalid Privy session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '503':
          description: Auth or database not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
components:
  schemas:
    SessionResponse:
      type: object
      properties:
        address:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
        valid:
          type: boolean
          enum:
            - true
        profile:
          $ref: '#/components/schemas/UserProfileSummary'
      required:
        - address
        - valid
        - profile
    AuthError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserProfileSummary:
      type: object
      properties:
        displayName:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
          format: email
        preferredCurrency:
          $ref: '#/components/schemas/PreferredCurrency'
        registeredAt:
          type: string
          format: date-time
        lastLoginAt:
          type: string
          format: date-time
      required:
        - displayName
        - email
        - preferredCurrency
        - registeredAt
        - lastLoginAt
    PreferredCurrency:
      type: string
      enum:
        - USD
        - EUR
        - GBP
        - CHF
        - CZK

````

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