Error with accessing the public API

#1

Hi all,
I am trying to connect to the omdbapi - http://www.omdbapi.com

My code is here-

#Setting the working directory
setwd("C:/Users/Mainak/Desktop/Edwisor/Advanced_concepts")

#install R package omdbapi
devtools::install_github("hrbrmstr/omdbapi",force = TRUE)

#connecting to the api
library(omdbapi)

#to search a movie name
search_by_title("Captain America")

But it is showing some Unauthorised error 401.Then I generated the API key but please help me with the function through which I can put the API key and get access to the api.

Thanks in advance