> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # Mastra.getGatewayById() 고유 ID로 게이트웨이를 검색합니다(`id`게이트웨이 인스턴스의 속성). 이는 등록 키가 아닌 고유 식별자로 게이트웨이를 찾아야 할 때 유용합니다. ## 사용예 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({ gateways: { customKey: new MyCustomGateway(), // id = 'my-custom-gateway' }, }) // Retrieve by ID (not registration key) const gateway = mastra.getGatewayById('my-custom-gateway') console.log(gateway.name) // 'My Custom Gateway' ``` ## 사용 사례 - 게이트웨이 버전 관리: 고유 ID를 가진 다양한 버전(`'gateway-v1'`, `'gateway-v2'`) - 등록 키를 알 수 없는 경우 게이트웨이 찾기 - 다양한 Mastra 인스턴스에서 게이트웨이 식별 ## 매개변수 **id** (`string`): 게이트웨이의 고유 ID(gateway.id 속성) ## 보고 **gateway** (`MastraModelGateway | undefined`): 게이트웨이 인스턴스입니다. 찾지 못하면 undefined입니다. ## 관련된 - [마스트라.getGateway()](https://mastra.zisheng.pro/ko/reference/core/getGateway): 등록키로 게이트웨이 받기 - [Mastra.listGateways()](https://mastra.zisheng.pro/ko/reference/core/listGateways): 모든 게이트웨이 나열 - [마스트라.추가게이트웨이()](https://mastra.zisheng.pro/ko/reference/core/addGateway): 게이트웨이 추가 - [마스트라Model게이트웨이](https://mastra.zisheng.pro/ko/reference/core/mastra-model-gateway): 게이트웨이 기본 클래스 - [사용자 정의 게이트웨이 가이드](https://mastra.zisheng.pro/ko/models/gateways/custom-gateways): 커스텀 게이트웨이 생성