curl --request PATCH \
--url https://api.edenai.run/v3/manage/keys/{key_id}/ \
--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/{key_id}/"
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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{key_id}/', 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/{key_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{key_id}/"
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("PATCH", 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.patch("https://api.edenai.run/v3/manage/keys/{key_id}/")
.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/{key_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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"
}Patch managekeys
GET (read), PATCH (write, policy fields + rename), DELETE (write, IRREVERSIBLE revoke)
for one key at /v3/manage/keys/{key_id}, org-scoped: a key_id not in the calling key’s org
is a 404, not another org’s key. DELETE destroys the secret and keeps the row marked revoked (see
destroy); there is no re-enable. Balance is pending-adjusted. Never returns the secret or its hash.
curl --request PATCH \
--url https://api.edenai.run/v3/manage/keys/{key_id}/ \
--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/{key_id}/"
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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{key_id}/', 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/{key_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{key_id}/"
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("PATCH", 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.patch("https://api.edenai.run/v3/manage/keys/{key_id}/")
.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/{key_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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"
}Path Parameters
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.