> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Gas Price

> Returns gas price for a specific block_height or block_hash. Using [null] will return the most recent block's gas price.



## OpenAPI

````yaml /openapi.json post /gas_price
openapi: 3.0.0
info:
  title: NEAR Protocol JSON RPC API
  version: 1.2.3
servers:
  - url: https://rpc.mainnet.near.org
    description: Mainnet
  - url: https://rpc.testnet.near.org
    description: Testnet
security: []
paths:
  /gas_price:
    post:
      summary: Gas Price
      description: >-
        Returns gas price for a specific block_height or block_hash. Using
        [null] will return the most recent block's gas price.
      operationId: gas_price
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest_for_gas_price'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError
components:
  schemas:
    JsonRpcRequest_for_gas_price:
      properties:
        id:
          type: string
        jsonrpc:
          type: string
        method:
          enum:
            - gas_price
          type: string
        params:
          $ref: '#/components/schemas/RpcGasPriceRequest'
      required:
        - jsonrpc
        - id
        - params
        - method
      title: JsonRpcRequest_for_gas_price
      type: object
    JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError:
      oneOf:
        - $ref: >-
            #/components/schemas/JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError_variant0
        - $ref: >-
            #/components/schemas/JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError_variant1
      properties:
        id:
          type: string
        jsonrpc:
          type: string
      required:
        - jsonrpc
        - id
      title: JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError
      type: object
    RpcGasPriceRequest:
      properties:
        block_id:
          anyOf:
            - $ref: '#/components/schemas/BlockId'
            - enum:
                - null
              nullable: true
      title: RpcGasPriceRequest
      type: object
    JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError_variant0:
      properties:
        result:
          $ref: '#/components/schemas/RpcGasPriceResponse'
      required:
        - result
      type: object
    JsonRpcResponse_for_RpcGasPriceResponse_and_RpcGasPriceError_variant1:
      properties:
        error:
          $ref: '#/components/schemas/ErrorWrapper_for_RpcGasPriceError'
      required:
        - error
      type: object
    BlockId:
      anyOf:
        - $ref: '#/components/schemas/BlockId_variant0'
        - $ref: '#/components/schemas/CryptoHash'
    RpcGasPriceResponse:
      properties:
        gas_price:
          $ref: '#/components/schemas/NearToken'
      required:
        - gas_price
      type: object
    ErrorWrapper_for_RpcGasPriceError:
      oneOf:
        - $ref: '#/components/schemas/ErrorWrapper_for_RpcGasPriceError_variant0'
        - $ref: '#/components/schemas/ErrorWrapper_for_RpcGasPriceError_variant1'
        - $ref: '#/components/schemas/ErrorWrapper_for_RpcGasPriceError_variant2'
    BlockId_variant0:
      format: uint64
      minimum: 0
      title: block_height
      type: integer
    CryptoHash:
      type: string
    NearToken:
      type: string
    ErrorWrapper_for_RpcGasPriceError_variant0:
      properties:
        cause:
          $ref: '#/components/schemas/RpcRequestValidationErrorKind'
        name:
          enum:
            - REQUEST_VALIDATION_ERROR
          type: string
      required:
        - name
        - cause
      type: object
    ErrorWrapper_for_RpcGasPriceError_variant1:
      properties:
        cause:
          $ref: '#/components/schemas/RpcGasPriceError'
        name:
          enum:
            - HANDLER_ERROR
          type: string
      required:
        - name
        - cause
      type: object
    ErrorWrapper_for_RpcGasPriceError_variant2:
      properties:
        cause:
          $ref: '#/components/schemas/InternalError'
        name:
          enum:
            - INTERNAL_ERROR
          type: string
      required:
        - name
        - cause
      type: object
    RpcRequestValidationErrorKind:
      oneOf:
        - $ref: '#/components/schemas/RpcRequestValidationErrorKind_variant0'
        - $ref: '#/components/schemas/RpcRequestValidationErrorKind_variant1'
    RpcGasPriceError:
      oneOf:
        - $ref: '#/components/schemas/RpcGasPriceError_variant0'
        - $ref: '#/components/schemas/RpcGasPriceError_variant1'
    InternalError:
      oneOf:
        - $ref: '#/components/schemas/InternalError_variant0'
    RpcRequestValidationErrorKind_variant0:
      properties:
        info:
          properties:
            method_name:
              type: string
          required:
            - method_name
          type: object
        name:
          enum:
            - METHOD_NOT_FOUND
          type: string
      required:
        - name
        - info
      type: object
    RpcRequestValidationErrorKind_variant1:
      properties:
        info:
          properties:
            error_message:
              type: string
          required:
            - error_message
          type: object
        name:
          enum:
            - PARSE_ERROR
          type: string
      required:
        - name
        - info
      type: object
    RpcGasPriceError_variant0:
      properties:
        info:
          properties:
            error_message:
              type: string
          required:
            - error_message
          type: object
        name:
          enum:
            - INTERNAL_ERROR
          type: string
      required:
        - name
        - info
      type: object
    RpcGasPriceError_variant1:
      properties:
        info:
          type: object
        name:
          enum:
            - UNKNOWN_BLOCK
          type: string
      required:
        - name
        - info
      type: object
    InternalError_variant0:
      properties:
        info:
          properties:
            error_message:
              type: string
          required:
            - error_message
          type: object
        name:
          enum:
            - INTERNAL_ERROR
          type: string
      required:
        - name
        - info
      type: object

````