-
Book Overview & Buying
-
Table Of Contents
Generative AI with LangChain - Second Edition
By :
OpenAI remains one of the most popular LLM providers, offering models with various levels of power suitable for different tasks, including GPT-4 and GPT-o1. LangChain provides seamless integration with OpenAI’s APIs, supporting both their traditional completion models and chat models. Each of these models has its own price, typically per token.
To work with OpenAI models, we need to obtain an OpenAI API key first. To create an API key, follow these steps:
Here’s how this should look on the OpenAI platform:

Figure A.1: OpenAI API platform – Create new secret key
After clicking Create secret key, you should see the message API key generated. You need to copy the key to your clipboard and save it, as you will need it...