For APIs where the base URL includes dynamic segments like a region subdomain (https://{region}.acme.com), you can map client options to them with the server_variable property in your Stainless config.
This allows your SDK users to set region directly without constructing custom baseURLs.
const client = new Acme({ region: 'us-east-2' })
const client = new Acme({ baseURL: 'https://us-east-2.amazonaws.com' })
const client = new Acme({ region: 'us-east-2' })
const client = new Acme({ baseURL: 'https://us-east-2.amazonaws.com' })
const client = new Acme({ region: 'us-east-2' })
const client = new Acme({ baseURL: 'https://us-east-2.amazonaws.com' })
client_settings:
opts:
region:
type: string
env: ACME_REGION
nullable: false
server_variable
client_settings:
opts:
region:
type: string
env: ACME_REGION
nullable: false
server_variable
client_settings:
opts:
region:
type: string
env: ACME_REGION
nullable: false
server_variable