cURL
curl --request POST "https://rxresu.me/api/openapi/ai-providers" --header "x-api-key: <api-key>" --header "Content-Type: application/json" --data '{
"label": "<string>",
"provider": "openai",
"model": "<string>",
"apiKey": "<string>"
}'import requests
url = "https://rxresu.me/api/openapi/ai-providers"
payload = {
"label": "<string>",
"model": "<string>",
"apiKey": "<string>",
"fastModel": "<string>",
"capableModel": "<string>",
"baseURL": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
model: '<string>',
apiKey: '<string>',
fastModel: '<string>',
capableModel: '<string>',
baseURL: '<string>'
})
};
fetch('https://rxresu.me/api/openapi/ai-providers', 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://rxresu.me/api/openapi/ai-providers",
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([
'label' => '<string>',
'model' => '<string>',
'apiKey' => '<string>',
'fastModel' => '<string>',
'capableModel' => '<string>',
'baseURL' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://rxresu.me/api/openapi/ai-providers"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://rxresu.me/api/openapi/ai-providers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rxresu.me/api/openapi/ai-providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"managed": true,
"id": "<string>",
"label": "<string>",
"provider": "openai",
"model": "<string>",
"fastModel": "<string>",
"capableModel": "<string>",
"baseURL": "<string>",
"enabled": true,
"isDefault": true,
"testStatus": "<string>",
"testError": "<string>",
"testErrorKind": "<string>",
"apiKeyPreview": "<string>",
"apiKeyFingerprint": "<string>",
"recipientVersion": "<string>",
"lastTestedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "That provider setup isn't valid. Check the base URL and try again.",
"data": "<unknown>"
}{
"defined": true,
"code": "FORBIDDEN",
"status": 403,
"message": "AI is set up by the server administrator and can't be changed here.",
"data": "<unknown>"
}{
"defined": true,
"code": "PRECONDITION_FAILED",
"status": 412,
"message": "AI providers aren't available on this server. Ask the server administrator to set ENCRYPTION_SECRET.",
"data": "<unknown>"
}{
"defined": true,
"code": "<string>",
"status": 123,
"message": "<string>",
"data": "<unknown>"
}AI Providers
Create saved AI provider
Stores an encrypted provider/model/API key combination. The key is never returned.
POST
/
ai-providers
cURL
curl --request POST "https://rxresu.me/api/openapi/ai-providers" --header "x-api-key: <api-key>" --header "Content-Type: application/json" --data '{
"label": "<string>",
"provider": "openai",
"model": "<string>",
"apiKey": "<string>"
}'import requests
url = "https://rxresu.me/api/openapi/ai-providers"
payload = {
"label": "<string>",
"model": "<string>",
"apiKey": "<string>",
"fastModel": "<string>",
"capableModel": "<string>",
"baseURL": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
model: '<string>',
apiKey: '<string>',
fastModel: '<string>',
capableModel: '<string>',
baseURL: '<string>'
})
};
fetch('https://rxresu.me/api/openapi/ai-providers', 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://rxresu.me/api/openapi/ai-providers",
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([
'label' => '<string>',
'model' => '<string>',
'apiKey' => '<string>',
'fastModel' => '<string>',
'capableModel' => '<string>',
'baseURL' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://rxresu.me/api/openapi/ai-providers"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://rxresu.me/api/openapi/ai-providers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rxresu.me/api/openapi/ai-providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"model\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"fastModel\": \"<string>\",\n \"capableModel\": \"<string>\",\n \"baseURL\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"managed": true,
"id": "<string>",
"label": "<string>",
"provider": "openai",
"model": "<string>",
"fastModel": "<string>",
"capableModel": "<string>",
"baseURL": "<string>",
"enabled": true,
"isDefault": true,
"testStatus": "<string>",
"testError": "<string>",
"testErrorKind": "<string>",
"apiKeyPreview": "<string>",
"apiKeyFingerprint": "<string>",
"recipientVersion": "<string>",
"lastTestedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "That provider setup isn't valid. Check the base URL and try again.",
"data": "<unknown>"
}{
"defined": true,
"code": "FORBIDDEN",
"status": 403,
"message": "AI is set up by the server administrator and can't be changed here.",
"data": "<unknown>"
}{
"defined": true,
"code": "PRECONDITION_FAILED",
"status": 412,
"message": "AI providers aren't available on this server. Ask the server administrator to set ENCRYPTION_SECRET.",
"data": "<unknown>"
}{
"defined": true,
"code": "<string>",
"status": 123,
"message": "<string>",
"data": "<unknown>"
}Authorizations
apiKeybearerAuthcookieAuth
The API key to authenticate requests.
Body
application/json
Minimum string length:
1Available options:
openai, anthropic, gemini, vercel-ai-gateway, openrouter, mistral, cohere, xai, groq, deepseek, togetherai, fireworks, cerebras, perplexity, ollama, openai-compatible Minimum string length:
1Maximum string length:
200Maximum string length:
200Response
OK
Available options:
openai, anthropic, gemini, vercel-ai-gateway, openrouter, mistral, cohere, xai, groq, deepseek, togetherai, fireworks, cerebras, perplexity, ollama, openai-compatible Pattern:
^[a-f0-9]{64}$