# Server integration with Switchboard

Trusted servers can use Switchboard as an OpenAI-compatible gateway. Keep the
OpenAI SDK, change the base URL, and use a Switchboard secret project key.

## Environment

- `SWITCHBOARD_BASE_URL=https://switchboard.spot/v1`
- `SWITCHBOARD_API_KEY=sb_test_...` for sandbox or `sb_live_...` for live

## Request shape

Use OpenAI-compatible chat completions:

```http
POST /v1/chat/completions
Authorization: Bearer sb_test_...
Content-Type: application/json
```

Include `X-Switchboard-End-User` from trusted server code when a request should
be attributed to one of your customers.

## Discovery

- OpenAPI: `https://switchboard.spot/v1/openapi.json`
- Models: `GET /v1/models`
- Catalog and pricing: `GET /v1/catalog/models`
- Agent discovery: `https://switchboard.spot/llms.txt`

Use the dashboard Integration Kit or `switchboard integration kit --json` for
project-specific snippets.
