> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leapter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Web API (OpenAPI)

> Call your Blueprints through the OpenAPI-compatible REST API from any application.

Leapter generates an OpenAPI specification for your project, giving you a standard REST API to call any published Blueprint from any application.

## Get the OpenAPI spec URL

1. Open any Blueprint in the editor.
2. Click the **Share** button in the toolbar.
3. Select **Connect**.
4. In the Connect dialog, select the **Web API (OpenAPI)** tab.

<img src="https://mintcdn.com/leapter/sFmIRxFaV3bB8R9b/images/connect-rest-api-tab.png?fit=max&auto=format&n=sFmIRxFaV3bB8R9b&q=85&s=cbe64db364e49914526e5d9995d3acc7" alt="The Connect dialog showing the Web API (OpenAPI) tab with the spec URL and curl example" width="896" height="784" data-path="images/connect-rest-api-tab.png" />

The dialog shows your OpenAPI specification URL:

```
https://lab.leapter.com/runtime/api/v1/{appspace}/{project-id}/openapi
```

Click the **Copy** button to copy it to your clipboard.

<Note>
  The OpenAPI spec covers **all published Blueprints** in the project, not just the one you currently have open.
</Note>

## Authentication

All API calls require an API key passed as a header:

* **Header name:** `X-API-Key`
* **Header value:** your API key

See [API Keys](/fundamentals/api-keys) to create and manage your keys.

## Example: call a Blueprint with curl

The Connect dialog provides a ready-made curl command for the Blueprint you have open — it has the appspace, project ID, Blueprint ID, and a sample API key already filled in. The general pattern is:

```bash theme={null}
curl -X POST "https://lab.leapter.com/runtime/api/v1/{appspace}/{project-id}/models/{blueprint-id}/runs" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{"input1": "value1", "input2": "value2"}'
```

Replace the placeholders with your actual values and the request body with your Blueprint's input parameters.

## Use with Postman

1. Copy the **OpenAPI spec URL** from the Connect dialog.
2. In Postman, click **Import** and paste the URL.
3. Postman generates a collection with all your Blueprint endpoints.
4. Set the `X-API-Key` header in the collection's authorization settings.
5. Fill in the request body with your input values and send a request.

## Use with Swagger UI

You can also paste the OpenAPI spec URL into [Swagger Editor](https://editor.swagger.io/) or any OpenAPI-compatible tool to explore and test your endpoints interactively.

## What to do next

* **[AI Protocol (MCP)](/executing-blueprints/connect-mcp)** — connect AI assistants to your Blueprints via MCP
* **[API Keys](/fundamentals/api-keys)** — create and manage API keys
* **[HTTP Workflow](/executing-blueprints/n8n-http)** — export an n8n workflow that calls your Blueprint via HTTP
