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

# Aria Compute Account Link

> Get the linked Aria Compute (serve) account public info, or re-sync its API key metadata.

ROUTER can link an Aria Compute (serve) account for cross-product auth and metering. These endpoints read the link state and re-sync key metadata.

> [!WARNING]
>
> Both endpoints are gated to signed-in users (`gate_if_users`); unauthenticated callers get an unauthorized error.

## Get the linked account

```http theme={null}
GET /v1/router/serve/account
```

Returns the linked serve account public info.

## Re-sync the account

```http theme={null}
POST /v1/router/serve/account/sync
```

Re-pulls the serve-side key list with the stored serve API key (preferred) or the short-lived link token, then updates the local public info. If serve returns `401/403`, or the stored key's prefix is missing from the returned list, the key is marked deleted/revoked, so the dashboard updates and the router stops authenticating with a dead credential. Network or timeout failures leave the prior state untouched.

## Response

Both endpoints return `ServeAccountPublic`:

**linked** `boolean`

Whether a serve user is linked.

**site** `string | null`

Linked site identifier.

**site\_url** `string | null`

Serve site URL.

**gateway\_url** `string | null`

Serve gateway URL.

**user** `object | null`

Linked serve user info (id, name, email, etc.).

**linked\_at** `string | null`

Link time (ISO 8601).

**api\_key\_name** `string | null`

Linked key name.

**api\_key\_prefix** `string | null`

Linked key prefix (for display).

**api\_key\_configured** `boolean`

Whether a non-empty key is stored locally.

**api\_key\_deleted** `boolean`

Whether the key was deleted/revoked on serve.

**status** `string`

Link status, e.g. `linked`, `key only, not linked`, `api key deleted on serve`, `not linked`.

## Example

```bash theme={null}
curl -s https://router.example.com/v1/router/serve/account \
  -H "Authorization: Bearer <api-key>"
```

```json theme={null}
{
  "linked": true,
  "site": "cn",
  "site_url": "https://ariacompute.cn",
  "gateway_url": "https://gw.ariacompute.cn",
  "user": { "id": "u_1", "name": "alice", "email": "alice@example.com" },
  "linked_at": "2026-01-02T03:04:05Z",
  "api_key_name": "router-link",
  "api_key_prefix": "sk-bf-abc1",
  "api_key_configured": true,
  "api_key_deleted": false,
  "status": "linked"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.