For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
  • Evals
    • What are Evals?
    • Running an Eval
  • Schedules
    • What are Schedules?
  • Logs
    • What are Logs?
  • Integrations
    • Connecting AI model providers
  • Settings
    • What's in Settings?
    • Available AI models
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
Dashboard
LogoLogo
On this page
  • Creating an API Surface
  • Add to an existing Product
  • Create with the REST API template
  • Navigating your API Surface
  • Setting up authentication
  • Creating an API key
  • Setting Surface status
  • Configuring response shape
  • Accessing your OpenAPI spec
  • Making your first API call
  • Next steps
Products & Surfaces

Setting up an API Surface

Was this page helpful?
Previous

Setting Up an MCP Surface

Next
Built with

An API Surface turns your Flows and Agents into ready-to-use REST API endpoints. Once set up, any application can call your AI Capabilities using standard HTTP requests.

You can create an API Surface when setting up a new Product with the REST API template, or add one to an existing Product at any time. If you need more context first, see What are Surfaces?.

Before you begin: You need a Product with at least one Capability attached. If you have not created the Product yet, see Creating a Product.

Creating an API Surface

Add to an existing Product

  1. Go to Products in the sidebar.
  2. Open the Product you want to update.
  3. Scroll to the Surfaces section.
  4. Click Add Surface or Add Another Surface.
  5. Select REST API.
  6. Click Save.

Runtype creates the API Surface and generates a REST endpoint for each Capability attached to the Product.

First-time setup may show a Launch Your API guide with steps for getting your API key and trying an example request.

Create with the REST API template

  1. Go to Products in the sidebar.
  2. Click + New Product.
  3. Select the REST API template.
  4. Name your Product.
  5. Click Use Existing to attach a Flow or Agent.
  6. Select the Capability you want to expose.
  7. Click Create REST API.

Runtype creates the Product and API Surface together, then generates endpoints and a test API key so you can start right away.

Navigating your API Surface

Use the tabs in the Surface panel to configure and manage your API Surface.

TabWhat it’s for
OverviewSurface name, status, and response settings
EndpointsYour Capabilities, request URLs, and OpenAPI spec
KeysCreate and manage API keys
ShipIntegration code snippets and SDK examples

Setting up authentication

API Surfaces use API keys for authentication. Every request must include a valid key.

Creating an API key

  1. Open your Product and select the API Surface.
  2. Go to the Keys tab.
  3. Click Create API Key.
  4. Enter a name for the key.
  5. Choose the key environment: Test or Production.
  6. Click Create.
  7. Copy the generated key right away. It will not be shown again.

All API keys use the papi_ prefix. You can send them with the Authorization header as a Bearer token or with the X-API-Key header.

Store API keys securely. Test keys are rate-limited for development. Use a Production key when you are ready to go live.

Setting Surface status

Use the Overview tab to control whether the API Surface is available.

StatusBehavior
DraftEndpoints are not accessible
ActiveEndpoints are live and accepting requests
PausedEndpoints are temporarily disabled without removing the Surface

Use Paused when you need to take the API offline for maintenance without changing the rest of the configuration.

Configuring response shape

In the Overview tab, response settings control how your API returns results.

  • Raw returns only the Capability output.
  • Wrapped includes metadata such as execution time and token usage.

For multi-step Flows, you can also choose which step output to return as the final response.

Accessing your OpenAPI spec

Runtype automatically generates an OpenAPI 3.0 specification for every API Surface. You can use it with tools like Postman, Swagger UI, or code generators.

Find the spec in the Endpoints tab in JSON or YAML format, or access it directly at:

https://api.runtype.com/v1/products/{productId}/surfaces/{surfaceId}/api/openapi.json

The spec updates automatically when you add or change Capabilities.

Use the Ship tab for ready-to-use TypeScript and cURL examples.

Making your first API call

Once the API Surface is active, each Capability gets its own endpoint. Find the exact URLs in the Endpoints or Ship tab.

$curl -X POST https://api.runtype.com/v1/products/{productId}/surfaces/{surfaceId}/api/{capabilitySlug} \
> -H "Authorization: Bearer papi_your_api_key" \
> -H "Content-Type: application/json" \
> -d '{
> "input": "Your input text here"
> }'

The {capabilitySlug} value is generated from the Capability name. For example, Summarize Article becomes summarize-article.

Next steps

  • Creating a Product — Create a Product before adding more Surfaces or Capabilities
  • What are Surfaces? — Understand when to use API, Chat, MCP, and other Surface types