> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat

> OpenAI Chat examples for multimodal input and output, tools, reasoning, structured output, storage, and retries.

| Example | Description |
| - | - |
| [Access Memories in Memory Completed Event](https://agno-v2.mintlify.site/examples/models/openai/chat/access-memories-in-memory-completed-event.md) | Stream an agent run with stream\_events=True and read user memories off the MemoryUpdateCompleted event, backed by PostgresDb. |
| [Chat Agent Flex Tier](https://agno-v2.mintlify.site/examples/models/openai/chat/agent-flex-tier.md) | Run o4-mini on the flex service tier by setting service\_tier on OpenAIChat. |
| [OpenAI Audio Input Agent](https://agno-v2.mintlify.site/examples/models/openai/chat/audio-input-agent.md) | Send a WAV file fetched from a URL to gpt-audio and stream a text answer about it. |
| [OpenAI Audio Input And Output Multi Turn](https://agno-v2.mintlify.site/examples/models/openai/chat/audio-input-and-output-multi-turn.md) | Send audio input to gpt-audio and carry the conversation across turns with audio replies. |
| [OpenAI Audio Input Local File Upload](https://agno-v2.mintlify.site/examples/models/openai/chat/audio-input-local-file-upload.md) | Upload a local MP3 file to gpt-audio and get a text description of the audio. |
| [OpenAI Audio Output Agent](https://agno-v2.mintlify.site/examples/models/openai/chat/audio-output-agent.md) | Get text and audio output from gpt-audio and save each spoken reply to a WAV file. |
| [OpenAI Audio Output Stream](https://agno-v2.mintlify.site/examples/models/openai/chat/audio-output-stream.md) | Stream pcm16 audio from gpt-audio, printing the transcript while writing frames to a WAV file. |
| [Chat Basic](https://agno-v2.mintlify.site/examples/models/openai/chat/basic.md) | Run a gpt-5.6-luna agent in sync, async, and streaming modes with OpenAIChat. |
| [OpenAI Basic Stream Metrics](https://agno-v2.mintlify.site/examples/models/openai/chat/basic-stream-metrics.md) | Stream a response, then read run-level and per-message metrics from the last run output. |
| [Custom Role Map](https://agno-v2.mintlify.site/examples/models/openai/chat/custom-role-map.md) | Point OpenAIChat at Mistral's base\_url and remap the `model` role to `assistant` via role\_map. |
| [Chat DB](https://agno-v2.mintlify.site/examples/models/openai/chat/db.md) | Store session history in Postgres so a follow-up question can reference the previous answer. |
| [OpenAI Generate Images](https://agno-v2.mintlify.site/examples/models/openai/chat/generate-images.md) | Legacy DalleTools example that generates an image and reads its URL from the run output. |
| [Chat Image Agent](https://agno-v2.mintlify.site/examples/models/openai/chat/image-agent.md) | Analyze an image from a URL and search the web for related news, streaming the reply. |
| [Chat Image Agent Bytes](https://agno-v2.mintlify.site/examples/models/openai/chat/image-agent-bytes.md) | Pass an image as raw bytes and combine vision with web search for current news. |
| [Chat Image Agent with Memory](https://agno-v2.mintlify.site/examples/models/openai/chat/image-agent-with-memory.md) | Analyze an image with web search, keeping chat history so follow-ups can reference it. |
| [Chat Knowledge](https://agno-v2.mintlify.site/examples/models/openai/chat/knowledge.md) | Load a PDF into PgVector-backed knowledge and answer questions from its contents. |
| [Chat Memory](https://agno-v2.mintlify.site/examples/models/openai/chat/memory.md) | Store user memories and session summaries in Postgres and print them after each turn. |
| [OpenAI Metrics](https://agno-v2.mintlify.site/examples/models/openai/chat/metrics.md) | Print per-message and aggregated run metrics after a YFinance tool call. |
| [PDF Input File Upload](https://agno-v2.mintlify.site/examples/models/openai/chat/pdf-input-file-upload.md) | Attach a local PDF file to an OpenAI chat agent and ask it to suggest a recipe from the document. |
| [Chat PDF Input Local](https://agno-v2.mintlify.site/examples/models/openai/chat/pdf-input-local.md) | Attach a local PDF by filepath and query its contents with gpt-4o. |
| [Chat PDF Input URL](https://agno-v2.mintlify.site/examples/models/openai/chat/pdf-input-url.md) | Attach a PDF by URL and ask the agent for a recipe from the file. |
| [Chat Reasoning O3 Mini](https://agno-v2.mintlify.site/examples/models/openai/chat/reasoning-o3-mini.md) | Run o3-mini with high reasoning effort and YFinance tools to write a stock report. |
| [Retry](https://agno-v2.mintlify.site/examples/models/openai/chat/retry.md) | Review retry settings and why invalid model IDs cannot reliably exercise the retry path. |
| [Chat Structured Output](https://agno-v2.mintlify.site/examples/models/openai/chat/structured-output.md) | Compare JSON mode, strict, and guided structured output for a Pydantic movie schema. |
| [Text-to-Speech Agent](https://agno-v2.mintlify.site/examples/models/openai/chat/text-to-speech-agent.md) | Generate speech with the OpenAITools speech toolkit and save the returned audio to tmp/speech\_output.mp3. |
| [Chat Tool Use](https://agno-v2.mintlify.site/examples/models/openai/chat/tool-use.md) | Answer questions with web search tools in sync, streaming, and async modes. |
| [Chat Verbosity Control](https://agno-v2.mintlify.site/examples/models/openai/chat/verbosity-control.md) | Control response length with the gpt-5 verbosity parameter in a finance report agent. |
| [OpenAI With Retries](https://agno-v2.mintlify.site/examples/models/openai/chat/with-retries.md) | Review retry settings and why invalid model IDs cannot reliably exercise the retry path. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.