curl --request POST \
--url https://api.edenai.run/v3/manage/keys/ \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"active_balance": true,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.edenai.run/v3/manage/keys/"
payload = {
"name": "<string>",
"active_balance": True,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
active_balance: true,
expire_time: '2023-11-07T05:31:56Z',
revoked_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.edenai.run/v3/manage/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/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>',
'active_balance' => true,
'expire_time' => '2023-11-07T05:31:56Z',
'revoked_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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/keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/keys/")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member": "jsmith@example.com",
"masked": "<string>",
"balance": "<string>",
"revoked": true,
"token_type": "sandbox_api_token",
"active_balance": true,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}Post managekeys
GET /v3/manage/keys (list, manage:read) and POST /v3/manage/keys (mint an inference
key, manage:write). Org-scoped through principals_in_org. Balance is pending-adjusted per
page on the list; the created secret is returned ONCE in the 201 and never by a read.
curl --request POST \
--url https://api.edenai.run/v3/manage/keys/ \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"active_balance": true,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.edenai.run/v3/manage/keys/"
payload = {
"name": "<string>",
"active_balance": True,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
active_balance: true,
expire_time: '2023-11-07T05:31:56Z',
revoked_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.edenai.run/v3/manage/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/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>',
'active_balance' => true,
'expire_time' => '2023-11-07T05:31:56Z',
'revoked_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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/keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/keys/")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/manage/keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"active_balance\": true,\n \"expire_time\": \"2023-11-07T05:31:56Z\",\n \"revoked_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member": "jsmith@example.com",
"masked": "<string>",
"balance": "<string>",
"revoked": true,
"token_type": "sandbox_api_token",
"active_balance": true,
"expire_time": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}Body
An org's inference key as the management plane exposes it. Never the secret or
its hash — only non-secret metadata, addressed by the stable key_id (id).
balance is the pending-adjusted LIVE sub-limit, not the raw settled column.
For a credit-ledger-enrolled org the stored Token.balance lags by whatever the
batched rollup has not settled, so a management admin must be shown available, not
settled (the shipped display-vs-accounting doctrine, mirrored from
utils/check_credits.py and manage_user_account_serializers). The un-settled
deltas (≤ 0, so they ADD) are batch-fetched once per page by the view and passed in
context["pending"]; a non-ledger org simply has none, so the add is a no-op.
id is null for an un-migrated legacy key (one still stored as a JWT, no
key_id yet); such a key is listed but not addressable via /keys/{id} until
it is regenerated onto the hashed scheme.
The token name
1 - 200sandbox_api_token- Sandboxapi_token- Back
sandbox_api_token, api_token Weither to use the balance field or not.
Response
An org's inference key as the management plane exposes it. Never the secret or
its hash — only non-secret metadata, addressed by the stable key_id (id).
balance is the pending-adjusted LIVE sub-limit, not the raw settled column.
For a credit-ledger-enrolled org the stored Token.balance lags by whatever the
batched rollup has not settled, so a management admin must be shown available, not
settled (the shipped display-vs-accounting doctrine, mirrored from
utils/check_credits.py and manage_user_account_serializers). The un-settled
deltas (≤ 0, so they ADD) are batch-fetched once per page by the view and passed in
context["pending"]; a non-ledger org simply has none, so the add is a no-op.
id is null for an un-migrated legacy key (one still stored as a JWT, no
key_id yet); such a key is listed but not addressable via /keys/{id} until
it is regenerated onto the hashed scheme.
The token name
200sandbox_api_token- Sandboxapi_token- Back
sandbox_api_token, api_token Weither to use the balance field or not.