Hash a decision spec
curl --request POST \
--url https://api.moonbounce.ai/v1/specs/hash \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"format": "moonbounce.spec/0",
"nodes": {},
"output": "<string>",
"guidance": "<string>",
"target": "<string>",
"meta": {
"title": "<string>",
"description": "<string>",
"owner": "<string>",
"tags": [
"<string>"
],
"display": {}
}
}
}
'import requests
url = "https://api.moonbounce.ai/v1/specs/hash"
payload = { "spec": {
"format": "moonbounce.spec/0",
"nodes": {},
"output": "<string>",
"guidance": "<string>",
"target": "<string>",
"meta": {
"title": "<string>",
"description": "<string>",
"owner": "<string>",
"tags": ["<string>"],
"display": {}
}
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {
format: 'moonbounce.spec/0',
nodes: {},
output: '<string>',
guidance: '<string>',
target: '<string>',
meta: {
title: '<string>',
description: '<string>',
owner: '<string>',
tags: ['<string>'],
display: {}
}
}
})
};
fetch('https://api.moonbounce.ai/v1/specs/hash', 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.moonbounce.ai/v1/specs/hash",
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([
'spec' => [
'format' => 'moonbounce.spec/0',
'nodes' => [
],
'output' => '<string>',
'guidance' => '<string>',
'target' => '<string>',
'meta' => [
'title' => '<string>',
'description' => '<string>',
'owner' => '<string>',
'tags' => [
'<string>'
],
'display' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.moonbounce.ai/v1/specs/hash"
payload := strings.NewReader("{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.moonbounce.ai/v1/specs/hash")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/specs/hash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"structure": "<string>",
"nodes": {},
"default_weights": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {}
}
}specs
Hash a decision spec
Returns the structure hash, every node’s hash and the default-weights hash of a spec, without registering it or touching data. Public: needs no API key. Key order, whitespace around a string, Unicode normalization (NFC), the order of inputs and combine terms, defaults spelled out (effect: "raises", prior: "mean", empty criteria) and meta do not change the hashes; any other edit to a prompt, guidance or target text does.
POST
/
v1
/
specs
/
hash
Hash a decision spec
curl --request POST \
--url https://api.moonbounce.ai/v1/specs/hash \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"format": "moonbounce.spec/0",
"nodes": {},
"output": "<string>",
"guidance": "<string>",
"target": "<string>",
"meta": {
"title": "<string>",
"description": "<string>",
"owner": "<string>",
"tags": [
"<string>"
],
"display": {}
}
}
}
'import requests
url = "https://api.moonbounce.ai/v1/specs/hash"
payload = { "spec": {
"format": "moonbounce.spec/0",
"nodes": {},
"output": "<string>",
"guidance": "<string>",
"target": "<string>",
"meta": {
"title": "<string>",
"description": "<string>",
"owner": "<string>",
"tags": ["<string>"],
"display": {}
}
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {
format: 'moonbounce.spec/0',
nodes: {},
output: '<string>',
guidance: '<string>',
target: '<string>',
meta: {
title: '<string>',
description: '<string>',
owner: '<string>',
tags: ['<string>'],
display: {}
}
}
})
};
fetch('https://api.moonbounce.ai/v1/specs/hash', 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.moonbounce.ai/v1/specs/hash",
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([
'spec' => [
'format' => 'moonbounce.spec/0',
'nodes' => [
],
'output' => '<string>',
'guidance' => '<string>',
'target' => '<string>',
'meta' => [
'title' => '<string>',
'description' => '<string>',
'owner' => '<string>',
'tags' => [
'<string>'
],
'display' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.moonbounce.ai/v1/specs/hash"
payload := strings.NewReader("{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.moonbounce.ai/v1/specs/hash")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/specs/hash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"spec\": {\n \"format\": \"moonbounce.spec/0\",\n \"nodes\": {},\n \"output\": \"<string>\",\n \"guidance\": \"<string>\",\n \"target\": \"<string>\",\n \"meta\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"owner\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"display\": {}\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"structure": "<string>",
"nodes": {},
"default_weights": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {}
}
}Body
application/json
Show child attributes
Show child attributes