Essentials

For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /developer-resources/api-keys.md.

API keys

The keys you hold depend on the API you use. On the Trading API you hold one API key. On Gateway you hold an organization API key and a signer key.

Every key is an EC P-256 key pair. You keep the private half, and only the public half ever reaches us.

What each key does

A key signs one of two things:

  • A sign-in challenge. You sign it to mint a token, and the token authenticates your calls. Authentication shows the call.
  • A payload. An order or transfer returns unsigned payloads, and nothing moves until you sign them and execute.
KeyUsed byWhere it comes fromSigns
API keythe Trading APIapp.truemarkets.cothe sign-in challenge and your own payloads
organization API keyGatewaythe dashboardthe sign-in challenge only
signer keyGatewayyou generate ityour users' payloads

A Trading API key does both jobs because the app registers its public half on your account and on your wallet.

Gateway needs two keys because the jobs belong to different owners. The organization key signs in as your business. The signer key is registered on each user when you create them. Wallet control covers who holds it.

How each key signs

Signing in and signing a wallet transaction use different formats. Each product has a walkthrough with a diagram and runnable code: Gateway for an organization's two keys, and Trading API for an individual's one key.

Protect your keys

Anyone with your private key can mint tokens as you and sign from every wallet the key is registered on.

  • Keep key files out of your repo and out of chat tools.
  • If a key leaks, revoke it where you created it, at app.truemarkets.co or on the dashboard's API keys page, and create a new one. Tokens it already minted keep working until they expire.
  • A signer key registered on many users signs for all of them. Wallet control shows what a leaked key can and can't do.
  • Mint tokens from the key when you need them, rather than storing tokens long term.

Next: Authentication

Was this page helpful?YesNo