> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Mastra.getGateway() 登録キー(Gateway を Mastra に追加したときに使用したキー)で Gateway を取得します。 ## 使用例 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({ gateways: { myGateway: new MyCustomGateway(), }, }) const gateway = mastra.getGateway('myGateway') console.log(gateway.name) // 'My Custom Gateway' ``` ## パラメーター **key** (`string`): Gateway の登録キー ## 戻り値 **gateway** (`MastraModelGateway`): Gateway インスタンス ## 例外 指定したキーの Gateway が見つからない場合はエラーをスローします。 ## 関連項目 - [Mastra.getGatewayById()](https://mastra.zisheng.pro/ja/reference/core/getGatewayById): ID で Gateway を取得 - [Mastra.listGateways()](https://mastra.zisheng.pro/ja/reference/core/listGateways): すべての Gateway を一覧表示 - [Mastra.addGateway()](https://mastra.zisheng.pro/ja/reference/core/addGateway): Gateway を追加 - [MastraModelGateway](https://mastra.zisheng.pro/ja/reference/core/mastra-model-gateway): Gateway の基底クラス - [カスタム Gateway ガイド](https://mastra.zisheng.pro/ja/models/gateways/custom-gateways): カスタム Gateway の作成方法