curl --request POST \
--url https://api.edenai.run/v3/alpha/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "<string>",
"questions": {},
"model": "<string>",
"tags": {
"client": "acme",
"project": "invoices"
},
"metadata": {},
"extra_headers": {},
"extra_body": {}
}
'import requests
url = "https://api.edenai.run/v3/alpha/decisions"
payload = {
"state": "<string>",
"questions": {},
"model": "<string>",
"tags": {
"client": "acme",
"project": "invoices"
},
"metadata": {},
"extra_headers": {},
"extra_body": {}
}
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({
state: '<string>',
questions: {},
model: '<string>',
tags: {client: 'acme', project: 'invoices'},
metadata: {},
extra_headers: {},
extra_body: {}
})
};
fetch('https://api.edenai.run/v3/alpha/decisions', 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.edenai.run/v3/alpha/decisions",
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([
'state' => '<string>',
'questions' => [
],
'model' => '<string>',
'tags' => [
'client' => 'acme',
'project' => 'invoices'
],
'metadata' => [
],
'extra_headers' => [
],
'extra_body' => [
]
]),
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.edenai.run/v3/alpha/decisions"
payload := strings.NewReader("{\n \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\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.edenai.run/v3/alpha/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/alpha/decisions")
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 \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"cost": 123,
"provider": "<string>",
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Decisions
TypeSafe-compatible System One decisions endpoint.
curl --request POST \
--url https://api.edenai.run/v3/alpha/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "<string>",
"questions": {},
"model": "<string>",
"tags": {
"client": "acme",
"project": "invoices"
},
"metadata": {},
"extra_headers": {},
"extra_body": {}
}
'import requests
url = "https://api.edenai.run/v3/alpha/decisions"
payload = {
"state": "<string>",
"questions": {},
"model": "<string>",
"tags": {
"client": "acme",
"project": "invoices"
},
"metadata": {},
"extra_headers": {},
"extra_body": {}
}
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({
state: '<string>',
questions: {},
model: '<string>',
tags: {client: 'acme', project: 'invoices'},
metadata: {},
extra_headers: {},
extra_body: {}
})
};
fetch('https://api.edenai.run/v3/alpha/decisions', 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.edenai.run/v3/alpha/decisions",
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([
'state' => '<string>',
'questions' => [
],
'model' => '<string>',
'tags' => [
'client' => 'acme',
'project' => 'invoices'
],
'metadata' => [
],
'extra_headers' => [
],
'extra_body' => [
]
]),
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.edenai.run/v3/alpha/decisions"
payload := strings.NewReader("{\n \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\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.edenai.run/v3/alpha/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/alpha/decisions")
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 \"state\": \"<string>\",\n \"questions\": {},\n \"model\": \"<string>\",\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"metadata\": {},\n \"extra_headers\": {},\n \"extra_body\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"cost": 123,
"provider": "<string>",
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
TypeSafe's POST /v1/systemone request body, plus minimal Eden extensions.
Unknown top-level fields are forwarded to the provider (extra="allow" via the base
mixin, which also rejects connection keys).
The content to decide about: a plain string, or a JSON object / array of related context.
Typed questions keyed by name: noul (yes/no probability), choice (one of the criteria keys) or score (position on the ordered criteria rubric).
Show child attributes
Show child attributes
Model identifier in 'provider/model' format, e.g. 'typesafe/jev-latest'.
Up to 10 key/value labels recorded with this call, for filtering and grouping usage. Merged with the X-EdenAI-Tags header.
{ "client": "acme", "project": "invoices" }
Arbitrary metadata attached to the request.
Additional HTTP headers forwarded to the provider API.
Show child attributes
Show child attributes
Additional body fields forwarded to the provider API.
Response
Successful Response
TypeSafe's response (typed answers, usage, request id) + Eden cost and provider.