Inferência LLM com Recibo
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
}Orquestrações e Fluxos de Trabalho
Registrar Inferência LLM
Registre uma chamada de inferência LLM dentro de uma orquestração para rastreamento de custos e auditoria de proveniência.
POST
/
v1
/
orchestrate
/
llm
/
inference
Inferência LLM com Recibo
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
}Registra uma chamada de inferência LLM individual que ocorreu dentro de uma orquestração em execução. Cada registro de inferência captura o modelo, provedor, contagens de tokens, latência, custo e hashes de conteúdo — permitindo atribuição de custo granular e auditoria de proveniência de cada decisão de IA.
Este endpoint é chamado pelos tempos de execução do agente após a conclusão de cada chamada de API LLM. O registro de inferência é vinculado à orquestração pai e incluído no recibo final do log de transparência.
Resposta
Corpo
application/json

