Skip to main content
POST
/
generation
/
feedback
Submit feedback for a generation
curl --request POST \
  --url https://openrouter.ai/api/v1/generation/feedback \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "category": "incorrect_response",
  "comment": "The model repeated the same paragraph three times.",
  "generation_id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG"
}
'
import requests

url = "https://openrouter.ai/api/v1/generation/feedback"

payload = {
"category": "incorrect_response",
"comment": "The model repeated the same paragraph three times.",
"generation_id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG"
}
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({
category: 'incorrect_response',
comment: 'The model repeated the same paragraph three times.',
generation_id: 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG'
})
};

fetch('https://openrouter.ai/api/v1/generation/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://openrouter.ai/api/v1/generation/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([
'category' => 'incorrect_response',
'comment' => 'The model repeated the same paragraph three times.',
'generation_id' => 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG'
]),
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://openrouter.ai/api/v1/generation/feedback"

payload := strings.NewReader("{\n \"category\": \"incorrect_response\",\n \"comment\": \"The model repeated the same paragraph three times.\",\n \"generation_id\": \"gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG\"\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://openrouter.ai/api/v1/generation/feedback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"incorrect_response\",\n \"comment\": \"The model repeated the same paragraph three times.\",\n \"generation_id\": \"gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://openrouter.ai/api/v1/generation/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 \"category\": \"incorrect_response\",\n \"comment\": \"The model repeated the same paragraph three times.\",\n \"generation_id\": \"gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "success": true
  }
}
{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}
{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}
{
"error": {
"code": 404,
"message": "Resource not found"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
}
{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Body

application/json

Structured feedback about a specific generation

category
enum<string>
required

The category of feedback being reported

Available options:
latency,
incoherence,
incorrect_response,
formatting,
billing,
api_error,
other
Example:

"incorrect_response"

generation_id
string
required

The generation to submit feedback on

Minimum string length: 1
Example:

"gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG"

comment
string

An optional free-text comment describing the feedback

Maximum string length: 1000
Example:

"The model repeated the same paragraph three times."

Response

Feedback recorded successfully

Confirmation that the feedback was recorded

data
object
required