curl --request POST \
--url https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup \
--header 'X-Api-Key: <api-key>'import requests
url = "https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup', 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://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"otpauthUri": "otpauth://totp/PredictStreet:0x1234…?secret=JBSWY3DPEHPK3PXP&issuer=PredictStreet",
"secret": "JBSWY3DPEHPK3PXP",
"backupCodes": [
"<string>"
]
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}Begin 2FA setup
Generates a fresh TOTP secret (stored pending for 15 minutes) plus ten one-time backup codes and returns them ONCE. Render otpauthUri as a QR code, then call …/totp/confirm to activate. Refused with 409 totp_already_configured if 2FA is already active. Rate-limited 10/min/wallet. Partner API-key callers (RND-2639, being rolled out; self-service keys cannot hold vault:write): the change carries the wallet owner’s EIP-712 signature: domain { name: "PredictStreet Withdrawal Security", version: "1", chainId } (no verifyingContract), type WithdrawalSecurityChange(address wallet,string action,string subject,string label,uint256 nonce,uint256 deadline); wallet is the acting wallet, nonce any number not used before for it, deadline unix seconds at most 15 minutes ahead; sent in X-Owner-Signature, X-Owner-Signature-Nonce and X-Owner-Signature-Deadline, single use once enforced (observation mode does not spend the nonce). While the platform runs the check in observation mode, a proof that is sent is verified and recorded and a change without it is still accepted; once enforcement is on, a key’s change without a valid proof is refused (403 owner_signature_required / owner_signature_invalid). Signed-in sessions send none. Signed action is totp_setup, subject and label the empty string.
curl --request POST \
--url https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup \
--header 'X-Api-Key: <api-key>'import requests
url = "https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup', 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://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.api.dev.predictstreet.sde.adifoundation.ai/api/me/withdrawal-security/totp/setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"otpauthUri": "otpauth://totp/PredictStreet:0x1234…?secret=JBSWY3DPEHPK3PXP&issuer=PredictStreet",
"secret": "JBSWY3DPEHPK3PXP",
"backupCodes": [
"<string>"
]
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}{
"status": 404,
"error": {
"code": "<string>",
"message": "<string>",
"trace_id": "<string>",
"retryAfterSec": 123,
"retryable": true,
"details": {}
}
}Authorizations
Partner / integrator key — format ps_live_<keyId>_<secret>. Partner keys are issued by PredictStreet; a user can also create keys bound to their own wallet from their account settings in the web app. Never ship to a browser. multi_wallet partners must additionally send X-User-Wallet: 0x<40-hex> on every authenticated request to declare the acting wallet. See the API keys guide for scope taxonomy, partner kinds, rate limits, and rotation procedure.
Headers
Required for multi_wallet partners on every authenticated request; ignored for single_wallet. Declares the acting end-user wallet for this request — drives KYC checks, balances/positions/orders attribution, rate-limit buckets, and audit. Lower-cased server-side. Missing on a multi_wallet key → 401 api_key_user_wallet_required; malformed → 401 api_key_user_wallet_invalid. The on-chain CTFExchange/Vault contracts still verify EIP-712 signer ↔ vault binding, so loosening API-layer attribution is safe by construction.
^0x[a-fA-F0-9]{40}$"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb3"
API-key callers (RND-2639, being rolled out): the wallet owner's EIP-712 WithdrawalSecurityChange signature of this change, 0x + 130 hex. See Owner's signature.
^0x[0-9a-fA-F]{130}$Response
Secret, provisioning URI and backup codes — shown once.