Skip to main content
curl --request POST \
  --url https://api.baseten.co/v1/gateway/endpoints \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "slug": "my-org/glm-5.2",
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "3kZ9xqd"
      }
    ]
  }'
{
  "id": "abc123hash",
  "slug": "my-org/glm-5.2",
  "targets": [
    {
      "provider": "BASETEN",
      "model_id": "3kZ9xqd"
    }
  ],
  "created_at": "2026-06-17T12:00:00Z",
  "updated_at": "2026-06-17T12:00:00Z"
}
Create an endpoint. An endpoint is a globally-unique routing slug plus the target it points to. Once created, requests that reach the gateway with this slug route to the target you specify. For the conceptual walkthrough, see Endpoints.

Authentication

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

Body

slug
string
required
Globally-unique routing slug, formatted {org_prefix}/{name}. The org_prefix must be a prefix your organization owns, registered by the Baseten team during onboarding. Both segments are URL-safe. You can change the slug later with Update an endpoint.
targets
object[]
required
The endpoint’s upstream targets. 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

id
string
required
Stable identifier for the endpoint. Use this in every per-endpoint path parameter.
slug
string
required
The endpoint’s routing slug.
targets
object[]
required
The endpoint’s configured targets. Each entry echoes provider plus the fields you set: model_id for Baseten targets, or secret_id and target_model for external providers.
created_at
string
required
RFC 3339 UTC timestamp of creation.
updated_at
string
required
RFC 3339 UTC timestamp of the last update.

Errors

StatusMeaning
400 Bad RequestInvalid payload, slug prefix your organization doesn’t own, duplicate slug, or a targets list that’s empty or has more than one entry.
403 ForbiddenWorkspace isn’t onboarded to Frontier Gateway, or the caller doesn’t have management scope.
curl --request POST \
  --url https://api.baseten.co/v1/gateway/endpoints \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "slug": "my-org/glm-5.2",
    "targets": [
      {
        "provider": "BASETEN",
        "model_id": "3kZ9xqd"
      }
    ]
  }'
{
  "id": "abc123hash",
  "slug": "my-org/glm-5.2",
  "targets": [
    {
      "provider": "BASETEN",
      "model_id": "3kZ9xqd"
    }
  ],
  "created_at": "2026-06-17T12:00:00Z",
  "updated_at": "2026-06-17T12:00:00Z"
}