> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 마스트라.추가게이트웨이() Mastra 인스턴스에 게이트웨이를 동적으로 추가합니다. 초기화 중이나 초기화 후에 사용할 수 있습니다. ## 사용예 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra() // Add with explicit key mastra.addGateway(new MyCustomGateway(), 'myGateway') // Add using gateway's ID as the key mastra.addGateway(new MyCustomGateway()) // Stored with key 'my-custom-gateway' (the gateway's id) ``` ## 매개변수 **gateway** (`MastraModelGateway`): 추가할 게이트웨이 인스턴스 **key** (`string`): 선택적 등록 키입니다. 제공하지 않으면 gateway.getId()를 사용합니다. ## 보고 무효의. 게이트웨이가 내부 레지스트리에 추가됩니다. ## 행동 - 동일한 키를 가진 게이트웨이가 이미 존재하면 추가하지 않습니다. - 개발 모드(`MASTRA_DEV=true`)에서는 사용자 정의 게이트웨이의 타입 생성을 자동으로 실행합니다. - Model 확인에 게이트웨이를 즉시 사용할 수 있습니다. ## 관련된 - [마스트라.getGateway()](https://mastra.zisheng.pro/ko/reference/core/getGateway): 등록키로 게이트웨이 받기 - [Mastra.getGatewayById()](https://mastra.zisheng.pro/ko/reference/core/getGatewayById): ID로 게이트웨이 가져오기 - [Mastra.listGateways()](https://mastra.zisheng.pro/ko/reference/core/listGateways): 모든 게이트웨이 나열 - [마스트라Model게이트웨이](https://mastra.zisheng.pro/ko/reference/core/mastra-model-gateway): 게이트웨이 기본 클래스 - [사용자 정의 게이트웨이 가이드](https://mastra.zisheng.pro/ko/models/gateways/custom-gateways): 커스텀 게이트웨이 생성