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

# User login and wallet creation

> Login or register a user using a Firebase ID token. If the user does not exist, creates a new user and wallet.
- **idToken**: Firebase ID token
Returns user and wallet details.



## OpenAPI

````yaml /api-reference/krypton_backend.json post /api/v1/login
openapi: 3.1.0
info:
  title: Krypton API
  description: >-
    API documentation for Krypton backend. This API allows user authentication,
    wallet management, USDC transfers, transaction history via Circle and
    Firestore, and marketplace management.
  version: 1.0.0
servers:
  - url: https://api.kryptonfund.com
    description: Production API
  - url: http://127.0.0.1:8000
    description: Local API
security: []
tags:
  - name: wallet
    description: Wallet management, authentication, and USDC transfer endpoints.
  - name: marketplace
    description: Marketplace management endpoints for startups and categories.
  - name: hedge-fund
    description: Hedge fund questionnaire submission and management endpoints.
  - name: smarttoken
    description: Smart Token management endpoints for businesses.
  - name: onramp
    description: Onramp data logging and analytics endpoints for Transak and Coinbase APIs.
  - name: strategy
    description: >-
      Unified strategy endpoints for MAVC, MAVP, and MAVC_YEARN vaults with
      standardized function names.
  - name: website
    description: Website-related endpoints including waitlist submission.
paths:
  /api/v1/login:
    post:
      tags:
        - wallet
      summary: User login and wallet creation
      description: >-
        Login or register a user using a Firebase ID token. If the user does not
        exist, creates a new user and wallet.

        - **idToken**: Firebase ID token

        Returns user and wallet details.
      operationId: login_api_v1_login_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
        required: true
      responses:
        '200':
          description: User and wallet info on successful login
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Login Api V1 Login Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LoginRequest:
      properties:
        idToken:
          type: string
          title: Idtoken
          description: Firebase ID token
          example: eyJhbGciOiJSUzI1NiIsImtpZCI6I...
      type: object
      required:
        - idToken
      title: LoginRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````