Write a trace
curl --request POST \
--url https://api.feyn.ai/v1/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Feyn-Project: <x-feyn-project>' \
--data '
{
"traceKey": "run_123:decide",
"messages": [
{
"role": "user",
"content": "Subject: Invoice overdue"
},
{
"role": "assistant",
"content": "notify"
}
],
"output": "notify",
"latency": 491,
"status": 200,
"metadata": {
"workflow_run_id": "wf_88"
},
"startedAt": 1726000000000
}
'import requests
url = "https://api.feyn.ai/v1/traces"
payload = {
"traceKey": "run_123:decide",
"messages": [
{
"role": "user",
"content": "Subject: Invoice overdue"
},
{
"role": "assistant",
"content": "notify"
}
],
"output": "notify",
"latency": 491,
"status": 200,
"metadata": { "workflow_run_id": "wf_88" },
"startedAt": 1726000000000
}
headers = {
"X-Feyn-Project": "<x-feyn-project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Feyn-Project': '<x-feyn-project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
traceKey: 'run_123:decide',
messages: [
{role: 'user', content: 'Subject: Invoice overdue'},
{role: 'assistant', content: 'notify'}
],
output: 'notify',
latency: 491,
status: 200,
metadata: {workflow_run_id: 'wf_88'},
startedAt: 1726000000000
})
};
fetch('https://api.feyn.ai/v1/traces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}Observability
Write a trace
Upsert a trace on traceKey within the project.
POST
/
v1
/
traces
Write a trace
curl --request POST \
--url https://api.feyn.ai/v1/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Feyn-Project: <x-feyn-project>' \
--data '
{
"traceKey": "run_123:decide",
"messages": [
{
"role": "user",
"content": "Subject: Invoice overdue"
},
{
"role": "assistant",
"content": "notify"
}
],
"output": "notify",
"latency": 491,
"status": 200,
"metadata": {
"workflow_run_id": "wf_88"
},
"startedAt": 1726000000000
}
'import requests
url = "https://api.feyn.ai/v1/traces"
payload = {
"traceKey": "run_123:decide",
"messages": [
{
"role": "user",
"content": "Subject: Invoice overdue"
},
{
"role": "assistant",
"content": "notify"
}
],
"output": "notify",
"latency": 491,
"status": 200,
"metadata": { "workflow_run_id": "wf_88" },
"startedAt": 1726000000000
}
headers = {
"X-Feyn-Project": "<x-feyn-project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Feyn-Project': '<x-feyn-project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
traceKey: 'run_123:decide',
messages: [
{role: 'user', content: 'Subject: Invoice overdue'},
{role: 'assistant', content: 'notify'}
],
output: 'notify',
latency: 491,
status: 200,
metadata: {workflow_run_id: 'wf_88'},
startedAt: 1726000000000
})
};
fetch('https://api.feyn.ai/v1/traces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error"
}
}Body
application/json
Hide child attributes
Hide child attributes
⌘I