Skip to main content
In this lesson, we’ll explore the OpenAI platform and its modular architecture. You’ll learn how each component fits together to deliver Generative AI as a Service and where tokens and API parameters come into play.

OpenAI Platform Architecture

The OpenAI platform provides a seamless developer experience through four core layers:
The image is a flowchart titled "OpenAI – 10,000-Ft. Overview," showing the interaction between tools, libraries, apps, an API, OpenAI, and foundation models.
Customer applications—whether your web app, mobile client, or backend service—interact with these layers by calling the RESTful API directly or using one of the managed SDKs.

Understanding Tokens and API Parameters

When you send a request to the OpenAI API, there are several parameters you can tune. The most important among them are:
  • Model: Choose which foundation model to use.
  • Prompt: The text input that the model will complete.
  • Max tokens: Limits the length of the generated response.
  • Temperature: Controls randomness in output (0.0–1.0).
  • Top_p: Enables nucleus sampling for probabilistic curation.
Every API call consumes tokens based on the length of your prompt and the response. Monitor your usage in the OpenAI dashboard to manage costs.

Example: Text Completion Request

Parsing the Response

A typical response object contains:

Watch Video