Retrieve an agent run
curl --request GET \
--url https://api.seltz.ai/v1/agent/runs/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.seltz.ai/v1/agent/runs/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.seltz.ai/v1/agent/runs/{id}', 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.seltz.ai/v1/agent/runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/agent/runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.seltz.ai/v1/agent/runs/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/agent/runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"completed_at": null,
"created_at": "",
"id": "",
"object": "",
"output": {
"grounding": [],
"sources": [],
"structured": {},
"text": null
},
"request": {
"output_schema": {},
"query": ""
},
"started_at": null,
"status": "pending",
"stop_reason": "finished"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Agent
Get run
Poll until status reaches a terminal state.
GET
/
v1
/
agent
/
runs
/
{id}
Retrieve an agent run
curl --request GET \
--url https://api.seltz.ai/v1/agent/runs/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.seltz.ai/v1/agent/runs/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.seltz.ai/v1/agent/runs/{id}', 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.seltz.ai/v1/agent/runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/agent/runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.seltz.ai/v1/agent/runs/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/agent/runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"completed_at": null,
"created_at": "",
"id": "",
"object": "",
"output": {
"grounding": [],
"sources": [],
"structured": {},
"text": null
},
"request": {
"output_schema": {},
"query": ""
},
"started_at": null,
"status": "pending",
"stop_reason": "finished"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Headers
Seltz API key: https://console.seltz.ai/api-keys
Path Parameters
The run id.
Response
The run.
An agent run.
When the run reached a terminal state. Unset until then.
When the run was created, as an ISO 8601 timestamp.
Unique run id.
Object type, always "agent.run".
The run's output. Its members are unset until the run completes.
Show child attributes
Show child attributes
The request the run was created with.
Show child attributes
Show child attributes
When the run started. Unset while pending.
Where the run is in its lifecycle.
Available options:
pending, running, completed, failed, cancelled Why the run stopped. Set once the run reaches a terminal state.
Available options:
finished, budget_reached, timeout, cancelled, invalid_output, internal_error