Pi Durable Platformdocs
ReferenceModels and usage

Change a provider, replace its key, or turn it off (platform admins)

PATCH
/v1/admin/model-providers/{providerId}

Any provider, a team's own too; a team's provider stays proxy-only and a new URL goes through the address guard (422 address_not_allowed).

Path Parameters

providerId*string
Formatuuid

Header Parameters

If-Match*string

The resource's revision, as returned in ETag (for example "3"). Missing returns 428; stale returns 412.

Request Body

application/json
  1. body
name?string
Lengthlength <= 100
baseUrl?string
Lengthlength <= 2048
apiKey?string

Replaces the key

Lengthlength <= 4096
accessMode?string
Value in"proxy""direct"
headers?

Replaces every extra header ({} removes them)

enabled?boolean

Response Body

Updated provider

application/json
  1. response
data*
curl -X PATCH 'https://agents.example.com/v1/admin/model-providers/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "kind": "openai",    "baseUrl": "string",    "accessMode": "proxy",    "enabled": true,    "hasHeaders": true,    "modelCount": 0,    "revision": 0,    "team": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "slug": "string",      "name": "string",      "kind": "team"    },    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}