Private Endpoints

Create a private endpoint

Changed on

Create a private endpoint as a draft. Drafts are not routable: validate one with POST /private-endpoints/{id}/validate, then activate it with POST /private-endpoints/{id}/activate. Pass activate to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Custom management keys with private_endpoints:create can only create drafts; passing activate requires a full organization Read/write management key and otherwise returns 403. Send an Idempotency-Key header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 idempotency_key_reused. Returns 400 parameters_invalid when tool_choice is declared without tools. The response does not echo declared_parameters or tested_parameters; read them with GET /private-endpoints/{id}. Management key required.

post/private-endpoints

Request

  • Base URL
    https://openrouter.ai/api/v1
  • Auth
    HTTP bearer

Headers

idempotency-key, string

Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 idempotency_key_reused. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. activate and settings are not compared, and later edits to the endpoint do not affect the comparison. settings is still validated before the replay, so a retry with invalid settings returns 400 settings_invalid instead of the endpoint.

Example:wayfair-gpt-4o-eastus-2026-09

Request body

CreatePrivateEndpointRequest required
activate, PrivateEndpointActivation

Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call /validate and /activate instead of creating it again.

base_url, string

HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).

declared_parameters, PrivateEndpointDeclaredParameter[]

Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. tool_choice requires tools to be tested or declared.

declared_region, 'global' | 'europe' | 'us' | 'null' nullable

Attest where this deployment processes data.

declared_zdr, boolean nullable

Attest that this deployment retains no prompt or completion data.

model_permaslug, string required

Permanent slug of the model this endpoint serves.

pricing, PrivateEndpointPricing

Negotiated per-token rates reported for requests routed to this endpoint.

provider_slug, string required

Slug of the upstream provider.

settings, UpdatePrivateEndpointSettingsRequest

Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.

upstream_model_id, string required

Model or deployment identifier sent to the upstream provider.

Example request

{
  "activate": {
    "workspace_id": "550e8400-e29b-41d4-a716-446655440000"
  },
  "base_url": "https://contoso.openai.azure.com",
  "declared_parameters": [
    "temperature",
    "seed"
  ],
  "declared_region": "us",
  "model_permaslug": "openai/gpt-4o-2024-08-06",
  "pricing": {
    "cache_read": "0.00000025",
    "cache_write": "0.000003125",
    "completion": "0.00001",
    "prompt": "0.0000025"
  },
  "provider_slug": "azure",
  "settings": {
    "context_length": 128000,
    "reasoning": {
      "supported": true
    }
  },
  "upstream_model_id": "gpt-4o-prod"
}

Response

The created endpoint: a draft, or active when activate was passed

ManagedPrivateEndpointResponse required
data, ManagedPrivateEndpoint required

Example response

{
  "data": {
    "created_at": "2026-09-24T10:30:00Z",
    "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
    "model_name": "OpenAI: GPT-4o",
    "model_permaslug": "openai/gpt-4o-2024-08-06",
    "model_slug": "openai/gpt-4o",
    "provider_name": "Azure",
    "status": "active",
    "declared_region": "us",
    "declared_zdr": true,
    "max_completion_tokens": 131072
  }
}

Changes

    • info

      added the new strict_tool_schemas enum value to the request property declared_parameters/items

    • info

      added the new strict_tool_schemas enum value to the request property settings/excluded_parameters/items

    • info

      added the new optional request property settings/prompt_caching