Create API key
curl --request POST \
--url https://fanifyai.com/api/v1/hub/keys \
--header 'Content-Type: application/json' \
--header 'X-Requested-With: <x-requested-with>' \
--cookie .AspNetCore.Cookies= \
--data '
{
"name": "My laptop"
}
'import requests
url = "https://fanifyai.com/api/v1/hub/keys"
payload = { "name": "My laptop" }
headers = {
"cookie": ".AspNetCore.Cookies=",
"X-Requested-With": "<x-requested-with>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: '.AspNetCore.Cookies=',
'X-Requested-With': '<x-requested-with>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'My laptop'})
};
fetch('https://fanifyai.com/api/v1/hub/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://fanifyai.com/api/v1/hub/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' => 'My laptop'
]),
CURLOPT_COOKIE => ".AspNetCore.Cookies=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Requested-With: <x-requested-with>"
],
]);
$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://fanifyai.com/api/v1/hub/keys"
payload := strings.NewReader("{\n \"name\": \"My laptop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", ".AspNetCore.Cookies=")
req.Header.Add("X-Requested-With", "<x-requested-with>")
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://fanifyai.com/api/v1/hub/keys")
.header("cookie", ".AspNetCore.Cookies=")
.header("X-Requested-With", "<x-requested-with>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My laptop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fanifyai.com/api/v1/hub/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = '.AspNetCore.Cookies='
request["X-Requested-With"] = '<x-requested-with>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My laptop\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12,
"name": "My laptop",
"prefix": "fanify_sk_a1B2c3D4",
"created_at": "2026-09-07T10:00:00Z",
"last_used_at": null,
"key": "fanify_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}{
"type": "https://fanifyai.com/docs/hub/errors#invalid_input",
"title": "Invalid input",
"status": 400,
"code": "invalid_input"
}{
"type": "https://fanifyai.com/docs/hub/errors#unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized"
}{
"type": "https://fanifyai.com/docs/hub/errors#rate_limited",
"title": "Rate limit reached",
"status": 429,
"code": "rate_limited"
}API keys
Create API key
Creates an API key and returns its secret once.
POST
/
api
/
v1
/
hub
/
keys
Create API key
curl --request POST \
--url https://fanifyai.com/api/v1/hub/keys \
--header 'Content-Type: application/json' \
--header 'X-Requested-With: <x-requested-with>' \
--cookie .AspNetCore.Cookies= \
--data '
{
"name": "My laptop"
}
'import requests
url = "https://fanifyai.com/api/v1/hub/keys"
payload = { "name": "My laptop" }
headers = {
"cookie": ".AspNetCore.Cookies=",
"X-Requested-With": "<x-requested-with>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: '.AspNetCore.Cookies=',
'X-Requested-With': '<x-requested-with>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'My laptop'})
};
fetch('https://fanifyai.com/api/v1/hub/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://fanifyai.com/api/v1/hub/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' => 'My laptop'
]),
CURLOPT_COOKIE => ".AspNetCore.Cookies=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Requested-With: <x-requested-with>"
],
]);
$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://fanifyai.com/api/v1/hub/keys"
payload := strings.NewReader("{\n \"name\": \"My laptop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", ".AspNetCore.Cookies=")
req.Header.Add("X-Requested-With", "<x-requested-with>")
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://fanifyai.com/api/v1/hub/keys")
.header("cookie", ".AspNetCore.Cookies=")
.header("X-Requested-With", "<x-requested-with>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My laptop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fanifyai.com/api/v1/hub/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = '.AspNetCore.Cookies='
request["X-Requested-With"] = '<x-requested-with>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My laptop\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12,
"name": "My laptop",
"prefix": "fanify_sk_a1B2c3D4",
"created_at": "2026-09-07T10:00:00Z",
"last_used_at": null,
"key": "fanify_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}{
"type": "https://fanifyai.com/docs/hub/errors#invalid_input",
"title": "Invalid input",
"status": 400,
"code": "invalid_input"
}{
"type": "https://fanifyai.com/docs/hub/errors#unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized"
}{
"type": "https://fanifyai.com/docs/hub/errors#rate_limited",
"title": "Rate limit reached",
"status": 429,
"code": "rate_limited"
}Authorizations
Fanify console session. X-Requested-With: XMLHttpRequest is also required.
Headers
Must be XMLHttpRequest.
Body
application/json
API key name
Required string length:
1 - 100Was this page helpful?
