> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.tradespace.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.tradespace.io/_mcp/server.

# Authentication

> Authenticate with an account API key.

Every request to the API is authenticated with an API key that belongs to your Tradespace account.

## Create an API key

1. In Tradespace, open **Settings**, then **API Keys** under the Account section.
2. Click **New API Key**, give the key a descriptive name, and click **Create API Key**.
3. Copy the key from the dialog, or later from the API Keys list.

Keys are read-only by default. The **Allow Write Access** option is reserved for future write operations. The API currently exposes queries only, so leave it unchecked.

## Send the key

Put the key in the `Authorization` header of every request, as is. Do not add a `Bearer` prefix.

Every request must also name its operation: give the query a name and send the same name in `operationName`. Requests without an operation name are rejected with `400 Bad Request`.

```bash
curl https://api.tradespace.io/graphql \
  -H "Authorization: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "operationName": "RecentGrants",
    "query": "query RecentGrants { grants(limit: 5) { collection { id grantNumber } } }"
  }'
```

Use the endpoint for your account's region. See [Welcome](/home/get-started/welcome) for the list. A key created in one region is not recognized by another region's endpoint and returns `401 Unauthorized`.

## Manage keys

The API Keys page lists each key with its access level, status, number of requests made, the time of the last request, and who created it. Keys are masked in the list. Use the eye icon to reveal a key and the copy icon to copy it.

A key must be **Active** to authenticate. Deactivated keys are rejected immediately.

If a request fails, see [Errors](/home/get-started/errors).