Create a Prediction
curl --request POST \
--url https://api.muna.ai/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag": "<string>",
"clientId": "<string>",
"configurationId": "<string>",
"deviceId": "<string>",
"predictionId": "<string>"
}
'import requests
url = "https://api.muna.ai/v1/predictions"
payload = {
"tag": "<string>",
"clientId": "<string>",
"configurationId": "<string>",
"deviceId": "<string>",
"predictionId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tag: '<string>',
clientId: '<string>',
configurationId: '<string>',
deviceId: '<string>',
predictionId: '<string>'
})
};
fetch('https://api.muna.ai/v1/predictions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.muna.ai/v1/predictions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tag' => '<string>',
'clientId' => '<string>',
'configurationId' => '<string>',
'deviceId' => '<string>',
'predictionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.muna.ai/v1/predictions"
payload := strings.NewReader("{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.muna.ai/v1/predictions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.muna.ai/v1/predictions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tag": "<string>",
"configuration": "<string>",
"resources": [
{
"type": "<string>",
"url": "<string>",
"name": "<string>"
}
],
"created": "<string>"
}Predictions
Create a Prediction
POST
/
v1
/
predictions
Create a Prediction
curl --request POST \
--url https://api.muna.ai/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag": "<string>",
"clientId": "<string>",
"configurationId": "<string>",
"deviceId": "<string>",
"predictionId": "<string>"
}
'import requests
url = "https://api.muna.ai/v1/predictions"
payload = {
"tag": "<string>",
"clientId": "<string>",
"configurationId": "<string>",
"deviceId": "<string>",
"predictionId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tag: '<string>',
clientId: '<string>',
configurationId: '<string>',
deviceId: '<string>',
predictionId: '<string>'
})
};
fetch('https://api.muna.ai/v1/predictions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.muna.ai/v1/predictions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tag' => '<string>',
'clientId' => '<string>',
'configurationId' => '<string>',
'deviceId' => '<string>',
'predictionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.muna.ai/v1/predictions"
payload := strings.NewReader("{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.muna.ai/v1/predictions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.muna.ai/v1/predictions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tag\": \"<string>\",\n \"clientId\": \"<string>\",\n \"configurationId\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"predictionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tag": "<string>",
"configuration": "<string>",
"resources": [
{
"type": "<string>",
"url": "<string>",
"name": "<string>"
}
],
"created": "<string>"
}Body
Predictor tag.
Prediction client identifier.
Prediction configuration identifier.
Device identifier, used for choosing optimal implementation to respond with.
For making predictions with embedded predictors, providing the original prediction identifier ensures that
the same prediction implementation is provided to the device.
Response
Prediction identifier.
Predictor tag.
Prediction configuration token.
Prediction creation date.
⌘I