# Configure Servers
Source: https://speakeasy.com/docs/sdks/customize/servers

import { CodeWithTabs, Callout } from "@/mdx/components";



## Default Behavior

The OpenAPI specification allows you to define an array of servers that can be used to make requests to the API. These servers are generally used to define different environments (for example, production, development, and testing) available for the API.

```yaml
openapi: 3.0.3
info:
  title: Example
  version: 0.0.1
servers:
  - url: https://prod.example.com # Used as the default URL by the SDK
    description: Our production environment
  - url: https://sandbox.example.com
    description: Our sandbox environment
```

The Speakeasy SDK Generator automatically selects the first server URL from the OpenAPI document's servers list as the default endpoint. While this default is commonly set to the production server, it's flexible to accommodate application development cycles by reordering or modifying the server list.

## Declare Base Server URL

Speakeasy SDKs are battery-included, meaning they are designed to work out of the box with minimal configuration from end users.

If the OpenAPI document lacks server definitions (both at the global level and for individual operations) or relies on relative paths for server URLs, it's essential to set a default server endpoint. Set the default server endpoint by specifying a `baseServerUrl` in the SDK Generator configuration file (`gen.yaml`). This ensures the SDK always has a primary server to connect to for its operations.

```yaml