curl --request POST \
--url https://api.galadriel.com/v1/verified/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-4o"
}
'import requests
url = "https://api.galadriel.com/v1/verified/chat/completions"
payload = {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-4o"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{content: 'You are a helpful assistant.', role: 'system'},
{content: 'Hello!', role: 'user'}
],
model: 'gpt-4o'
})
};
fetch('https://api.galadriel.com/v1/verified/chat/completions', 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.galadriel.com/v1/verified/chat/completions",
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([
'messages' => [
[
'content' => 'You are a helpful assistant.',
'role' => 'system'
],
[
'content' => 'Hello!',
'role' => 'user'
]
],
'model' => 'gpt-4o'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.galadriel.com/v1/verified/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.galadriel.com/v1/verified/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galadriel.com/v1/verified/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}"
response = http.request(request)
puts response.read_body{
"id": "id",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today?",
"refusal": null,
"role": "assistant",
"function_call": null,
"tool_calls": null,
"audio": null
}
}
],
"created": 1728558433,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion",
"service_tier": null,
"system_fingerprint": "fp_9faba9f038",
"usage": {
"completion_tokens": 9,
"prompt_tokens": 19,
"total_tokens": 28,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"hash": "2c88aacb88de8b85a23e648eff20941285c16bb63cf9467811ee15bb64a40445",
"public_key": "Dp2k554Ebsij5RjuhjsZujVW2bJnQzfb43VYZSQ4NZo1",
"signature": "f298c3b1294221d1200041993818cfbfec66f33d1071ea821e5068978099cd60179dbf66839570dd9ada5f661e7d8475a03b536f42e540db3bed6f21d5741301",
"tx_hash": "e495424c395c501fb8fc013738fb481be85c1fbce9e595c308c31792983b2ffa10eca9c7dda0c8768ce12d0ff49a089cd5068d847eea8ae7544d5435d7f6010d",
"attestation": "enclave attestation"
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Proof of Sentience API
Tap into Galadriel’s verified inference which powers Daige’s Proof of Sentience. Returns additional proof metadata on top of OpenAI’s chat completion API.
curl --request POST \
--url https://api.galadriel.com/v1/verified/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-4o"
}
'import requests
url = "https://api.galadriel.com/v1/verified/chat/completions"
payload = {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-4o"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{content: 'You are a helpful assistant.', role: 'system'},
{content: 'Hello!', role: 'user'}
],
model: 'gpt-4o'
})
};
fetch('https://api.galadriel.com/v1/verified/chat/completions', 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.galadriel.com/v1/verified/chat/completions",
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([
'messages' => [
[
'content' => 'You are a helpful assistant.',
'role' => 'system'
],
[
'content' => 'Hello!',
'role' => 'user'
]
],
'model' => 'gpt-4o'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.galadriel.com/v1/verified/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.galadriel.com/v1/verified/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galadriel.com/v1/verified/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Hello!\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n}"
response = http.request(request)
puts response.read_body{
"id": "id",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today?",
"refusal": null,
"role": "assistant",
"function_call": null,
"tool_calls": null,
"audio": null
}
}
],
"created": 1728558433,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion",
"service_tier": null,
"system_fingerprint": "fp_9faba9f038",
"usage": {
"completion_tokens": 9,
"prompt_tokens": 19,
"total_tokens": 28,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"hash": "2c88aacb88de8b85a23e648eff20941285c16bb63cf9467811ee15bb64a40445",
"public_key": "Dp2k554Ebsij5RjuhjsZujVW2bJnQzfb43VYZSQ4NZo1",
"signature": "f298c3b1294221d1200041993818cfbfec66f33d1071ea821e5068978099cd60179dbf66839570dd9ada5f661e7d8475a03b536f42e540db3bed6f21d5741301",
"tx_hash": "e495424c395c501fb8fc013738fb481be85c1fbce9e595c308c31792983b2ffa10eca9c7dda0c8768ce12d0ff49a089cd5068d847eea8ae7544d5435d7f6010d",
"attestation": "enclave attestation"
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
{
"id": "id",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today?",
"refusal": null,
"role": "assistant",
"function_call": null,
"tool_calls": null,
"audio": null
}
}
],
"created": 1728558433,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion",
"service_tier": null,
"system_fingerprint": "fp_9faba9f038",
"usage": {
"completion_tokens": 9,
"prompt_tokens": 19,
"total_tokens": 28,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"hash": "2c88aacb88de8b85a23e648eff20941285c16bb63cf9467811ee15bb64a40445",
"public_key": "Dp2k554Ebsij5RjuhjsZujVW2bJnQzfb43VYZSQ4NZo1",
"signature": "f298c3b1294221d1200041993818cfbfec66f33d1071ea821e5068978099cd60179dbf66839570dd9ada5f661e7d8475a03b536f42e540db3bed6f21d5741301",
"tx_hash": "e495424c395c501fb8fc013738fb481be85c1fbce9e595c308c31792983b2ffa10eca9c7dda0c8768ce12d0ff49a089cd5068d847eea8ae7544d5435d7f6010d",
"attestation": "enclave attestation"
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Authorizations
Bearer authentication header.
example value: Bearer Galadriel-API-key
Get API key from Galadriel dashboard.
Headers
Optional bearer authentication header for calling a fine-tuned model hosted on external service like OpenAI or Anthropic.
When a fine-tuned model is provided in the model field in body, you must pass the authentication key which has the access to that model.
The header should be in the format eg. Bearer OpenAI-API-Key.
Body
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
Response
Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed.

