:doc:`Braket <../../braket>` / Client / create_spending_limit

*********************
create_spending_limit
*********************



.. py:method:: Braket.Client.create_spending_limit(**kwargs)

  

  Creates a spending limit for a specified quantum device. Spending limits help you control costs by setting maximum amounts that can be spent on quantum computing tasks within a specified time period. Simulators do not support spending limits.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/braket-2019-09-01/CreateSpendingLimit>`_  


  **Request Syntax**
  ::

    response = client.create_spending_limit(
        clientToken='string',
        deviceArn='string',
        spendingLimit='string',
        timePeriod={
            'startAt': datetime(2015, 1, 1),
            'endAt': datetime(2015, 1, 1)
        },
        tags={
            'string': 'string'
        }
    )
    
  :type clientToken: string
  :param clientToken: **[REQUIRED]** 

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Braket ignores the request, but does not return an error.

    This field is autopopulated if not provided.

  
  :type deviceArn: string
  :param deviceArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the quantum device to apply the spending limit to.

    

  
  :type spendingLimit: string
  :param spendingLimit: **[REQUIRED]** 

    The maximum amount that can be spent on the specified device, in USD.

    

  
  :type timePeriod: dict
  :param timePeriod: 

    The time period during which the spending limit is active, including start and end dates.

    

  
    - **startAt** *(datetime) --* **[REQUIRED]** 

      The start date and time for the spending limit period, in epoch seconds.

      

    
    - **endAt** *(datetime) --* **[REQUIRED]** 

      The end date and time for the spending limit period, in epoch seconds.

      

    
  
  :type tags: dict
  :param tags: 

    The tags to apply to the spending limit. Each tag consists of a key and an optional value.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'spendingLimitArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **spendingLimitArn** *(string) --* 

        The Amazon Resource Name (ARN) of the created spending limit.

        
  
  **Exceptions**
  
  *   :py:class:`Braket.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Braket.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Braket.Client.exceptions.DeviceRetiredException`

  
  *   :py:class:`Braket.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Braket.Client.exceptions.ValidationException`

  