API Reference
Run a multi-model comparison (async)
Send one prompt to N models and reserve credits for all of them atomically. If the wallet cannot cover the sum, nothing is charged and the call returns 402. The number of models is capped by your plan (Free 2, Pro 3, Studio 6, Team 12).
POST
/
v1
/
comparisons
Run a multi-model comparison (async)
curl --request POST \
--url https://api.rimp.io/v1/comparisons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"models": [
"<string>"
],
"params_shared": {}
}
'import requests
url = "https://api.rimp.io/v1/comparisons"
payload = {
"prompt": "<string>",
"models": ["<string>"],
"params_shared": {}
}
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({prompt: '<string>', models: ['<string>'], params_shared: {}})
};
fetch('https://api.rimp.io/v1/comparisons', 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.rimp.io/v1/comparisons",
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([
'prompt' => '<string>',
'models' => [
'<string>'
],
'params_shared' => [
]
]),
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.rimp.io/v1/comparisons"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\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.rimp.io/v1/comparisons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rimp.io/v1/comparisons")
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 \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "comparison",
"prompt": "<string>",
"params_shared": {},
"reserved_credits": 123,
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"generations": [
{
"id": "<string>",
"model": "<string>",
"status": "<string>",
"charged_credits": 123,
"refunded_credits": 123,
"error_code": "<string>",
"outputs": [
{
"id": "<string>",
"mime": "<string>",
"width": 123,
"height": 123,
"duration_s": "<string>",
"url": "<string>"
}
]
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Comparison queued. Poll /v1/comparisons/{id} or subscribe via webhook.
Available options:
comparison Available options:
queued, running, succeeded, partial, failed Show child attributes
Show child attributes
⌘I
Run a multi-model comparison (async)
curl --request POST \
--url https://api.rimp.io/v1/comparisons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"models": [
"<string>"
],
"params_shared": {}
}
'import requests
url = "https://api.rimp.io/v1/comparisons"
payload = {
"prompt": "<string>",
"models": ["<string>"],
"params_shared": {}
}
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({prompt: '<string>', models: ['<string>'], params_shared: {}})
};
fetch('https://api.rimp.io/v1/comparisons', 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.rimp.io/v1/comparisons",
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([
'prompt' => '<string>',
'models' => [
'<string>'
],
'params_shared' => [
]
]),
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.rimp.io/v1/comparisons"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\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.rimp.io/v1/comparisons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rimp.io/v1/comparisons")
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 \"prompt\": \"<string>\",\n \"models\": [\n \"<string>\"\n ],\n \"params_shared\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "comparison",
"prompt": "<string>",
"params_shared": {},
"reserved_credits": 123,
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"generations": [
{
"id": "<string>",
"model": "<string>",
"status": "<string>",
"charged_credits": 123,
"refunded_credits": 123,
"error_code": "<string>",
"outputs": [
{
"id": "<string>",
"mime": "<string>",
"width": 123,
"height": 123,
"duration_s": "<string>",
"url": "<string>"
}
]
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}