Chat API
A chat API is an interface for exchanging conversational messages with a language model and receiving responses.
Generative AI in Action
A chat completion API is a programming interface that generates assistant responses from a sequence of conversational messages.
- How it is used
- Powers interactive assistants and also handles text-generation tasks that do not require a dialogue.
- How deep it goes
- Explains ordered role-and-content messages, shows API calls, and gives conversation-management guidance without detailing model internals.
- Examples
- Uses a Spanish translation request, a multiturn pet question, and Q&A over retrieved blog posts.
- What you can do after
- Build it from scratch with ordered messages, then manage token budgets and integrate retrieved context for Q&A.
AI Agents and Applications
- How it is used
- Supports conversational Q&A by sending questions and context to a language model and returning answers users can refine.
- How deep it goes
- Defines role-based messaging and shows a LangChain model integration, but stops short of showing raw chat API requests.
- Examples
- Uses a document-questioning exchange with follow-ups and a Python RAG chain built around ChatOpenAI.
- What you can do after
- Apply it via LangChain’s ChatOpenAI component in a retrieval-based Q&A chain.
Related concepts
- enginecontrasts with · An engine is an LLM-based system that produces output for a bounded request and then stops without independently selecting subsequent work.
- GPT-4uses · GPT-4 is a generative large language model developed by OpenAI for understanding and generating text and other supported inputs and outputs.
- GPT modeluses · A GPT model is a generative pretrained Transformer language model that produces text autoregressively by predicting successive tokens from preceding context.
- prompt engineeringuses · Prompt engineering is the deliberate design and refinement of instructions, context, examples, or other inputs to guide an AI model’s behavior or outputs.
- completions apicontrasts with · A completions API is an interface for requesting language-model-generated text from supplied prompts or inputs and configuring generation behavior.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

