curl --request POST \
--url https://api.seltz.ai/v1/agent/runs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"api_key": null,
"output_schema": {},
"query": ""
}
'import requests
url = "https://api.seltz.ai/v1/agent/runs"
payload = {
"api_key": None,
"output_schema": {},
"query": ""
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_key: null, output_schema: {}, query: ''})
};
fetch('https://api.seltz.ai/v1/agent/runs', 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",
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([
'api_key' => null,
'output_schema' => [
],
'query' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/agent/runs"
payload := strings.NewReader("{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.seltz.ai/v1/agent/runs")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/agent/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}"
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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Start run
Returns the new run in pending state. Poll it by id until status reaches a terminal state.
curl --request POST \
--url https://api.seltz.ai/v1/agent/runs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"api_key": null,
"output_schema": {},
"query": ""
}
'import requests
url = "https://api.seltz.ai/v1/agent/runs"
payload = {
"api_key": None,
"output_schema": {},
"query": ""
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_key: null, output_schema: {}, query: ''})
};
fetch('https://api.seltz.ai/v1/agent/runs', 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",
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([
'api_key' => null,
'output_schema' => [
],
'query' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/agent/runs"
payload := strings.NewReader("{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.seltz.ai/v1/agent/runs")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/agent/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": null,\n \"output_schema\": {},\n \"query\": \"\"\n}"
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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Headers
Seltz API key: https://console.seltz.ai/api-keys
Body
Create-run request.
The API key, on gRPC requests. REST reads the x-api-key header instead.
Optional OpenAI-style response_format object requesting structured
output: {"type": "text" | "json_object" | "json_schema", ...}, with
name / schema / strict for type json_schema. A structured type
adds output.structured and its grounding alongside the cited text.
On gRPC the object is JSON-encoded.
The natural-language question. Instructions inside the query are followed.
Response
The new run, in pending state.
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.
pending, running, completed, failed, cancelled Why the run stopped. Set once the run reaches a terminal state.
finished, budget_reached, timeout, cancelled, invalid_output, internal_error