APIInference

Inference Connections_create

POST
/inference/connections

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

manage_inference

Request Body

application/json
  1. body
name*string
Length1 <= length <= 255
provider_type*ProviderType

The API a connection speaks. Each type sets its own base URL form and whether an API key is required.

Value in"openai""anthropic"
credential_mode?CredentialMode

Defaults to shared_key. Fixed at create. A subscription connection takes no api_key, and its base_url is the provider's own API: https://api.anthropic.com for anthropic, https://chatgpt.com/backend-api/codex for openai.

Value in"shared_key""subscription"
base_url?string

The provider's API base URL, in the form the provider's own SDK takes. Required for a shared_key connection; omit it for a subscription connection, which always uses its provider's own API. A URL that doesn't fit the provider type is refused with the expected form.

Lengthlength <= 2048
allowed_models*array<string>

At least one entry: the models this connection may be used with. ["*"] allows all.

Items1 <= items
api_key?string

Write-only, never returned in reads. Required for a shared_key connection; refused on a subscription one.

Lengthlength <= 4096

Response Body

The request has succeeded and a new resource has been created as a result.

application/json
  1. response

A credential + endpoint an org can use for inference.

id*uuid
Formatuuid
name*string
Length1 <= length <= 255
provider_type*ProviderType

The API a connection speaks. Each type sets its own base URL form and whether an API key is required.

Value in"openai""anthropic"
credential_mode*CredentialMode

How a connection authenticates to its provider.

Value in"shared_key""subscription"
base_url?string

Absent on a managed connection: the platform's endpoint is operator infrastructure, not the org's to see.

Lengthlength <= 2048
allowed_models*array<string>

Models this connection may be bound to. ["*"] allows all.

has_api_key?boolean

Read-only: whether an API key is stored. The key itself is never returned. Absent on a managed connection, whose credential the org neither sets nor fixes.

managed*boolean

Read-only: true for the platform-provided connection, which the org can't edit or delete.

created_at?string

Absent on a managed connection.

Formatdate-time
updated_at?string

Absent on a managed connection.

Formatdate-time
Example Request
curl -X POST 'https://your-org.aisecurity.services.us.connect.secureauth.com/api/v1/inference/connections' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "provider_type": "openai",  "allowed_models": [    "string"  ]}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "provider_type": "openai",  "credential_mode": "shared_key",  "base_url": "string",  "allowed_models": [    "string"  ],  "has_api_key": true,  "managed": true,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}