Inférence LLM avec reçu
curl --request POST \
--url https://api.truthlocks.com/v1/orchestrate/llm/inference \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "<string>",
"prompt_hash": "<string>",
"provider": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
model_id: '<string>',
prompt_hash: '<string>',
provider: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/orchestrate/llm/inference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/orchestrate/llm/inference"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "<string>",
"prompt_hash": "<string>",
"provider": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/orchestrate/llm/inference"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"model_id\": \"<string>\",\n \"prompt_hash\": \"<string>\",\n \"provider\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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))
}{
"response": "<string>",
"receipt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tokens_used": 123,
"cost": 123
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Orchestrations et workflows
Enregistrer l'inférence LLM
Enregistre un appel d’inférence LLM au sein d’une orchestration pour le suivi des coûts et l’audit de la provenance.
POST
/
v1
/
orchestrate
/
llm
/
inference
Inférence LLM avec reçu
curl --request POST \
--url https://api.truthlocks.com/v1/orchestrate/llm/inference \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "<string>",
"prompt_hash": "<string>",
"provider": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
model_id: '<string>',
prompt_hash: '<string>',
provider: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/orchestrate/llm/inference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/orchestrate/llm/inference"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_id": "<string>",
"prompt_hash": "<string>",
"provider": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/orchestrate/llm/inference"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"model_id\": \"<string>\",\n \"prompt_hash\": \"<string>\",\n \"provider\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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))
}{
"response": "<string>",
"receipt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tokens_used": 123,
"cost": 123
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Enregistre un appel d’inférence LLM individuel qui s’est produit au sein d’une orchestration en cours d’exécution. Chaque enregistrement d’inférence capture le modèle, le fournisseur, le nombre de jetons, la latence, le coût et les hachages de contenu — permettant une attribution des coûts et un audit de provenance précis de chaque décision d’IA.
Ce point de terminaison est appelé par les runtimes d’agent après chaque appel d’API LLM. L’enregistrement d’inférence est lié à l’orchestration parente et inclus dans le reçu final du journal de transparence.
Réponse
Corps
application/json

