Create API key
curl --request POST \
--url https://api.kitefrost.ai/v1/keys \
--header 'Content-Type: application/json' \
--data '
{
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "sk",
"scopes": [
"<string>"
],
"name": "<string>",
"pack_scopes": [
"<string>"
]
}
'import requests
url = "https://api.kitefrost.ai/v1/keys"
payload = {
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "sk",
"scopes": ["<string>"],
"name": "<string>",
"pack_scopes": ["<string>"]
}
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({
tenant_id: '<string>',
project_id: '<string>',
key_type: 'sk',
scopes: ['<string>'],
name: '<string>',
pack_scopes: ['<string>']
})
};
fetch('https://api.kitefrost.ai/v1/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.kitefrost.ai/v1/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([
'tenant_id' => '<string>',
'project_id' => '<string>',
'key_type' => 'sk',
'scopes' => [
'<string>'
],
'name' => '<string>',
'pack_scopes' => [
'<string>'
]
]),
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.kitefrost.ai/v1/keys"
payload := strings.NewReader("{\n \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\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.kitefrost.ai/v1/keys")
.header("Content-Type", "application/json")
.body("{\n \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/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 \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_prefix": "<string>",
"key_id": "<string>",
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "<string>",
"scopes": [
"<string>"
],
"key": "<string>",
"revoked": false,
"name": "<string>",
"pack_scopes": [
"<string>"
]
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}keys
Create API key
Create a new publishable (pk) or secret (sk) API key. The full key value is returned once in this response and cannot be retrieved again - store it securely. Requires scope: api-keys:manage.
POST
/
v1
/
keys
Create API key
curl --request POST \
--url https://api.kitefrost.ai/v1/keys \
--header 'Content-Type: application/json' \
--data '
{
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "sk",
"scopes": [
"<string>"
],
"name": "<string>",
"pack_scopes": [
"<string>"
]
}
'import requests
url = "https://api.kitefrost.ai/v1/keys"
payload = {
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "sk",
"scopes": ["<string>"],
"name": "<string>",
"pack_scopes": ["<string>"]
}
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({
tenant_id: '<string>',
project_id: '<string>',
key_type: 'sk',
scopes: ['<string>'],
name: '<string>',
pack_scopes: ['<string>']
})
};
fetch('https://api.kitefrost.ai/v1/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.kitefrost.ai/v1/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([
'tenant_id' => '<string>',
'project_id' => '<string>',
'key_type' => 'sk',
'scopes' => [
'<string>'
],
'name' => '<string>',
'pack_scopes' => [
'<string>'
]
]),
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.kitefrost.ai/v1/keys"
payload := strings.NewReader("{\n \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\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.kitefrost.ai/v1/keys")
.header("Content-Type", "application/json")
.body("{\n \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/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 \"tenant_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_type\": \"sk\",\n \"scopes\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"pack_scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_prefix": "<string>",
"key_id": "<string>",
"tenant_id": "<string>",
"project_id": "<string>",
"key_type": "<string>",
"scopes": [
"<string>"
],
"key": "<string>",
"revoked": false,
"name": "<string>",
"pack_scopes": [
"<string>"
]
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}Body
application/json
Response
API key created - full key shown once
⌘I