Temporary API Keys
Create API key
POST
/
api
/
temporary-keys
/
Create API key
curl --request POST \
--url https://api.keywordsai.co/api/temporary-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiry_date": "<string>",
"max_usage": 123,
"rate_limit": 123,
"spending_limit": 123,
"is_test": true
}
'import requests
url = "https://api.keywordsai.co/api/temporary-keys/"
payload = {
"name": "<string>",
"expiry_date": "<string>",
"max_usage": 123,
"rate_limit": 123,
"spending_limit": 123,
"is_test": True
}
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>',
expiry_date: '<string>',
max_usage: 123,
rate_limit: 123,
spending_limit: 123,
is_test: true
})
};
fetch('https://api.keywordsai.co/api/temporary-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.keywordsai.co/api/temporary-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>',
'expiry_date' => '<string>',
'max_usage' => 123,
'rate_limit' => 123,
'spending_limit' => 123,
'is_test' => true
]),
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.keywordsai.co/api/temporary-keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\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.keywordsai.co/api/temporary-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/api/temporary-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 \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\n}"
response = http.request(request)
puts response.read_bodyYou can create a temporary API key by sending a POST request to the temporary keys endpoint. Keys will not show in the platform.
Body
string
The name of the temporary API key.
string
The expiry date of the temporary API key.It should be ISO format string, like
2025-03-15T01:19:33.263343Zinteger
Number of times this key can be used for logging. -1 being default, means infinite times
integer
Calls per minute. This is going to be overridden by the plan’s rate limit.Default is
Null.float
Spending with proxy. In US dollarsDefault is
Null.boolean
Is this a test key or a prod keyDefault is
false.Response
This is the only time the
api_key will show, KEEP IT SOME WHERE SAFE{
"id": "vcjRcdm8...",
"api_key": "vcjRcdm8.5hSZiXrA698O6KAiWX5CJj8Zrbp0H6gV", // This is the only time this will show, KEEP IT SOME WHERE SAFE
"prefix": "vcjRcdm8",
"created": "2025-03-16T01:19:17.074170Z",
"name": "Keywords AI temporary key",
"revoked": false,
"expiry_date": "2025-03-15T01:19:33.263343Z",
"key_usage": 0,
"max_usage": -1,
"last_used": "1970-01-01T00:00:00Z",
"rate_limit": null,
"spending_limit": null,
"spending_in_period": 0.0,
"is_test": false,
"is_temporary": true
}
Was this page helpful?
⌘I
Create API key
curl --request POST \
--url https://api.keywordsai.co/api/temporary-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiry_date": "<string>",
"max_usage": 123,
"rate_limit": 123,
"spending_limit": 123,
"is_test": true
}
'import requests
url = "https://api.keywordsai.co/api/temporary-keys/"
payload = {
"name": "<string>",
"expiry_date": "<string>",
"max_usage": 123,
"rate_limit": 123,
"spending_limit": 123,
"is_test": True
}
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>',
expiry_date: '<string>',
max_usage: 123,
rate_limit: 123,
spending_limit: 123,
is_test: true
})
};
fetch('https://api.keywordsai.co/api/temporary-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.keywordsai.co/api/temporary-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>',
'expiry_date' => '<string>',
'max_usage' => 123,
'rate_limit' => 123,
'spending_limit' => 123,
'is_test' => true
]),
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.keywordsai.co/api/temporary-keys/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\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.keywordsai.co/api/temporary-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/api/temporary-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 \"expiry_date\": \"<string>\",\n \"max_usage\": 123,\n \"rate_limit\": 123,\n \"spending_limit\": 123,\n \"is_test\": true\n}"
response = http.request(request)
puts response.read_body