curl --request GET \
--url https://api.edenai.run/v3/manage/routing-policies/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.edenai.run/v3/manage/routing-policies/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.edenai.run/v3/manage/routing-policies/', 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.edenai.run/v3/manage/routing-policies/",
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.edenai.run/v3/manage/routing-policies/"
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.edenai.run/v3/manage/routing-policies/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/routing-policies/")
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{
"results": [
{
"name": "<string>",
"scope": "organization",
"description": "<string>",
"enabled": true,
"strategy": "fallback",
"targets": [
{
"model": "<string>",
"weight": 50,
"retries": 1,
"credentials": "auto",
"routing": {
"sort": "cost",
"sticky": true,
"allow_fallbacks": true,
"allowed_providers": [
"<string>"
],
"ignored_providers": [
"<string>"
],
"order": [
"<string>"
],
"max_price": {
"input": 1,
"output": 1
},
"zero_data_retention": true
},
"region": "<string>"
}
],
"defaults": {
"routing": {
"sort": "cost",
"sticky": true,
"allow_fallbacks": true,
"allowed_providers": [
"<string>"
],
"ignored_providers": [
"<string>"
],
"order": [
"<string>"
],
"max_price": {
"input": 1,
"output": 1
},
"zero_data_retention": true
},
"credentials": "auto",
"retries": 0
},
"lock": [
"sort"
],
"fallbacks": [
"<string>"
],
"version": 123,
"etag": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "jsmith@example.com",
"updated_by": "jsmith@example.com"
}
],
"limit": 25,
"offset": 0,
"total_count": 123,
"next": "https://api.edenai.run/v3/manage/members/?limit=25&offset=25",
"previous": "<string>"
}List routing policies
Lists the routing policies you may use, ordered by name. A policy names the models to try for a request and how to pick among them, and is called from an inference request as @edenai/{name} or bound to an API key as its default_policy. Each entry’s scope says whose it is. With a management key, the organization’s policies are managed (manage:read to read, manage:write to write). With your own API key or session token, your personal policies are managed, and the organization’s can be read.
curl --request GET \
--url https://api.edenai.run/v3/manage/routing-policies/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.edenai.run/v3/manage/routing-policies/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.edenai.run/v3/manage/routing-policies/', 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.edenai.run/v3/manage/routing-policies/",
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.edenai.run/v3/manage/routing-policies/"
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.edenai.run/v3/manage/routing-policies/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/routing-policies/")
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{
"results": [
{
"name": "<string>",
"scope": "organization",
"description": "<string>",
"enabled": true,
"strategy": "fallback",
"targets": [
{
"model": "<string>",
"weight": 50,
"retries": 1,
"credentials": "auto",
"routing": {
"sort": "cost",
"sticky": true,
"allow_fallbacks": true,
"allowed_providers": [
"<string>"
],
"ignored_providers": [
"<string>"
],
"order": [
"<string>"
],
"max_price": {
"input": 1,
"output": 1
},
"zero_data_retention": true
},
"region": "<string>"
}
],
"defaults": {
"routing": {
"sort": "cost",
"sticky": true,
"allow_fallbacks": true,
"allowed_providers": [
"<string>"
],
"ignored_providers": [
"<string>"
],
"order": [
"<string>"
],
"max_price": {
"input": 1,
"output": 1
},
"zero_data_retention": true
},
"credentials": "auto",
"retries": 0
},
"lock": [
"sort"
],
"fallbacks": [
"<string>"
],
"version": 123,
"etag": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "jsmith@example.com",
"updated_by": "jsmith@example.com"
}
],
"limit": 25,
"offset": 0,
"total_count": 123,
"next": "https://api.edenai.run/v3/manage/members/?limit=25&offset=25",
"previous": "<string>"
}Authorizations
A management key (mgmt-eden...) to manage the organization's routing policies, or your own API key (sk-eden...) or session token to manage your personal ones, sent as Authorization: Bearer <key>.
Query Parameters
Number of results to return per page.
The initial index from which to return the results.
Only policies of this scope: user for your personal ones, organization for the organization's. Without it, both. A management key only ever sees the organization's.
organization, user Response
Show child attributes
Show child attributes
Page size applied to this response (max 100).
25
Index of the first item in this page.
0
Total number of items across all pages.
123
Absolute URL of the next page, or null on the last page.
"https://api.edenai.run/v3/manage/members/?limit=25&offset=25"
Absolute URL of the previous page, or null on the first page.