> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # close > Close the AIChatClient the gateway created. [ref-chatgateway]: /docs/server-sdks/reference/python/agents/chat-gateway [aichatclient]: /docs/server-sdks/reference/python/agents/ai-chat-client Close the [`AIChatClient`][aichatclient] the gateway built for itself. A gateway constructed with your own `client=` leaves that client alone, since it did not create it. ## **Parameters** None. ## **Returns** `None`. ## **Example** Close it when your app shuts down: ```python {12} from contextlib import asynccontextmanager from fastapi import FastAPI from signalwire.ai_chat import ChatGateway gateway = ChatGateway(config_url="https://bayview-taxi.example.com/swml") @asynccontextmanager async def lifespan(app: FastAPI): yield await gateway.close() app = FastAPI(lifespan=lifespan) app.include_router(gateway.router(), prefix="/chat") ``` > Close the AIChatClient the gateway created.