curl --request POST \
--url https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fcm_subtrader_id": "<string>"
}
'import requests
url = "https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate"
payload = {
"name": "<string>",
"fcm_subtrader_id": "<string>"
}
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>', fcm_subtrader_id: '<string>'})
};
fetch('https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate', 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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate",
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>',
'fcm_subtrader_id' => '<string>'
]),
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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fcm_subtrader_id\": \"<string>\"\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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fcm_subtrader_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate")
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 \"fcm_subtrader_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"api_key_id": "<string>",
"private_key": "<string>",
"warning": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}Generate Subtrader-Bound API Key
FCM clearing members only. Mint a subtrader-bound API key with a platform-generated RSA key pair. The private key appears exactly once in this response and cannot be retrieved again; store it securely before leaving the page or discarding the response.
curl --request POST \
--url https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fcm_subtrader_id": "<string>"
}
'import requests
url = "https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate"
payload = {
"name": "<string>",
"fcm_subtrader_id": "<string>"
}
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>', fcm_subtrader_id: '<string>'})
};
fetch('https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate', 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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate",
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>',
'fcm_subtrader_id' => '<string>'
]),
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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"fcm_subtrader_id\": \"<string>\"\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.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"fcm_subtrader_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.klear.kalshi.com/klear-api/v1/fcm/margin/api_keys/generate")
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 \"fcm_subtrader_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"api_key_id": "<string>",
"private_key": "<string>",
"warning": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>",
"service": "<string>"
}Authorizations
Pass Authorization: Bearer <admin_user_id>:<access_token> on each request.
Body
Response
API key generated
RSA private key in PEM format. Returned exactly once and never stored; it cannot be retrieved again.
Present only when the bound subtrader is missing a per-subtrader risk control - the initial-margin cap (margin lane) or the event-contract daily cap. The mint still succeeds; the warning names each missing control - an event-contract subtrader without a daily cap has its event-contract orders rejected until one is set, while a margin subtrader without an initial-margin cap is bounded only by firm-level risk limits.