Skip to main content
curl --request PATCH \
  --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "7mP2wqe"
      }
    ]
  }'
{
  "id": "abc123hash",
  "slug": "my-org/glm-5.2",
  "targets": [
    {
      "provider": "BASETEN",
      "model_id": "7mP2wqe"
    }
  ],
  "created_at": "2026-06-17T12:00:00Z",
  "updated_at": "2026-06-17T13:30:00Z"
}
Update an endpoint’s mutable fields. Send the fields you want to change. If you include targets, the value replaces the endpoint’s full target list. If you include slug, the endpoint is renamed.

Authentication

Authorization
string
required
Workspace API key with management scope, passed as Authorization: Api-Key $BASETEN_API_KEY (or Bearer; both are accepted).

Path parameters

endpoint_id
string
required
Identifier of the endpoint, returned as id by Create an endpoint.

Body

Send only the fields you want to change.
slug
string
New globally-unique routing slug, formatted {org_prefix}/{name}. The org_prefix must be a prefix your organization owns.
targets
object[]
The endpoint’s complete target list after the call. Exactly one target is supported at this time: send a list of length one. Sending an empty list or more than one target returns 400.Each entry takes:
  • provider (string, required): Upstream provider for the target. One of BASETEN, ANTHROPIC, or OPENAI.
  • model_id (string): The Baseten model the slug routes to. Use for BASETEN targets.
  • secret_id (string): Baseten secret holding the provider credential. Required for external providers (ANTHROPIC, OPENAI).
  • target_model (string): Upstream model name to send. Required for external providers; optional for BASETEN.

Response

The updated endpoint, with the same shape as the Create an endpoint response: id, slug, targets, created_at, and updated_at.

Errors

StatusMeaning
400 Bad RequestInvalid payload, or a targets list that’s empty or has more than one entry.
403 ForbiddenThe endpoint exists but isn’t in your workspace, or the caller doesn’t have management scope.
404 Not FoundNo endpoint with this id in your workspace.
curl --request PATCH \
  --url https://api.baseten.co/v1/gateway/endpoints/abc123hash \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "7mP2wqe"
      }
    ]
  }'
{
  "id": "abc123hash",
  "slug": "my-org/glm-5.2",
  "targets": [
    {
      "provider": "BASETEN",
      "model_id": "7mP2wqe"
    }
  ],
  "created_at": "2026-06-17T12:00:00Z",
  "updated_at": "2026-06-17T13:30:00Z"
}