---
title: "API keys"
url: https://docs.truemarkets.co/developer-resources/api-keys
description: "The keys you hold depend on the API you use. The Trading API uses one key, and Gateway uses two."
---

Docs index: https://docs.truemarkets.co/llms.txt

# 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](https://docs.truemarkets.co/developer-resources/authentication) shows the call.
- **A payload.** An order or transfer returns unsigned payloads, and nothing moves until you sign them and execute.

| Key                  | Used by         | Where it comes from                               | Signs                                       |
| -------------------- | --------------- | ------------------------------------------------- | ------------------------------------------- |
| API key              | the Trading API | [app.truemarkets.co](https://app.truemarkets.co)  | the sign-in challenge and your own payloads |
| organization API key | Gateway         | the [dashboard](https://dashboard.truemarkets.co) | the sign-in challenge only                  |
| signer key           | Gateway         | you generate it                                   | your 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](https://docs.truemarkets.co/gateway/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](https://docs.truemarkets.co/gateway/requests-and-signing) for an organization's two keys, and [Trading API](https://docs.truemarkets.co/trading-api/requests-and-signing) 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](https://app.truemarkets.co) or on the [dashboard](https://dashboard.truemarkets.co)'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](https://docs.truemarkets.co/gateway/wallet-control#if-a-key-leaks) 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](https://docs.truemarkets.co/developer-resources/authentication)