Skip to main content
POST
/
external
/
agents
/
run
Run Agentic Task
curl --request POST \
  --url https://api.shieldbase.ai/external/agents/run \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --header 'X-Client-ID: <api-key>' \
  --header 'X-Secret: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "agent_id": "<string>",
  "model": "<string>",
  "document_ids": [
    "<string>"
  ],
  "timeout_seconds": 600
}
'
import requests

url = "https://api.shieldbase.ai/external/agents/run"

payload = {
"prompt": "<string>",
"agent_id": "<string>",
"model": "<string>",
"document_ids": ["<string>"],
"timeout_seconds": 600
}
headers = {
"X-Client-ID": "<api-key>",
"X-API-Key": "<api-key>",
"X-Secret": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-API-Key': '<api-key>',
'X-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: '<string>',
agent_id: '<string>',
model: '<string>',
document_ids: ['<string>'],
timeout_seconds: 600
})
};

fetch('https://api.shieldbase.ai/external/agents/run', 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.shieldbase.ai/external/agents/run",
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([
'prompt' => '<string>',
'agent_id' => '<string>',
'model' => '<string>',
'document_ids' => [
'<string>'
],
'timeout_seconds' => 600
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Client-ID: <api-key>",
"X-Secret: <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.shieldbase.ai/external/agents/run"

payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"model\": \"<string>\",\n \"document_ids\": [\n \"<string>\"\n ],\n \"timeout_seconds\": 600\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Secret", "<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.shieldbase.ai/external/agents/run")
.header("X-Client-ID", "<api-key>")
.header("X-API-Key", "<api-key>")
.header("X-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"model\": \"<string>\",\n \"document_ids\": [\n \"<string>\"\n ],\n \"timeout_seconds\": 600\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.shieldbase.ai/external/agents/run")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-API-Key"] = '<api-key>'
request["X-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"model\": \"<string>\",\n \"document_ids\": [\n \"<string>\"\n ],\n \"timeout_seconds\": 600\n}"

response = http.request(request)
puts response.read_body
{
  "conversation_id": "<string>",
  "output": "<string>",
  "generated_files": "<array>",
  "success": true
}

Authorizations

X-Client-ID
string
header
required
X-API-Key
string
header
required
X-Secret
string
header
required

Body

application/json
prompt
string
required
agent_id
string
model
string
document_ids
string[]
timeout_seconds
integer
default:600

Response

200 - application/json

Task completed

conversation_id
string
output
string
generated_files
array
success
boolean