---
title: "Connect the current user's OpenAI account"
method: POST
path: "/tally/app-server-connection"
tags: ["Tally"]
---

# Connect the current user's OpenAI account

`POST /tally/app-server-connection`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/tally/app-server-connection`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Connects a personal OpenAI API key or starts a Codex subscription device-code login. The credential follows this LedgerHQ user across firms and is used only after the firm's included Tally usage is exhausted.

## Request body

- union
  - object
    - `type` 'codex_oauth', required
  - object
    - `type` 'api_key', required
    - `apiKey` string, required

## Response `200`

Pending device-code login

## Other responses

- `default`: Error response

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/9a8269f0a586?raw)
