> ## Documentation Index
> Fetch the complete documentation index at: https://api.synthesis.trade/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Project API key

> Authenticate backend requests for account management, sessions, and API keys

Project API keys are used when your backend server needs to manage accounts, create sessions, or generate account API keys. They are secret and should never be exposed to clients.

## Header

| Name                | Type   | Required | Description                                    |
| ------------------- | ------ | -------- | ---------------------------------------------- |
| `X-PROJECT-API-KEY` | string | Yes      | Your project secret key, formatted as `sk_...` |

## Create an account

<CodeGroup>
  ```bash Request theme={null}
  curl -X POST "https://synthesis.trade/api/v1/project/account" \
    -H "Content-Type: application/json" \
    -H "X-PROJECT-API-KEY: sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345678901234=" \
    -d '{"metadata": {"user_id": "123"}}'
  ```

  ```json Response theme={null}
  {
      "success": true,
      "response": {
          "account_id": "01234567-89ab-cdef-0123-456789abcdef",
          "metadata": {"user_id": "123"},
          "created_at": "2026-01-01T00:00:00"
      }
  }
  ```
</CodeGroup>

## Create a session for an account

<CodeGroup>
  ```bash Request theme={null}
  curl -X POST "https://synthesis.trade/api/v1/project/account/{account_id}/session" \
    -H "X-PROJECT-API-KEY: sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345678901234="
  ```

  ```json Response theme={null}
  {
      "success": true,
      "response": {
          "account_id": "01234567-89ab-cdef-0123-456789abcdef",
          "session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "created_at": "2026-01-01T00:00:00",
          "expires_at": "2026-01-08T00:00:00"
      }
  }
  ```
</CodeGroup>

## Create an account API key

<CodeGroup>
  ```bash Request theme={null}
  curl -X POST "https://synthesis.trade/api/v1/project/account/{account_id}/api-key" \
    -H "X-PROJECT-API-KEY: sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345678901234="
  ```

  ```json Response theme={null}
  {
      "success": true,
      "response": {
          "public_key": "pk_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345678901234=",
          "secret_key": "sk_xYzAbCdEfGhIjKlMnOpQrStUvWxYz987654321098=",
          "created_at": "2026-01-01T00:00:00"
      }
  }
  ```
</CodeGroup>

<Warning>The `secret_key` is only returned once when created. Store it securely immediately.</Warning>

## Available routes

All routes under `/api/v1/project/*` require the project API key.

| Route                                                | Method   | Description               |
| ---------------------------------------------------- | -------- | ------------------------- |
| `/api/v1/project/account`                            | `GET`    | List project accounts     |
| `/api/v1/project/account`                            | `POST`   | Create a new account      |
| `/api/v1/project/account/{id}`                       | `GET`    | Get a specific account    |
| `/api/v1/project/account/{id}/metadata`              | `PUT`    | Update account metadata   |
| `/api/v1/project/account/{id}/session`               | `POST`   | Create a session          |
| `/api/v1/project/account/{id}/session/{sid}/refresh` | `POST`   | Refresh a session         |
| `/api/v1/project/account/{id}/session/{sid}/expire`  | `POST`   | Expire a session          |
| `/api/v1/project/account/{id}/sessions/expire-all`   | `POST`   | Expire all sessions       |
| `/api/v1/project/account/{id}/api-key`               | `GET`    | List account API keys     |
| `/api/v1/project/account/{id}/api-key`               | `POST`   | Create an account API key |
| `/api/v1/project/account/{id}/api-key/{pk}`          | `DELETE` | Delete an account API key |
