[Yandex Cloud documentation](../../../../../index.md) > [Yandex API Gateway](../../../../index.md) > API reference > [gRPC](../index.md) > [ApiGateway](index.md) > GetOpenapiSpec

# API Gateway Service, gRPC: ApiGatewayService.GetOpenapiSpec

Returns the OpenAPI specification of specified API gateway.

## gRPC request

**rpc GetOpenapiSpec ([GetOpenapiSpecRequest](#yandex.cloud.serverless.apigateway.v1.GetOpenapiSpecRequest)) returns ([GetOpenapiSpecResponse](#yandex.cloud.serverless.apigateway.v1.GetOpenapiSpecResponse))**

## GetOpenapiSpecRequest {#yandex.cloud.serverless.apigateway.v1.GetOpenapiSpecRequest}

```json
{
  "api_gateway_id": "string",
  "format": "Format"
}
```

#|
||Field | Description ||
|| api_gateway_id | **string**

Required field. ID of the API gateway to get specification from. ||
|| format | enum **Format**

Format of returned specification. Default is the original format used in [CreateApiGatewayRequest](create.md#yandex.cloud.serverless.apigateway.v1.CreateApiGatewayRequest).

- `JSON`
- `YAML` ||
|#

## GetOpenapiSpecResponse {#yandex.cloud.serverless.apigateway.v1.GetOpenapiSpecResponse}

```json
{
  "api_gateway_id": "string",
  "openapi_spec": "string"
}
```

#|
||Field | Description ||
|| api_gateway_id | **string**

ID of the API gateway. ||
|| openapi_spec | **string**

The text of specification, JSON or YAML. ||
|#