Python
import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
run = client.agents.runs.create(
agent_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
)
print(run)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const run = await client.agents.runs.create('7c9e6679-7425-40de-944b-e07fc1f90ae7');
console.log(run);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.agents()
.runs()
.create("7c9e6679-7425-40de-944b-e07fc1f90ae7")
.send()
.await?;
println!("{:?}", response);
Ok(())
}import Foundation
import Profound
let client = ProfoundClient(
apiKey: ProcessInfo.processInfo.environment["PROFOUND_API_KEY"]
)
let response = try await client.agents.runs.create("7c9e6679-7425-40de-944b-e07fc1f90ae7")
print(response)curl --request POST \
--url https://api.tryprofound.com/v1/agents/{agent_id}/runs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"inputs": {}
}'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {}})
};
fetch('https://api.tryprofound.com/v1/agents/{agent_id}/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.tryprofound.com/v1/agents/{agent_id}/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([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.tryprofound.com/v1/agents/{agent_id}/runs"
payload := strings.NewReader("{\n \"inputs\": {}\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))
}HttpResponse<String> response = Unirest.post("https://api.tryprofound.com/v1/agents/{agent_id}/runs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/agents/{agent_id}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"started_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Agents
Run an agent
Start a new run for an agent.
Runs always execute the agent’s live published version, so the agent must be
published first with POST /v1/agents/{agent_id}/publish. Unpublished drafts
cannot be run.
POST
/
v1
/
agents
/
{agent_id}
/
runs
Python
import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
run = client.agents.runs.create(
agent_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
)
print(run)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const run = await client.agents.runs.create('7c9e6679-7425-40de-944b-e07fc1f90ae7');
console.log(run);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.agents()
.runs()
.create("7c9e6679-7425-40de-944b-e07fc1f90ae7")
.send()
.await?;
println!("{:?}", response);
Ok(())
}import Foundation
import Profound
let client = ProfoundClient(
apiKey: ProcessInfo.processInfo.environment["PROFOUND_API_KEY"]
)
let response = try await client.agents.runs.create("7c9e6679-7425-40de-944b-e07fc1f90ae7")
print(response)curl --request POST \
--url https://api.tryprofound.com/v1/agents/{agent_id}/runs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"inputs": {}
}'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {}})
};
fetch('https://api.tryprofound.com/v1/agents/{agent_id}/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.tryprofound.com/v1/agents/{agent_id}/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([
'inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.tryprofound.com/v1/agents/{agent_id}/runs"
payload := strings.NewReader("{\n \"inputs\": {}\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))
}HttpResponse<String> response = Unirest.post("https://api.tryprofound.com/v1/agents/{agent_id}/runs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/agents/{agent_id}/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"started_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Response
Successful Response
Run details returned after a run request is accepted.
Was this page helpful?