curl --request POST \
--url https://hip4-api.totalis.trade/v1/me/api-key-challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "CREATE",
"request": {
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"expires_in_days": 30
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/api-key-challenges"
payload = {
"action": "CREATE",
"request": {
"label": "Trading bot",
"scopes": ["account:read", "account:stream", "quote:accept", "rfq:read", "rfq:write"],
"expires_in_days": 30
}
}
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({
action: 'CREATE',
request: {
label: 'Trading bot',
scopes: ['account:read', 'account:stream', 'quote:accept', 'rfq:read', 'rfq:write'],
expires_in_days: 30
}
})
};
fetch('https://hip4-api.totalis.trade/v1/me/api-key-challenges', 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-key-challenges",
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([
'action' => 'CREATE',
'request' => [
'label' => 'Trading bot',
'scopes' => [
'account:read',
'account:stream',
'quote:accept',
'rfq:read',
'rfq:write'
],
'expires_in_days' => 30
]
]),
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-key-challenges"
payload := strings.NewReader("{\n \"action\": \"CREATE\",\n \"request\": {\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 }\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-key-challenges")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"CREATE\",\n \"request\": {\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 }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/api-key-challenges")
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 \"action\": \"CREATE\",\n \"request\": {\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 }\n}"
response = http.request(request)
puts response.read_body{
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"owner": "0x1111111111111111111111111111111111111111",
"message": "hip4-api.totalis.trade wants you to sign in with your Ethereum account:\n0x1111111111111111111111111111111111111111\n\nIssue a Totalis API key. It grants scoped API access, not financial signing authority.\n\nURI: https://hip4-api.totalis.trade/v1/me/api-keys\nVersion: 1\nChain ID: 999\nNonce: 5e1b9d3a7c2f8e4b6a0d1c9f3e7b5a2d8c4f6e1a9b3d7c5f2e8a4b6d0c1f9e3a\nIssued At: 2026-10-16T12:00:00Z\nExpiration Time: 2026-10-16T12:05:00Z\nRequest ID: 0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\nResources:\n- urn:totalis:purpose:issue_key\n- urn:totalis:environment:production\n- urn:totalis:vault:0x0cbffe7b40b64d5fd04f1288f4c9fe0fc50e2f83\n- urn:totalis:account:participant:0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a30\n- urn:totalis:action:create\n- urn:totalis:request:0xa1b9cf025fe7ed666e08ddd7fe03d7adf02634fb29933a5e85302055f0164567",
"expires_at": "2026-10-16T12:05:00Z"
}{
"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 challenge
Returns the EIP-4361 message your account wallet signs with personal_sign to create or rotate one key, bound to that exact request and usable once within 5 minutes.
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-key-challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "CREATE",
"request": {
"label": "Trading bot",
"scopes": [
"account:read",
"account:stream",
"quote:accept",
"rfq:read",
"rfq:write"
],
"expires_in_days": 30
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/api-key-challenges"
payload = {
"action": "CREATE",
"request": {
"label": "Trading bot",
"scopes": ["account:read", "account:stream", "quote:accept", "rfq:read", "rfq:write"],
"expires_in_days": 30
}
}
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({
action: 'CREATE',
request: {
label: 'Trading bot',
scopes: ['account:read', 'account:stream', 'quote:accept', 'rfq:read', 'rfq:write'],
expires_in_days: 30
}
})
};
fetch('https://hip4-api.totalis.trade/v1/me/api-key-challenges', 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-key-challenges",
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([
'action' => 'CREATE',
'request' => [
'label' => 'Trading bot',
'scopes' => [
'account:read',
'account:stream',
'quote:accept',
'rfq:read',
'rfq:write'
],
'expires_in_days' => 30
]
]),
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-key-challenges"
payload := strings.NewReader("{\n \"action\": \"CREATE\",\n \"request\": {\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 }\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-key-challenges")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"CREATE\",\n \"request\": {\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 }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/api-key-challenges")
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 \"action\": \"CREATE\",\n \"request\": {\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 }\n}"
response = http.request(request)
puts response.read_body{
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"owner": "0x1111111111111111111111111111111111111111",
"message": "hip4-api.totalis.trade wants you to sign in with your Ethereum account:\n0x1111111111111111111111111111111111111111\n\nIssue a Totalis API key. It grants scoped API access, not financial signing authority.\n\nURI: https://hip4-api.totalis.trade/v1/me/api-keys\nVersion: 1\nChain ID: 999\nNonce: 5e1b9d3a7c2f8e4b6a0d1c9f3e7b5a2d8c4f6e1a9b3d7c5f2e8a4b6d0c1f9e3a\nIssued At: 2026-10-16T12:00:00Z\nExpiration Time: 2026-10-16T12:05:00Z\nRequest ID: 0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33\nResources:\n- urn:totalis:purpose:issue_key\n- urn:totalis:environment:production\n- urn:totalis:vault:0x0cbffe7b40b64d5fd04f1288f4c9fe0fc50e2f83\n- urn:totalis:account:participant:0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a30\n- urn:totalis:action:create\n- urn:totalis:request:0xa1b9cf025fe7ed666e08ddd7fe03d7adf02634fb29933a5e85302055f0164567",
"expires_at": "2026-10-16T12:05:00Z"
}{
"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
Response
Five-minute, one-use SIWE challenge (purpose=issue_key) the account owner signs for the exact key request
An EIP-4361 (SIWE) message with purpose=issue_key. Its resources bind the environment, vault, account, owner version (makers), action, key (rotation) and the request digest.
Send back as proof.challenge_id.
^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$The address that must sign: the account wallet for a personal account, the controller for a maker.
^0x[0-9a-f]{40}$The EIP-4361 message to sign with personal_sign, exactly as returned; check its URI, account, action and key before signing.
1 - 8192When the challenge stops being accepted, 5 minutes after issue.
30^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$Was this page helpful?

