Pi Durable Platformdocs
ReferenceModels and usage

Add a platform model provider (platform admins)

POST
/v1/admin/model-providers

The API key (and any extra headers) are stored encrypted and never returned. In proxy mode agents call the platform, which adds the key; in direct mode agents get the provider's URL and key.

Request Body

application/json
  1. body
name*string
Lengthlength <= 100
kind*string
Value in"openai""anthropic""openai-compatible""openai-responses""anthropic-compatible"
baseUrl?string

Default for openai and anthropic; required otherwise (for example https://litellm.example.com/v1)

Lengthlength <= 2048
apiKey*string
Lengthlength <= 4096
accessMode?string

Default proxy (a team's providers are proxy only)

Value in"proxy""direct"
headers?

Extra headers sent with every request (at most 20)

enabled?boolean

Response Body

Created provider

application/json
  1. response
data*
curl -X POST 'https://agents.example.com/v1/admin/model-providers' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "kind": "openai",  "apiKey": "string"}'
{  "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"  }}