curl --request POST \
--url https://hip4-api.totalis.trade/v1/me/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"expires_in_days": 30,
"proof": {
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"signature": "0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b"
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/api-keys"
payload = {
"label": "Trading bot",
"scopes": ["account:read", "account:stream", "quote:accept", "rfq:read", "rfq:write"],
"expires_in_days": 30,
"proof": {
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"signature": "0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
label: 'Trading bot',
scopes: ['account:read', 'account:stream', 'quote:accept', 'rfq:read', 'rfq:write'],
expires_in_days: 30,
proof: {
challenge_id: '0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33',
signature: '0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b'
}
})
};
fetch('https://hip4-api.totalis.trade/v1/me/api-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://hip4-api.totalis.trade/v1/me/api-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([
'label' => 'Trading bot',
'scopes' => [
'account:read',
'account:stream',
'quote:accept',
'rfq:read',
'rfq:write'
],
'expires_in_days' => 30,
'proof' => [
'challenge_id' => '0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33',
'signature' => '0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://hip4-api.totalis.trade/v1/me/api-keys"
payload := strings.NewReader("{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://hip4-api.totalis.trade/v1/me/api-keys")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}"
response = http.request(request)
puts response.read_body{
"key": {
"id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a31",
"account": {
"kind": "PARTICIPANT",
"id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a30"
},
"environment": "production",
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"status": "ACTIVE",
"created_at": "2026-10-16T12:00:10Z",
"expires_at": "2026-11-15T12:00:10Z",
"last_used_at": null,
"revoked_at": null,
"rotated_from": null,
"overlap_until": null
},
"secret": "ttk_v1_prd_0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a31.q7Xv2LmP9sKd4RtYwB8nZc1HfGj6UeAo3VpNiMxTl0Q"
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}Create API key
Issues a scoped ttk_ key for the session’s account from a request your account wallet signed, and returns its secret this once.
Requires a wallet session or the Totalis app’s own sign-in session, sent with exactly one allowed Origin (otherwise FORBIDDEN); an API key cannot call it (UNAUTHENTICATED).
curl --request POST \
--url https://hip4-api.totalis.trade/v1/me/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"expires_in_days": 30,
"proof": {
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"signature": "0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b"
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/api-keys"
payload = {
"label": "Trading bot",
"scopes": ["account:read", "account:stream", "quote:accept", "rfq:read", "rfq:write"],
"expires_in_days": 30,
"proof": {
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"signature": "0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
label: 'Trading bot',
scopes: ['account:read', 'account:stream', 'quote:accept', 'rfq:read', 'rfq:write'],
expires_in_days: 30,
proof: {
challenge_id: '0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33',
signature: '0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b'
}
})
};
fetch('https://hip4-api.totalis.trade/v1/me/api-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://hip4-api.totalis.trade/v1/me/api-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([
'label' => 'Trading bot',
'scopes' => [
'account:read',
'account:stream',
'quote:accept',
'rfq:read',
'rfq:write'
],
'expires_in_days' => 30,
'proof' => [
'challenge_id' => '0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33',
'signature' => '0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://hip4-api.totalis.trade/v1/me/api-keys"
payload := strings.NewReader("{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://hip4-api.totalis.trade/v1/me/api-keys")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Trading bot\",\n \"scopes\": [\n \"account:read\",\n \"account:stream\",\n \"quote:accept\",\n \"rfq:read\",\n \"rfq:write\"\n ],\n \"expires_in_days\": 30,\n \"proof\": {\n \"challenge_id\": \"0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\",\n \"signature\": \"0x4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a1b\"\n }\n}"
response = http.request(request)
puts response.read_body{
"key": {
"id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a31",
"account": {
"kind": "PARTICIPANT",
"id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a30"
},
"environment": "production",
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"status": "ACTIVE",
"created_at": "2026-10-16T12:00:10Z",
"expires_at": "2026-11-15T12:00:10Z",
"last_used_at": null,
"revoked_at": null,
"rotated_from": null,
"overlap_until": null
},
"secret": "ttk_v1_prd_0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a31.q7Xv2LmP9sKd4RtYwB8nZc1HfGj6UeAo3VpNiMxTl0Q"
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_REQUEST",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}Authorizations
Wallet session: the access_token from POST /v1/auth/wallet-sessions, for a user who brings their own wallet to a partner's web page. It acts for that wallet's account with no scope limit, and is bound to the Origin it signed in from: send exactly one Origin header with that value, or the request is ORIGIN_REQUIRED or UNAUTHENTICATED. It lasts at most 30 days and ends after 7 idle days or at DELETE /v1/auth/wallet-sessions/current.
Headers
Lowercase UUIDv7 naming this command, unique per caller and route. A retry with the same key and body returns the original result; the same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED.
^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Body
The same shape for a personal account and a maker. proof is the owner's signature over the issue_key challenge for exactly this request without proof.
Your name for the key, 1 to 80 characters.
1 - 80Permissions the key holds; each must apply to the account, as the capabilities route lists.
1 - 32 elementsOne permission a key can hold. Each operation lists the scopes it requires, and a key holds only scopes that apply to its account, as the capabilities routes list. operations:read is reserved and never issued; maker:access:read is no longer issued and has no effect on a key that still carries it.
identity:read, account:read, account:stream, rfq:read, rfq:write, quote:write, quote:read, replay:read, vault:read, vault:write, quote:accept, position:cashout, funding:deposit, funding:withdraw, sponsorship:use, maker:access:read, operations:read, operations:submit The account owner's signature over the challenge for exactly this request without proof.
Show child attributes
Show child attributes
Lifetime in days, 1 to 90, or 0 for no expiry; 30 when omitted.
0 <= x <= 90Response
The new key and its secret, shown only in this response.
The new key's metadata.
Show child attributes
Show child attributes
The ttk_ secret, shown only in this response; a retry of the same request answers SECRET_UNAVAILABLE, so store it now.
^ttk_v1_(dev|stg|prd)_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.[A-Za-z0-9_-]{43}$Was this page helpful?

