curl --request POST \
--url https://api.edenai.run/v3/manage/auth-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"expire_time": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.edenai.run/v3/manage/auth-keys/"
payload = {
"name": "<string>",
"scopes": [],
"expire_time": "2023-11-07T05:31:56Z"
}
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({name: '<string>', scopes: [], expire_time: '2023-11-07T05:31:56Z'})
};
fetch('https://api.edenai.run/v3/manage/auth-keys/', 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/auth-keys/",
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([
'name' => '<string>',
'scopes' => [
],
'expire_time' => '2023-11-07T05:31:56Z'
]),
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.edenai.run/v3/manage/auth-keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\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.edenai.run/v3/manage/auth-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/auth-keys/")
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 \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [
"manage:read"
],
"secret": "<string>",
"masked": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}Create a management key
Creates a management key with the manage:read and/or manage:write scopes, so an automated system can manage the organization without a person in the loop. The manage:mint scope cannot be granted here; keys with that scope are created from the dashboard. The response includes the key’s secret exactly once. Returns 409 if the name is already used by an active management key and 403 if the organization’s management-key limit is reached. Requires the manage:mint scope.
curl --request POST \
--url https://api.edenai.run/v3/manage/auth-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"expire_time": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.edenai.run/v3/manage/auth-keys/"
payload = {
"name": "<string>",
"scopes": [],
"expire_time": "2023-11-07T05:31:56Z"
}
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({name: '<string>', scopes: [], expire_time: '2023-11-07T05:31:56Z'})
};
fetch('https://api.edenai.run/v3/manage/auth-keys/', 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/auth-keys/",
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([
'name' => '<string>',
'scopes' => [
],
'expire_time' => '2023-11-07T05:31:56Z'
]),
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.edenai.run/v3/manage/auth-keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\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.edenai.run/v3/manage/auth-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/auth-keys/")
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 \"name\": \"<string>\",\n \"scopes\": [],\n \"expire_time\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [
"manage:read"
],
"secret": "<string>",
"masked": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}Authorizations
A management key (created from the organization dashboard or with POST /v3/manage/auth-keys), sent as Authorization: Bearer <management_key>. Inference API keys (sk-eden...) are not accepted on these endpoints.
Body
Settings for a new management key: a display name, the scopes it grants, and an optional
expire_time (omit it for a key that does not expire). manage:read and manage:write can be
combined; manage:mint is exclusive and can only be granted from the dashboard.
1 - 200manage:read- Read organization members, keys and usagemanage:write- Create, update and revoke keys and membersmanage:mint- Issue new worker management keys (issuer key)
manage:read, manage:write, manage:mint Response
A freshly created management key. secret is the full key value, shown only in this
response; store it securely.
manage:read- Read organization members, keys and usagemanage:write- Create, update and revoke keys and membersmanage:mint- Issue new worker management keys (issuer key)
manage:read, manage:write, manage:mint