15 1.Go to the OpenAI website at https://platform.openai.com/ and click on the "Sign Up" button in the top-right corner of the page. 2.Follow the prompts to create an account and verify your email address. 3.Once you're logged in, click on your user photo at the lower left corner of the page and Then on the "API Keys" option in the dashboard menu. 4.In Project API Keys, Click on the ”Create New Secret Key" button. 5.Enter a name for your API key and select the API permissions you want to grant to the key. 6.Click the "Create" button to generate your new key. Open AI 2024
16 § Starting from March 25, 2024, OpenAI implemented a new billing method for the OpenAI API accounts. Instead of receiving a bill at the end of each month, users must pre-purchase credits to use the API via the billing page. • January 2024 (GTP-35): • Input Tokens: $0.0015 per 1,000 tokens • Output Tokens: $0.002 per 1,000 tokens • Tokens: Tokens can be as short as one character or as long as one word Typically, 1,000 tokens is about 750 words. Note
18 § Create a new file in your resource's directory (usually src/main/resources in a Maven project) and name it for example config.properties (or any name you prefer). § Add the properties you need in this file. Properties File
20 This file should not be committed to your version control system if it contains sensitive information like API keys. Advice: § Create a copy of your config.properties file and name it config.sample.properties. Replace the sensitive data like the API key with placeholder values. § Add config.properties to your .gitignore file. This will prevent the actual properties file from being tracked by Git. § Commit the config.sample.properties file to your repository. This will provide a template for other developers to know what keys/values are expected in the actual config.properties file. Properties
Spring 2024 Copyright. These slides can only be used as study material for the class CSC309 at Cal Poly. They cannot be distributed or used for another purpose.