as per Splunk documentation you need to have paid subscription to access splunk cloud rest API , trial version can not access it
If you need developer access, you can get a Developer license and use it on your own on-prem infrastructure.
Trial Cloud access is supposed to be used for evaluation of the service in order to decide whether to purchase the services or not. Same as Trial on-prem licenses.
Remember that cloud infrastructure costs money. If you need prolonged access to Splunk services, set up your own environment. It works.
Gosh I have to disagree with that conclusion given the availability of the Splunk Developer License which is intended to support developers with these types of use cases.
An internet search for "splunk developer license" quickly shows that that the splunk>dev site has a way for anyone to request the license!