Skip to main content
Feedback
curl --request POST \
  --url https://api.usetokenless.com/v1/usage/requests/{request_id}/feedback \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "comment": "<string>"
}
'
import requests

url = "https://api.usetokenless.com/v1/usage/requests/{request_id}/feedback"

payload = { "comment": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>'})
};

fetch('https://api.usetokenless.com/v1/usage/requests/{request_id}/feedback', 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.usetokenless.com/v1/usage/requests/{request_id}/feedback",
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([
'comment' => '<string>'
]),
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.usetokenless.com/v1/usage/requests/{request_id}/feedback"

payload := strings.NewReader("{\n \"comment\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.usetokenless.com/v1/usage/requests/{request_id}/feedback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.usetokenless.com/v1/usage/requests/{request_id}/feedback")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "request_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "prompt_preview": "<string>",
  "response_preview": "<string>",
  "provider_ranks": [
    {
      "model_id": "<string>",
      "rank": 123
    }
  ],
  "total_cost_nanos": 123,
  "total_input_tokens": 123,
  "total_output_tokens": 123,
  "selected_model_id": "<string>",
  "byok": true,
  "session_id": "<string>",
  "agent_id": "<string>",
  "parent_agent_id": "<string>",
  "session_source": "<string>",
  "credential_name": "<string>",
  "feedback": {
    "comment": "<string>",
    "reason": "<string>"
  }
}
POST/v1/usage/requests/{request_id}/feedback

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

request_id
string
required

Body

application/json
rating
enum<integer> | null
Available options:
-1,
1,
null
comment
string | null
Maximum string length: 2000
kind
enum<string> | null
Available options:
bug,
feedback,
null
reason
enum<string> | null
Available options:
too_expensive,
too_slow,
great_value,
stronger_model_needed,
wrong_model,
bad_tool_call,
null

Response

Updated routed-request record.

request_id
string
required
created_at
string<date-time>
required
prompt_preview
string
required
response_preview
string
required
provider_ranks
object[]
required
total_cost_nanos
integer<int64>
required
total_input_tokens
integer<int64>
required
total_output_tokens
integer<int64>
required
selected_model_id
string
byok
boolean
routing_mode
enum<string>
Available options:
pro,
max,
ultra_saver
session_id
string
agent_id
string
parent_agent_id
string
session_source
string
credential_name
string
feedback
object