---
title: Configure the API playground
description: Configure servers and authentication, validate request fields, and send real API requests from the Try it modal.
url: https://pr-77-a9c4e9fe1b6c.thally.app/guides/api-playground
---

# Configure the API playground

Configure servers and authentication, validate request fields, and send real API requests from the Try it modal.

Select **Try it** on a generated operation page to open the request modal. It reads servers,
parameters, request bodies, and security schemes from your OpenAPI document.

The form and request/response cards sit side by side on wide screens. On phones,
the modal fills the screen and keeps **Send** at the bottom.

## Before you begin

Complete [Generate an API reference](/guides/api-reference-setup) and confirm an
operation page appears in your local preview.

## Add an API server

The playground needs at least one URL in the OpenAPI `servers` array:

```yaml
servers:
  - url: https://api.example.com/v1
    description: Production
```

The first server is selected initially. Readers can change it in the modal
before sending a request. These are your actual configured servers; choosing one
does not create a simulated sandbox. A write request can change data on that server.

## Describe authentication

Define a security scheme and apply it to the API or operation:

```yaml
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

security:
  - bearerAuth: []
```

Thally supports playground prefills for HTTP bearer, HTTP basic, and header API
key schemes. Without a configured value, the field uses a visible placeholder
such as `YOUR_API_KEY`.

To change that placeholder, use the exact security-scheme name in `docs.json`:

```json
{
  "apiPlayground": {
    "credentials": {
      "bearerAuth": "YOUR_API_KEY"
    }
  }
}
```

> **Do not put secrets in docs.json:**
  This configuration is part of the deployed documentation site. Use sample or
  public sandbox credentials only. Readers should enter their own secret in the
  playground when they make a request.

## Send and verify a request

1. Open a generated operation page.
2. Select **Try it**.
3. Fill every required path, query, header, and body field.
4. Review the generated URL and request sample. Choose a language in the request card to change the sample; compatible cards on the endpoint share that choice.
5. Send the request and confirm the status, headers, and response body.

Missing required values and invalid declared field types are marked before the
request is sent, with focus moved to the first invalid field. Hover or focus a
field or linked code line to highlight matching names in the request sample.

You can also send with Command+Enter on macOS or Ctrl+Enter on other platforms.
DELETE requests require a second confirmation. Close the modal with Escape or
the close button; focus returns to the control that opened it.

Thally sends the request through `/api/try-it` on the documentation server to
avoid browser CORS restrictions. The site must run on a server-capable host;
the playground cannot execute requests from a fully static export.

## Next steps

- [Troubleshoot an API reference](/guides/api-troubleshooting)
- [Deploy your documentation](/guides/deploying)
- [API reference configuration](/guides/docs-json-reference#api-reference)