← Back to all FAQs
FAQ

Are fast api and open ai api same?

FastAPI and the OpenAI API are not the same thing, though they're often used together and that can cause confusion. FastAPI is an open-source Python web framework used to build APIs quickly, with automatic documentation, request validation, and asynchronous support built in. It's a tool developers use to create their own backend services. The OpenAI API, on the other hand, is a hosted service provided by OpenAI that gives you programmatic access to models like GPT for tasks such as text generation, embeddings, and image creation. In practice, many developers use FastAPI as the framework to build an application that then calls the OpenAI API behind the scenes, for example a chatbot backend that receives a request through a FastAPI endpoint and forwards it to OpenAI's servers for a completion. So FastAPI handles how your application receives and routes requests, while the OpenAI API supplies the actual AI capability. Confusing the two is understandable given how frequently they appear together in tutorials and starter projects, but they solve different problems and neither depends on the other to function.

← what is the purpose of a prompt what is chatgpt playground →