AppAIGatewayDocs
API referenceAdmin provider gateways

Create a reusable provider gateway connection

POST
/v1/admin/provider-gateways

Cloudflare AI Gateway takes an account and gateway id; Vercel AI Gateway takes only a name and a token. The token is encrypted and stored as given, never probed: check a connection first with POST /v1/admin/provider-gateways/test. Provider instances are attached separately through the providers API. Optional Idempotency-Key and X-Idempotency-Proof must be supplied together as independently generated 32–256 character URL-safe proofs. Save them before sending; an identical retry returns the original result. Wrong proof is 403, changed body is 409. Protected key recovery lasts 15 minutes; expired recovery never creates another resource.

Authorization

agw_identity_auth.session_token<token>

The console's session cookie. Admin requests from the console also send x-console-request: 1.

In: cookie

Header Parameters

Idempotency-Key?string
Match^[A-Za-z0-9_-]{32,256}$
X-Idempotency-Proof?string
Match^[A-Za-z0-9_-]{32,256}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/admin/provider-gateways" \  -H "Content-Type: application/json" \  -d '{    "type": "cf_aig",    "name": "string",    "accountId": "string",    "gatewayId": "string",    "token": "string"  }'
{  "gateway": {    "id": "string",    "name": "string",    "secretHint": "string",    "providerCount": 0,    "referencedCount": 0,    "status": "active",    "createdAt": "string",    "updatedAt": "string",    "createdBy": "string",    "type": "cf_aig",    "config": {      "accountId": "string",      "gatewayId": "string"    }  }}