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

# Run Auction

> Simulate an auction with given bidder valuations. Supports first-price sealed-bid (highest bidder wins, pays their bid), second-price/Vickrey (highest bidder wins, pays second-highest bid), and all-pay (all bidders pay their bid, highest wins). Returns winner, price paid, revenue, and all bids. Use for auction design, comparing formats, and predicting outcomes. [Tier: STANDARD, Credits: 2]



## OpenAPI

````yaml api-specs/economics.json post /quantlib/economics/auctions/run
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Economics
  description: >-
    Economics module endpoints for FinceptQuantLib API - general equilibrium,
    game theory, auctions, and utility functions
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-economics
    description: >-
      Economics module - general equilibrium, game theory, auctions, and utility
      theory
    x-displayName: Economics
paths:
  /quantlib/economics/auctions/run:
    post:
      tags:
        - quantlib-economics
      summary: Run Auction
      description: >-
        Simulate an auction with given bidder valuations. Supports first-price
        sealed-bid (highest bidder wins, pays their bid), second-price/Vickrey
        (highest bidder wins, pays second-highest bid), and all-pay (all bidders
        pay their bid, highest wins). Returns winner, price paid, revenue, and
        all bids. Use for auction design, comparing formats, and predicting
        outcomes. [Tier: STANDARD, Credits: 2]
      operationId: run_auction_quantlib_economics_auctions_run_post
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - auction_type
                - n_bidders
                - valuations
              properties:
                auction_type:
                  type: string
                  description: Type of auction mechanism
                  enum:
                    - first_price
                    - second_price
                    - all_pay
                  example: second_price
                n_bidders:
                  type: integer
                  description: Number of bidders participating
                  minimum: 2
                  example: 3
                valuations:
                  type: array
                  description: >-
                    Private valuations for each bidder (must have n_bidders
                    elements)
                  items:
                    type: number
                    minimum: 0
                  example:
                    - 100
                    - 80
                    - 90
            example:
              auction_type: second_price
              n_bidders: 3
              valuations:
                - 100
                - 80
                - 90
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      auction_type:
                        type: string
                        description: Auction format used
                        example: second_price
                      winner:
                        type: integer
                        description: Index of winning bidder (0-indexed)
                        example: 0
                      price:
                        type: number
                        description: Price paid by winner
                        example: 90
                      revenue:
                        type: number
                        description: Total revenue to auctioneer
                        example: 90
                      bids:
                        type: array
                        description: Equilibrium bids submitted by each bidder
                        items:
                          type: number
                        example:
                          - 100
                          - 80
                          - 90
              example:
                success: true
                data:
                  auction_type: second_price
                  winner: 0
                  price: 90
                  revenue: 90
                  bids:
                    - 100
                    - 80
                    - 90
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
              example:
                detail:
                  - loc:
                      - body
                      - valuations
                    msg: field required
                    type: value_error.missing
      security:
        - APIKeyHeader: []
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientTierError:
      description: API tier insufficient for this endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Endpoint requires Basic tier or higher
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````