What a window of one model's requests would have cost on other models
curl --request GET \
--url https://api.impossibl.com/v1/requests/reprice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.impossibl.com/v1/requests/reprice"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.impossibl.com/v1/requests/reprice', 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.impossibl.com/v1/requests/reprice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.impossibl.com/v1/requests/reprice"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.impossibl.com/v1/requests/reprice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.impossibl.com/v1/requests/reprice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"message": "`model` and `messages` are required",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}API Reference
What a window of one model's requests would have cost on other models
Takes the account’s most recent successful requests served by model and prices
their token counts on every text model (or just candidates) at today’s prices,
including the account’s own rates. An estimate: another model would tokenize,
write and cache differently. BYOK requests are left out.
GET
/
v1
/
requests
/
reprice
What a window of one model's requests would have cost on other models
curl --request GET \
--url https://api.impossibl.com/v1/requests/reprice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.impossibl.com/v1/requests/reprice"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.impossibl.com/v1/requests/reprice', 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.impossibl.com/v1/requests/reprice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.impossibl.com/v1/requests/reprice"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.impossibl.com/v1/requests/reprice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.impossibl.com/v1/requests/reprice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"message": "`model` and `messages` are required",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}Authorizations
Query Parameters
Response
The window (requests, from, to, tokens), its actual cost, one cost per candidate, cheapest first, and a sample to verify with: size (the square root of the window, 2 to 50) and request_ids, every replayable request in random order, to read size at a time as disjoint samples for POST /v1/requests/{id}/replay
⌘I

