Skip to main content
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

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

Body

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. A slug is immutable after creation: to serve traffic under a different slug, create a new endpoint and delete the old one.
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, BASETEN_MODEL_API, ANTHROPIC, OPENAI, VERTEX, or OPENAI_COMPATIBLE.
  • model_id (string): The Baseten model the slug routes to. Required for, and only valid with, BASETEN targets.
  • environment_name (string): Optional Baseten model environment to route to. Valid only with BASETEN targets. Omit it, or pass production, to target production.
  • secret_id (string): Baseten secret holding the provider credential. Required for every provider except BASETEN, and valid only with those providers. For BASETEN_MODEL_API, use a secret containing a Baseten API key. For VERTEX, use a secret whose value is the base64 encoding of Google service-account JSON authorized to call Vertex AI.
  • target_model (string): Upstream model name to send, for example claude-sonnet-4-5. Required for every provider except BASETEN; optional with BASETEN.
  • base_url (string): Publicly reachable HTTPS base URL of the upstream OpenAI-compatible server, for example https://my-vllm.example.com. Must not include embedded credentials or a port, and must not use private, loopback, link-local, reserved, multicast, unspecified, internal, local, or Baseten hosts. Required for, and only valid with, OPENAI_COMPATIBLE.
  • vertex_config (object): Google Vertex configuration. Both project_id (Google Cloud project ID or number) and location (for example global) are required. Valid only with VERTEX.

Response

string
required
Stable identifier for the endpoint. Use this in every per-endpoint path parameter.
string
required
The endpoint’s routing slug.
object[]
required
The endpoint’s configured targets. Each entry includes provider plus the applicable fields: BASETEN targets include model_id and can include environment_name and target_model; all other providers include secret_id and target_model; OPENAI_COMPATIBLE also includes base_url; and VERTEX also includes vertex_config. The response returns base_url as the canonical host and path without the https:// scheme or a trailing slash.
string
required
RFC 3339 UTC timestamp of creation.
string
required
RFC 3339 UTC timestamp of the last update.

Errors