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
- Uses chat completions for conversational applications, one-off text tasks, and retrieval-augmented question answering.
- How deep it goes
- Explains message roles, request parameters, response handling, and conversation token management through implementation examples.
- Examples
- Demonstrates a pet-information conversation, English-to-Spanish translation, and question answering over retrieved blog posts.
- What you can do after
- Apply it via Azure OpenAI to send role-based messages and manage conversation context within a token budget.
AI Agents and Applications
- How it is used
- Uses role-based messaging to guide interactive assistants and support follow-up requests.
- How deep it goes
- Defines message roles and explains conversational context, without detailing API request schemas or endpoints.
- Examples
- Uses a Paestum document question and an interactive summarization request to illustrate chatbot exchanges.
- What you can do after
- Evaluate how role instructions, conversation history, and retrieved context support chatbot responses.
Also covered in
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- foundation modelA foundation model is a broadly trained machine-learning model whose learned capabilities can be reused or adapted for a range of downstream tasks.
- promptA prompt is text or other input supplied to an AI model to provide instructions, context, or other information that guides its response or generated output.
- generationGeneration is the production of an output by a computational model from supplied input or context, often using patterns learned from data.
Related concepts
- message roleuses · A message role is a label identifying the source or function of a message in a structured conversation.
- completions apicontrasts with · A completions API is an interface for requesting language-model-generated text from supplied prompts or inputs and configuring generation behavior.
- 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 multimodal large language model developed by OpenAI that processes text and image inputs and generates text.
- GPT modeluses · A GPT model is a generative, autoregressive Transformer language model in the family developed by OpenAI.
- prompt engineeringuses · Prompt engineering is the deliberate design and refinement of inputs, instructions, and context to guide an AI model’s behavior or outputs.
Questions about chat API
What is chat API?
A chat API is an interface for exchanging conversational messages with a language model and receiving responses.
Which Manning books explain chat API?
Generative AI in Action and AI Agents and Applications.
What should I know before learning chat API?
Manning books that teach chat API usually introduce language model, foundation model, prompt and generation first.
What is the difference between chat API and completions api?
A chat API is an interface for exchanging conversational messages with a language model and receiving responses. 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.

