Pi Durable Platformdocs
ReferenceAPI keys

Create a personal API key (browser session only); the secret is shown once

POST
/v1/me/api-keys

409 too_many_keys (at most 20 active keys per person).

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
expiresInDays?integer

Keys always expire

Formatint32
Range1 <= value <= 365
Default90

Response Body

Created

application/json
  1. response
data*
curl -X POST 'https://agents.example.com/v1/me/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "Deploy script on my laptop"}'
{  "data": {    "key": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "prefix": "string",      "status": "active",      "createdAt": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "lastUsedAt": "2019-08-24T14:15:22Z",      "revokedAt": "2019-08-24T14:15:22Z"    },    "secret": "string"  }}