Update API Key Information
curl --request PUT \
--url https://geekai.dev/api/v1/api_keys/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "geekai",
"group": "balance",
"credit_limit": 10000,
"expired_at": "2025-12-31"
}
'import requests
url = "https://geekai.dev/api/v1/api_keys/{uuid}"
payload = {
"name": "geekai",
"group": "balance",
"credit_limit": 10000,
"expired_at": "2025-12-31"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'geekai',
group: 'balance',
credit_limit: 10000,
expired_at: '2025-12-31'
})
};
fetch('https://geekai.dev/api/v1/api_keys/{uuid}', 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://geekai.dev/api/v1/api_keys/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'geekai',
'group' => 'balance',
'credit_limit' => 10000,
'expired_at' => '2025-12-31'
]),
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://geekai.dev/api/v1/api_keys/{uuid}"
payload := strings.NewReader("{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://geekai.dev/api/v1/api_keys/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.dev/api/v1/api_keys/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"code": "validation_error",
"message": "validation error",
"details": {
"field": "error message"
}
}{
"code": "unauthorized",
"message": "invalid api key or token"
}{
"code": "invalid_request",
"message": "invalid request"
}{
"code": "invalid_request",
"message": "invalid request"
}API KEY
Update API Key
PUT
/
api_keys
/
{uuid}
Update API Key Information
curl --request PUT \
--url https://geekai.dev/api/v1/api_keys/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "geekai",
"group": "balance",
"credit_limit": 10000,
"expired_at": "2025-12-31"
}
'import requests
url = "https://geekai.dev/api/v1/api_keys/{uuid}"
payload = {
"name": "geekai",
"group": "balance",
"credit_limit": 10000,
"expired_at": "2025-12-31"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'geekai',
group: 'balance',
credit_limit: 10000,
expired_at: '2025-12-31'
})
};
fetch('https://geekai.dev/api/v1/api_keys/{uuid}', 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://geekai.dev/api/v1/api_keys/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'geekai',
'group' => 'balance',
'credit_limit' => 10000,
'expired_at' => '2025-12-31'
]),
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://geekai.dev/api/v1/api_keys/{uuid}"
payload := strings.NewReader("{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://geekai.dev/api/v1/api_keys/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.dev/api/v1/api_keys/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"geekai\",\n \"group\": \"balance\",\n \"credit_limit\": 10000,\n \"expired_at\": \"2025-12-31\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"code": "validation_error",
"message": "validation error",
"details": {
"field": "error message"
}
}{
"code": "unauthorized",
"message": "invalid api key or token"
}{
"code": "invalid_request",
"message": "invalid request"
}{
"code": "invalid_request",
"message": "invalid request"
}Updates the information of a specific API key using its UUID.
Authorizations
bearerAuthapiKeyAuth
token
Body
application/json
A name to identify the API key's use case, for management and cost tracking.
Example:
"geekai"
The proxy strategy group. Valid values are: lowcost (prioritize low cost), balance (balanced), ha (high availability), and none (no proxy).
Available options:
lowcost, balance, ha, none Example:
"balance"
Credit limit in "coins" (1 coin = 0.01 currency units). Limits consumption for time-limited API keys. Usage is blocked after the limit is reached.
Example:
10000
Expiration date. The key becomes unusable after this date.
Example:
"2025-12-31"
Response
Success
Success/failure message.
Was this page helpful?
⌘I
