REst API for R studio

how can i create rest api in R studio

One way would be using something like plumber - https://www.rplumber.io/

library(plumber)
install.packages("plumber")
library(plumber)
library(httr)
library(jsonlite)
install.packages("Rcpp")
library(Rcpp)
install.packages("devtools")
install.packages("rlang")
library(rlang)
install.packages("stringi")
library(stringi)
devtools::install_github("trestletech/plumber")
pr <- plumber::plumb("C:\Users\STPL-SL04\Desktop\Rcode\plumber.R")
pr
dr <- plumber::plumb("C:\Users\STPL-SL04\Desktop\Rcode\testt.R")
dr
dr$run(port=8000)
dr$run(swagger=TRUE)

after this what next to create api

Did you read the documentation in the link I've sent? "Introduction" gives you an example of how to create an API and then how to use it.