Skip to main content
Servers generated in the Server Foundry are created with a single default base URL (the upstream API they call). Sometimes one customer/project needs the same generated server to talk to a different upstream host — for example a per-tenant subdomain or a staging environment. That’s a base URL override: it lives on the server instance (the project’s copy of the server), so each project can point at its own upstream without regenerating or forking the server. This recipe walks through the common flow:
  1. Resolve a project ID (by name or from a known UUID).
  2. List the project’s server instances and pick the Foundry server to override.
  3. Set the override on that instance (or clear it to fall back to the default).
Overrides apply to Foundry-generated servers only (server_type = foundry). Setting one on an external or catalog server returns 400. All endpoints require admin access and operate at tenant scope, so a platform access token can read and update any instance in your workspace.
At tool-call time the override is forwarded to the running server, which swaps its baked-in default base URL for your value. It only rewrites calls that target the default base URL — if the server was generated with multiple base URLs (per-endpoint routing), endpoints pinned to a different host keep theirs.

Endpoints used

Resolve the project ID

If you already have a project ID, skip this step. GET /api/v1/projects/search?search={name} does a case-insensitive partial match on project name/description and returns paginated results — pick the exact name from items (usually just one).

List the project’s server instances

GET /api/v1/server-instances?project_id={id} returns the project’s instances (cursor-paginated). Each item includes the fields you need to identify and override a Foundry server:

Set (or clear) the override

PATCH /api/v1/server-instances/{server_instance_id}/base-url-override with a JSON body:
The value must be an absolute http(s) URL with a real, routable host — placeholder hosts (e.g. example.com, localhost) and unreachable/internal hosts are rejected with 400. On success the endpoint echoes the stored (normalized) values:
You can also set this in the Caylex Platform UI: open the project-server side drawer and click the pencil next to Base URL. A blue dot indicates an active override.

The procedure

1

Resolve the project ID

GET /api/v1/projects/search?search={name} and pick the exact-name match’s id — or use a project_id you already have.
2

Find the Foundry server instance

GET /api/v1/server-instances?project_id={id}, then pick the item whose server_name/display_name matches your target and whose server_type is foundry. Keep its id (and note default_base_url).
3

Set the override

PATCH /api/v1/server-instances/{id}/base-url-override with { "base_url_override": "https://…" }.
4

(Optional) Clear it later

PATCH the same path with { "base_url_override": null } to revert the instance to the server default.

Full script

This resolves a project by name, finds a Foundry server instance by name within that project, and sets its base URL override. Set NEW_BASE_URL = None to clear the override instead.
set_base_url_override.py
The full request and response schema for these endpoints is browsable in the interactive API reference at https://developers.caylex.ai.

Next steps

Provision a customer project

Stand up a project per customer, then point its Foundry servers at customer-specific upstreams.

Copy tool permissions

Replicate tool permission settings across server instances.

Platform Authentication

Create and manage the platform access token these recipes use.

REST API Reference

Full request/response schemas for these endpoints.