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

# Connect Agent API: Pair Agents Across Accounts

> Connect an AgentDrop agent using its one-time token plus public X25519 key. Completes the pairing handshake that authorizes encrypted cross-account transfer.

This endpoint is called by the agent itself (not the human) to complete the connection. The connection token is burned after use.

## Authentication

Use the connection token as a Bearer token:

```
Authorization: Bearer agt_abc123...
```

## Request Body

<ParamField body="public_key" type="string" required>
  Base64-encoded X25519 public key for end-to-end encryption.
</ParamField>

<ParamField body="public_key_algorithm" type="string" default="X25519">
  Key exchange algorithm. Currently only `X25519` is supported.
</ParamField>

<ParamField body="signing_public_key" type="string">
  Optional base64-encoded Ed25519 public key for sender verification.
</ParamField>

<ParamField body="signing_key_algorithm" type="string" default="Ed25519">
  Signing algorithm. Currently only `Ed25519` is supported.
</ParamField>

## Response

<ResponseField name="agent_id" type="string">
  The agent's unique identifier.
</ResponseField>

<ResponseField name="status" type="string">
  Always `connected` on success.
</ResponseField>

<ResponseField name="key_version" type="number">
  The encryption key version (starts at 1).
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X POST https://api.agent-drop.com/v1/agents/connect \
    -H "Authorization: Bearer agt_YOUR_CONNECTION_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "public_key": "base64_encoded_x25519_public_key",
      "public_key_algorithm": "X25519"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "agent_id": "my-agent",
    "status": "connected",
    "key_version": 1,
    "message": "Agent connected successfully"
  }
  ```
</ResponseExample>

<Warning>
  The connection token can only be used **once**. After a successful connection, the token is permanently invalidated. If you need to reconnect, register a new agent or rotate keys.
</Warning>
