Setup Your Pipeline’s API
Sign up for jetski.ai and then fill out the form to deploy your own AI. No instructions needed!Call Your API
Copy your autogenerated API endpoint and make a POST request with the following JSON payload:Copy
{
"parameters" :
{
"example_param" : "example_value"
},
"messages":
[
{
"type" : "human",
"content" : "who in the right mind jetski's in shark water?"
},
{
"type" : "assistant",
"content" : "Someone who lives life on the fin!"
}
]
}
- curl
- python
- javascript
Copy
curl -H 'Content-Type: application/json' \\
-d '{ \n "parameters":
{
},
"messages": [
{
"type" : "type of message ("human" or "assistant")",
"content" : "content of message"
},
{
"type" : "type of message ("human" or "assistant")",
"content" : "content of message"
},
]}' \\
-X POST \\
<your endpoint goes here>
Copy
import requests
# The URL you want to make a POST request to
url = <your endpoint goes here>
# Data you want to send in JSON format
data = { "parameters":
{
}, "messages": [
{
"type" : "type of message ('human' or 'assistant')",
"content" : "content of message"
},
{
"type" : "type of message ('human' or 'assistant')",
"content" : "content of message"
},
]}
# Optional: Custom headers
headers = {
'Content-Type': 'application/json'
}
# Make the POST request
response = requests.post(url, json=data, headers=headers)
# Check if the request was successful
if response.status_code == 200:
print('Success!')
# Process the response if necessary
print(response.json())
else:
print('An error occurred:', response.text)
Copy
// The URL you want to make a POST request to
const url = <your endpoint goes here>;
// Data you want to send in JSON format
const data = { parameters:
{
} , messages: [
{
"type" : "type of message ("human" or "assistant")",
"content" : "content of message"
},
{
"type" : "type of message ("human" or "assistant")",
"content" : "content of message"
},
]};
// Create an options object that includes method, headers, and body
const options = {
method: 'POST', // Specify the request method
headers: {
Content-Type: 'application/json' // Specify the content type of the request
},
body: JSON.stringify(data) // Convert the JavaScript object to a JSON string
};
// Use the fetch API to make the POST request
fetch(url, options)
.then(response => {
if (!response.ok) {
// If the response is not ok, throw an error
throw new Error('Network response was not ok');
}
return response.json(); // Parse the response as JSON
})
.then(data => {
console.log('Success:', data); // Log the data on success
})
.catch(error => {
console.error('Error:', error); // Log any errors
});
.png)