---
title: "Create pairing code"
method: POST
path: "/api/pair"
tags: ["server"]
---

# Create pairing code

`POST /api/pair`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/pair`
- Auth: none required

Create a short-lived, single-use code for a /auth/connect/:code pairing link.

## Response `200`

PairingCode

- PairingCode
  - `code` string, required
  - `expires_in` integer, required

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
