curl --request POST \
--url https://hip4-api.totalis.trade/v1/makers/{maker_id}/api-key-challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "CREATE",
"request": {
"label": "Quoter",
"scopes": [
"quote:read",
"quote:write",
"rfq:read",
"vault:read"
],
"expires_in_days": 30
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/makers/{maker_id}/api-key-challenges"
payload = {
"action": "CREATE",
"request": {
"label": "Quoter",
"scopes": ["quote:read", "quote:write", "rfq:read", "vault:read"],
"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: 'Quoter',
scopes: ['quote:read', 'quote:write', 'rfq:read', 'vault:read'],
expires_in_days: 30
}
})
};
fetch('https://hip4-api.totalis.trade/v1/makers/{maker_id}/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/makers/{maker_id}/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' => 'Quoter',
'scopes' => [
'quote:read',
'quote:write',
'rfq:read',
'vault:read'
],
'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/makers/{maker_id}/api-key-challenges"
payload := strings.NewReader("{\n \"action\": \"CREATE\",\n \"request\": {\n \"label\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\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/makers/{maker_id}/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\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\n ],\n \"expires_in_days\": 30\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/makers/{maker_id}/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\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\n ],\n \"expires_in_days\": 30\n }\n}"
response = http.request(request)
puts response.read_body{
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"owner": "0x7777777777777777777777777777777777777777",
"message": "hip4-api.totalis.trade wants you to sign in with your Ethereum account:\n0x7777777777777777777777777777777777777777\n\nIssue a Totalis API key. It grants scoped API access, not financial signing authority.\n\nURI: https://hip4-api.totalis.trade/v1/makers/7/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:maker:7\n- urn:totalis:owner-version:2\n- urn:totalis:action:create\n- urn:totalis:request:0x40c9c897046dd510eb3f1515c7771fcf731feea2ee945b53477e928f6a689384",
"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 maker API key challenge
Returns the EIP-4361 message the maker’s controller signs with personal_sign to create or rotate one maker 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). The session’s wallet must be the maker’s current controller.
curl --request POST \
--url https://hip4-api.totalis.trade/v1/makers/{maker_id}/api-key-challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"action": "CREATE",
"request": {
"label": "Quoter",
"scopes": [
"quote:read",
"quote:write",
"rfq:read",
"vault:read"
],
"expires_in_days": 30
}
}
'import requests
url = "https://hip4-api.totalis.trade/v1/makers/{maker_id}/api-key-challenges"
payload = {
"action": "CREATE",
"request": {
"label": "Quoter",
"scopes": ["quote:read", "quote:write", "rfq:read", "vault:read"],
"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: 'Quoter',
scopes: ['quote:read', 'quote:write', 'rfq:read', 'vault:read'],
expires_in_days: 30
}
})
};
fetch('https://hip4-api.totalis.trade/v1/makers/{maker_id}/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/makers/{maker_id}/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' => 'Quoter',
'scopes' => [
'quote:read',
'quote:write',
'rfq:read',
'vault:read'
],
'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/makers/{maker_id}/api-key-challenges"
payload := strings.NewReader("{\n \"action\": \"CREATE\",\n \"request\": {\n \"label\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\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/makers/{maker_id}/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\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\n ],\n \"expires_in_days\": 30\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/makers/{maker_id}/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\": \"Quoter\",\n \"scopes\": [\n \"quote:read\",\n \"quote:write\",\n \"rfq:read\",\n \"vault:read\"\n ],\n \"expires_in_days\": 30\n }\n}"
response = http.request(request)
puts response.read_body{
"challenge_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a33",
"owner": "0x7777777777777777777777777777777777777777",
"message": "hip4-api.totalis.trade wants you to sign in with your Ethereum account:\n0x7777777777777777777777777777777777777777\n\nIssue a Totalis API key. It grants scoped API access, not financial signing authority.\n\nURI: https://hip4-api.totalis.trade/v1/makers/7/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:maker:7\n- urn:totalis:owner-version:2\n- urn:totalis:action:create\n- urn:totalis:request:0x40c9c897046dd510eb3f1515c7771fcf731feea2ee945b53477e928f6a689384",
"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}$Path Parameters
On-chain maker ID, as a decimal string. The credential must be authorized for this maker.
Never 0.
20^(0|[1-9][0-9]{0,18}|1[0-7][0-9]{18}|18[0-3][0-9]{17}|184[0-3][0-9]{16}|1844[0-5][0-9]{15}|18446[0-6][0-9]{14}|184467[0-3][0-9]{13}|1844674[0-3][0-9]{12}|184467440[0-6][0-9]{10}|1844674407[0-2][0-9]{9}|18446744073[0-6][0-9]{8}|1844674407370[0-8][0-9]{6}|18446744073709[0-4][0-9]{5}|184467440737095[0-4][0-9]{4}|18446744073709550[0-9]{3}|18446744073709551[0-5][0-9]{2}|1844674407370955160[0-9]|1844674407370955161[0-5])$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?

