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

# Create new token transaction

> 
    Creates a new token on-chain. This endpoint prepares and optionally executes the blockchain transaction
    to deploy a new token contract with specified parameters.

    Supports:
    - Token metadata (name, symbol, description)
    - Media assets (logo, banner, video)
    - Multiple chains (Base, Base Sepolia)
    - Optional hashtags/tags
    - Automatic token URI generation and IPFS storage

    Returns transaction data for client-side execution or confirmation of server-side execution.

    **Anti-Sniping & Initial Buy Fees:**
    - The first 6 seconds of trading (equivalent in blocks for each chain) has increased fees to prevent sniping
    - Fees start at 80% and decrease linearly to 1% over the first 6 seconds worth of blocks
    - This fee structure applies to all initial purchases, including the first buyer
    - The quoter automatically includes these fees in all price quotes
    - After the initial 6-second window, normal trading fees apply

    **USD Rewards Attribution:**
    - **Builder attribution**: Set custom builder fees (in basis points) to earn USD rewards on token creation
    - **Token referral**: Enable affiliate programs by specifying referral addresses for token trades
    - USD rewards are processed in real-time on-chain with no third parties involved
    - Token referrals have no additional cost to users - enabling affiliate programs onchain
  



## OpenAPI

````yaml post /create-token-transaction
openapi: 3.0.3
info:
  title: Token Layer API
  version: 1.0.0
  description: |2-

          Token Layer is an omnichain token trading platform where users can create and trade tokens across multiple chains.

          This API provides comprehensive access to token operations, trading, earnings,
          blockchain transactions, and portfolio management.

          ## Base URL
          All endpoints are accessed via: `https://api.tokenlayer.network/{endpoint}`

          ## Authentication
          Most endpoints require authentication using an JWT token or API key passed as a Bearer token in the Authorization header.

          ## Rate Limiting
          API calls are rate limited per user. Please implement appropriate backoff strategies.
        
  contact:
    name: Token Layer API Support
    url: https://app.tokenlayer.network
servers:
  - url: https://api.tokenlayer.network/functions/v1
    description: Production server
  - url: https://api.tokenlayer.network/functions/v1
    description: Staging server
security: []
tags:
  - name: Tokens
    description: Token creation, browsing, search, trading, and price operations
  - name: Transactions
    description: Blockchain transactions (send, tip, ownership checks)
paths:
  /create-token-transaction:
    post:
      tags:
        - Transactions
        - Tokens
      summary: Create new token transaction
      description: |2-

            Creates a new token on-chain. This endpoint prepares and optionally executes the blockchain transaction
            to deploy a new token contract with specified parameters.

            Supports:
            - Token metadata (name, symbol, description)
            - Media assets (logo, banner, video)
            - Multiple chains (Base, Base Sepolia)
            - Optional hashtags/tags
            - Automatic token URI generation and IPFS storage

            Returns transaction data for client-side execution or confirmation of server-side execution.

            **Anti-Sniping & Initial Buy Fees:**
            - The first 6 seconds of trading (equivalent in blocks for each chain) has increased fees to prevent sniping
            - Fees start at 80% and decrease linearly to 1% over the first 6 seconds worth of blocks
            - This fee structure applies to all initial purchases, including the first buyer
            - The quoter automatically includes these fees in all price quotes
            - After the initial 6-second window, normal trading fees apply

            **USD Rewards Attribution:**
            - **Builder attribution**: Set custom builder fees (in basis points) to earn USD rewards on token creation
            - **Token referral**: Enable affiliate programs by specifying referral addresses for token trades
            - USD rewards are processed in real-time on-chain with no third parties involved
            - Token referrals have no additional cost to users - enabling affiliate programs onchain
          
      operationId: createTokenTransaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenTransactionRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenTransactionResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateTokenTransactionRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Token name
          example: My Cool Token
        symbol:
          type: string
          minLength: 1
          maxLength: 10
          description: Token symbol (ticker)
          example: MCT
        description:
          type: string
          minLength: 1
          description: Token description
          example: A revolutionary new token
        image:
          type: string
          minLength: 1
          description: >-
            Token logo image - can be either a URL or base64-encoded image data
            (data:image/...)
          example: >-
            https://example.com/logo.png or
            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
        banner:
          type: string
          minLength: 1
          description: >-
            Banner image - can be either a URL or base64-encoded image data
            (data:image/...)
          example: >-
            https://example.com/banner.png or
            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
        video:
          type: string
          minLength: 1
          description: >-
            Promotional video - can be either a URL or base64-encoded video data
            (data:video/...)
          example: >-
            https://example.com/promo.mp4 or
            data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC
        links:
          type: object
          properties:
            website:
              type: string
              format: uri
              description: Project website URL
              example: https://example.com
            twitter:
              type: string
              format: uri
              description: Twitter/X profile URL
              example: https://twitter.com/example
            youtube:
              type: string
              format: uri
              description: YouTube channel URL
              example: https://youtube.com/@example
            discord:
              type: string
              format: uri
              description: Discord server invite URL
              example: https://discord.gg/example
            telegram:
              type: string
              format: uri
              description: Telegram group/channel URL
              example: https://t.me/example
          description: Optional social media and website links
        chainSlug:
          $ref: '#/components/schemas/ChainSlug'
        destinationChains:
          type: array
          items:
            $ref: '#/components/schemas/ChainSlug'
          description: >-
            Optional array of destination chain slugs for cross-chain token
            deployment and migration endpoints. Defaults to [base-sepolia,
            bnb-testnet, solana-devnet]. The initial chain will be automatically
            excluded from migration endpoints.
          example:
            - base-sepolia
            - bnb-testnet
            - solana-devnet
        poolType:
          type: string
          enum:
            - meme
            - startup-preseed
            - test
          description: >-
            Type of token pool. Defaults to "meme". Maps to: meme=7,
            startup-preseed=8
          example: meme
        userAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            User wallet address (optional - if not provided, will use user's
            Privy wallet from user_wallets table)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        builder:
          $ref: '#/components/schemas/Builder'
        token_referral:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            Token referral address for attribution (optional - defaults to zero
            address). Used to attribute referral fees to a specific address.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        tags:
          type: array
          items:
            type: string
          description: Optional hashtags/tags for the token
          example:
            - defi
            - meme
        type:
          type: string
          enum:
            - coin
          default: coin
          description: >-
            Transaction type (currently only "coin" is supported - placeholder
            for future integration)
          example: coin
        amountIn:
          type: number
          minimum: 0
          description: >-
            Optional USD amount to spend on initial token purchase (in USD). Use
            0 or omit to skip initial purchase.
          example: 10
        tokensOut:
          type: number
          minimum: 0
          description: >-
            Optional number of tokens to purchase initially. Use 0 or omit to
            skip initial purchase. If both amountIn and tokensOut are provided,
            tokensOut takes priority.
          example: 1000
        maxAmountIn:
          type: number
          minimum: 0
          description: >-
            Maximum USD amount willing to spend when tokensOut is specified.
            This value comes from the Quoter contract quote and includes
            slippage protection. Required when tokensOut is provided.
          example: 15.5
      required:
        - name
        - symbol
        - description
        - image
        - chainSlug
    CreateTokenTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        executed:
          type: boolean
        transactionHash:
          type: string
        chainId:
          type: integer
          description: Numeric chain ID for the transaction
          example: 84532
        transaction:
          type: object
          properties:
            to:
              type: string
            data:
              type: string
            value:
              type: string
            gasLimit:
              type: string
          required:
            - to
            - data
            - value
            - gasLimit
          description: >-
            Deprecated: Use transactions array instead. Single transaction
            object for backwards compatibility.
        transactions:
          type: array
          items:
            type: object
            properties:
              to:
                type: string
              data:
                type: string
              value:
                type: string
              gasLimit:
                type: string
              description:
                type: string
              chainId:
                type: integer
              chainType:
                type: string
              chainSlug:
                type: string
              transactionDelay:
                type: integer
            required:
              - to
              - data
              - value
          description: >-
            Array of transactions to execute. May include USDC approval
            transaction if initial purchase is requested.
        metadata:
          type: object
          properties:
            tokenUri:
              type: string
            tokenId:
              type: string
            name:
              type: string
            symbol:
              type: string
            slug:
              type: string
            token_layer_id:
              type: string
              nullable: true
              description: Token Layer ID (calculated hash)
              example: >-
                0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
            description:
              type: string
            hubUrl:
              type: string
              format: uri
              description: Direct URL to the token hub page
              example: https://app.tokenlayer.network/token/my-cool-token
            addresses:
              type: object
              properties:
                evm:
                  type: string
                solana:
                  type: string
              required:
                - evm
                - solana
          required:
            - tokenUri
            - tokenId
            - name
            - symbol
            - slug
            - description
            - hubUrl
            - addresses
      required:
        - success
    Error:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
      required:
        - success
        - error
      description: Error response
    ChainSlug:
      type: string
      enum:
        - solana
        - solana-devnet
        - arbitrum
        - base
        - base-sepolia
        - avalanche
        - op-bnb
        - bnb
        - bnb-testnet
        - ethereum
        - monad
        - unichain
        - unichain-testnet
        - abstract
        - polygon
        - zksync
        - zksync-testnet
      description: >-
        Blockchain identifier. Supported chains: solana, solana-devnet,
        arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet,
        ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync,
        zksync-testnet
      example: base-sepolia
    Builder:
      type: object
      properties:
        code:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Builder address for attribution
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        fee:
          type: integer
          minimum: 0
          maximum: 10000
          description: Builder fee in basis points (bps). 1 bps = 0.01%. Max 10000 (100%).
          example: 50
      required:
        - code
        - fee
      description: >-
        Builder attribution information (optional). Includes address and fee in
        bps.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token or API key

````