Riku.AI
  • Welcome to Riku.AI
  • Fundamentals of Riku
    • Connecting Keys
      • Connecting Aleph Alpha Keys
      • Connecting Muse API Keys
      • Connecting OpenAI Keys
      • Connecting Cohere Keys
      • Connecting AI21 Keys
  • Basics of AI
    • Defining Key Terms
    • Winning with Text Based AI
    • Prompt Building 101
    • Common Issues & Errors
    • Ethical Considerations
  • Exporting Prompts
    • Single Endpoint Export
      • Getting Prompt IDs
      • Structuring the Request
      • Understanding Input Fields
      • Full Example Export
  • Technology Overview
    • OpenAI
    • Cohere
    • AI21
    • EleutherAI
    • Aleph Alpha
    • Muse API
  • Importing Fine-tunes
    • Introduction to Fine-tuning
      • Importing from OpenAI
      • Importing from Cohere
      • Importing from AI21
  • Riku's Playground
    • Creating Prompts
    • Saving & Sharing Prompts
    • Community Showcase
    • Private Prompts
    • Execute Prompts
    • Code Export
Powered by GitBook
On this page
  1. Exporting Prompts
  2. Single Endpoint Export

Structuring the Request

PreviousGetting Prompt IDsNextUnderstanding Input Fields

Last updated 3 years ago

Now you have the Prompt ID, you can build out the request to use in your own system. We like to test all of our API requests using a tool called . Well worth picking it up if you don't have it. It is free to use.

What Postman is great at is that it lets you import a CURL request and then try it out instantly. This is great for experimenting and ensuring you have everything set up properly. You can then also get a code snippet for multiple other technologies such as Python, Javascript, NodeJS, and much more.

curl --location --request POST 'https://prompts.riku.ai/webhook/run' \
--header 'Content-Type: application/json' \
--data-raw '{
	"Name": "NAME OF ACCOUNTHOLDER",
	"Secret": "SECRET KEY (GET FROM MANAGE ACCOUNT)",
	"Prompt ID": "COPY FROM RUN PROMPT PAGES",
	"Input 1": "THE FIRST INPUT",
	"Input 2": "THE SECOND INPUT",
	"Input 3": "THE THIRD INPUT",
	"Input 4": "THE FOURTH INPUT",
	"Input 5": "THE FIFTH INPUT",
	"n": <number of how many varations to generate>
}'

This is the request you can use for anything you want to use from Riku. The POST request is going to an endpoint regardless of which technology the prompt is using and we will route it accordingly for you.

In the code example above, we provide data for Input 1 - 5. Our system will automatically exclude any Inputs that are not relevant to the Prompt ID specified. If you have a Prompt ID with zero inputs, you can still include the Input fields but they won't be used for anything.

The main points to keep in mind for beginners when using this request are;

  • It is a POST request.

  • There is one header field of "Content-Type": "application/json".

  • The "n" field is a number and generally, we don't recommend putting that as more than 6. Also, ensure that you do not put that number in quotations. It should be "n": 5 and not "n": "5". Final note to remember is that the final field of the JSON does not have a comma at the end.

Postman