Set the plays' daily credit budget
curl --request PUT \
--url https://api.retriever.run/credits/play-daily-cap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cap": 300
}'import requests
url = "https://api.retriever.run/credits/play-daily-cap"
payload = { "cap": 300 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cap: 300})
};
fetch('https://api.retriever.run/credits/play-daily-cap', 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.retriever.run/credits/play-daily-cap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cap' => 300
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retriever.run/credits/play-daily-cap"
payload := strings.NewReader("{\n \"cap\": 300\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.retriever.run/credits/play-daily-cap")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cap\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retriever.run/credits/play-daily-cap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cap\": 300\n}"
response = http.request(request)
puts response.read_body{
"playDailyBudget": {
"cap": 123,
"day": "<string>",
"timezone": "<string>",
"spent": 123,
"held": 123,
"reached": true,
"minimum": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_authenticated",
"message": "A valid API key is required."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry in 12 s."
}
}Credits
Set the plays' daily credit budget
Sets the credits a day all the organization’s plays may spend together.
A scheduled play run starts with what is left of today’s budget: once
it is used, the agent concludes on what the run has, and a paid call
past it and its 10 % margin is refused before it reaches any provider.
A scheduled run does not start once nothing is left of today’s budget.
Any member of the organization may set it, never under minimum.
PUT
/
credits
/
play-daily-cap
Set the plays' daily credit budget
curl --request PUT \
--url https://api.retriever.run/credits/play-daily-cap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cap": 300
}'import requests
url = "https://api.retriever.run/credits/play-daily-cap"
payload = { "cap": 300 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cap: 300})
};
fetch('https://api.retriever.run/credits/play-daily-cap', 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.retriever.run/credits/play-daily-cap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cap' => 300
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retriever.run/credits/play-daily-cap"
payload := strings.NewReader("{\n \"cap\": 300\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.retriever.run/credits/play-daily-cap")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cap\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retriever.run/credits/play-daily-cap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cap\": 300\n}"
response = http.request(request)
puts response.read_body{
"playDailyBudget": {
"cap": 123,
"day": "<string>",
"timezone": "<string>",
"spent": 123,
"held": 123,
"reached": true,
"minimum": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "not_authenticated",
"message": "A valid API key is required."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry in 12 s."
}
}Body
application/json