---
title: "Explore the API with Workbench"
description: "Run live read requests and generate secret-safe curl, TypeScript, and Python examples"
canonical: https://y2.dev/docs/api/workbench/
---

# Explore the API with Workbench

Run live read requests and generate secret-safe curl, TypeScript, and Python examples

Use API Workbench to inspect operations, run requests, and copy code examples.

Open **[Developers → API Workbench](https://y2.dev/app/developers/api-workbench)** in the dashboard.

API-key access is required

[Create an API key](https://y2.dev/docs/api/create-key) or use an eligible existing Lite key. The key needs the selected operation's scopes.

Request bodies are not supported

Use Workbench for requests with path and query parameters. For JSON request bodies, use examples from the [endpoint reference](https://y2.dev/docs/api/reference).

## Run a read request

### Paste an API key

Enter a key in the password field. Workbench keeps it in the current page session. It sends the key when you run a request.

### Open a category and endpoint

Open a category such as **News**. Select an endpoint. Check its method, path, required scopes, and parameters.

### Fill required values

Fill the required path and query parameters. Enable only the optional parameters you need.

### Run the request

Select **Run request**. Workbench calls the production API from your browser. It shows the status and response body. Successful read requests return `200`.

Workbench shows local validation errors before sending a request. Missing parameters produce `400`. A missing key produces `401`.

Requests use the workspace associated with the pasted key. Switching your active workspace in the app does not change the key's workspace.

## Generate a copy-safe snippet

Select the **curl**, **TypeScript**, or **Python** tab in an expanded endpoint. Copied examples use environment variables for credentials and missing inputs. They exclude the key entered in Workbench.

For example, after enabling `limit` without entering a value, a curl snippet can contain:

```
# Required:
#   countryCode (path): ISO 3166-1 alpha-2 country code
#
# Optional:
#   limit (query · integer · default: 8): Maximum results

curl "https://api.y2.dev/api/v1/osint/countries/$COUNTRY_CODE/news?limit=$LIMIT" \
  -H "Authorization: Bearer $Y2_API_KEY" \
  -H "Accept: application/json"
```

Set the placeholders before running the copied command:

```
export Y2_API_KEY="y2_..."
export COUNTRY_CODE="UA"
export LIMIT="8"
```

| Example    | Runtime                                            |
| ---------- | -------------------------------------------------- |
| curl       | Shell variables such as `$COUNTRY_CODE`            |
| TypeScript | Native `fetch` and `process.env` on a server       |
| Python     | `httpx` and `os.environ`, with a 30-second timeout |

## Use the AI Quickstart prompt

**Copy prompt** gives a coding agent links to the Y2 guides. It excludes your API key. After pasting it, state the endpoint and task you need. Keep `Y2_API_KEY` in the agent runtime or MCP client environment. Do not put it in the prompt or tool arguments.

## Know the current boundaries

| Capability            | Current behavior                                                          |
| --------------------- | ------------------------------------------------------------------------- |
| API target            | Production server from OpenAPI. Falls back to `https://api.y2.dev/api/v1` |
| Path and query fields | Interactive and OpenAPI-driven                                            |
| Request body fields   | Not rendered. Use endpoint reference examples                             |
| Live response         | Status and response body                                                  |
| Response headers      | Not displayed in the inline pane                                          |
| Authentication        | Bearer key required by the runner                                         |
| x402                  | Use curl or an x402 client outside Workbench                              |
| Saved state           | Key and parameter values remain in the current page session only          |

Before using copied code in production, add timeouts, error handling, and secret management. Add pagination and retries where the operation requires them.

[Endpoint reference](https://y2.dev/docs/api/reference)

[OpenAPI contract](https://y2.dev/docs/api/openapi)

[Integration recipes](https://y2.dev/docs/api/integration-recipes)

[x402 requests](https://y2.dev/docs/api/x402)
