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

# Get current user

> Returns the authenticated user as `{id, username, role, address}`, with `address` lowercased. Requires a JWT access token, sent as `Authorization: Bearer <accessToken>` or as the `access_token` cookie. A tenant API key alone returns `401` "Access token not found in cookies or authorization header." because the tenant key never identifies a user.



## OpenAPI

````yaml /openapi.json get /auth/me
openapi: 3.1.0
info:
  title: Vane API
  version: 1.0.0
  summary: Cross-chain and same-chain swaps filled by an open network of solvers.
  description: >-
    Vane turns a swap into an intent: you declare what you want to receive, the
    API returns a per-order deposit address, and a solver fills the order
    against the escrowed deposit ([how solvers fill
    orders](/features/solver-auctions)).


    **Authentication.** Most endpoints accept a tenant API key sent as the
    `x-tenant-api-key` header (accountless integration). The key pre-filled in
    the API playground is a shared public key for evaluating the API. Production
    integrations use their own tenant key, requested from support
    (help@vane.xyz) and kept server-side. A JWT access token from SIWX
    wallet-signature auth also satisfies these endpoints and attributes orders
    to a user account, which adds order history (`GET /v1/orders`) and points.


    **Error behavior.** Errors use the envelope `{statusCode, message, error}`.
    Field order varies and some errors omit `error`. Most business validation
    failures (an unknown token id, a malformed address, an invalid amount, an
    unknown order UUID) return HTTP `500` with a descriptive message, while
    `400` appears only for malformed query parameters. Match on the message text
    for programmatic handling, not just the status codes.


    **The fields `exchange` and `tradePath`** describe how a quote is priced and
    routed across order-book legs. They say nothing about settlement, which
    solvers perform separately.
  contact:
    name: Vane support
    email: help@vane.xyz
    url: https://vane.xyz
  termsOfService: https://vane.xyz/terms-and-conditions
servers:
  - url: https://api.vane.xyz/api
    description: Production
security:
  - tenantApiKey: []
tags:
  - name: Tokens
    description: The token catalog, swap limits, and quotes.
  - name: Orders
    description: Create swap orders and track them to a terminal state.
  - name: Auth
    description: >-
      Optional SIWX wallet-signature authentication. Adds order history and
      points.
paths:
  /auth/me:
    get:
      tags:
        - Auth
      summary: Get current user
      description: >-
        Returns the authenticated user as `{id, username, role, address}`, with
        `address` lowercased. Requires a JWT access token, sent as
        `Authorization: Bearer <accessToken>` or as the `access_token` cookie. A
        tenant API key alone returns `401` "Access token not found in cookies or
        authorization header." because the tenant key never identifies a user.
      operationId: getCurrentUser
      responses:
        '200':
          description: The authenticated user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUser'
              example:
                id: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                username: null
                role: user
                address: '0xa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0'
        '401':
          $ref: '#/components/responses/UnauthorizedJwt'
      security:
        - bearerAuth: []
components:
  schemas:
    AuthUser:
      type: object
      description: The authenticated user.
      properties:
        id:
          type: string
          format: uuid
          description: User id. Appears as `userId` on orders created while signed in.
        username:
          type:
            - string
            - 'null'
          description: Username for the account; may be `null`.
        role:
          type: string
          description: User role. Standard accounts have role `user`.
        address:
          type: string
          description: >-
            Wallet address the account was created with, returned lowercased
            (not EIP-55 checksummed).
      required:
        - id
        - username
        - role
        - address
    Error:
      type: object
      description: >-
        Canonical error envelope. Field order varies and `error` is sometimes
        omitted (the unknown-order `500` returns only `statusCode` and
        `message`); message casing varies too (`Internal Server Error` vs
        `Internal server error`). Most business validation failures return `500`
        with a descriptive message, so match on `message` for programmatic
        handling.
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
        message:
          type: string
          description: >-
            Error description. The most reliable field for distinguishing
            causes.
        error:
          type: string
          description: >-
            HTTP status text, for example `Bad Request`, `Unauthorized`.
            Sometimes absent.
      required:
        - statusCode
        - message
  responses:
    UnauthorizedJwt:
      description: >-
        Missing or invalid JWT access token. A tenant API key alone does not
        satisfy this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Access token not found in cookies or authorization header.
            error: Unauthorized
            statusCode: 401
  securitySchemes:
    tenantApiKey:
      type: apiKey
      in: header
      name: x-tenant-api-key
      x-default: c7eccc0aaed64932a85d35658fa55a4fb2d60cd3d2c529cfd643dc676ee82e82
      description: >-
        Vane's shared tenant key. Contact support for a dedicated key if you
        need custom parameters or separate order tracking.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT from SIWX wallet-signature authentication, sent as `Authorization:
        Bearer <token>` or automatically through HttpOnly cookies in browsers.
        Access tokens last 15 minutes and refresh tokens last 30 days.

````