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
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • Endpoint structure
  • Making a request
  • Request body
  • Response format
  • Streaming responses
  • Error responses
  • Rate limits
  • Next steps
Products & Surfaces

Calling your API endpoints

Was this page helpful?
Previous

Client tokens and domain restrictions

Next
Built with

Make HTTP requests to your API surface endpoints to invoke capabilities programmatically from any application.

Endpoint structure

API Surface endpoints follow this pattern:

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

The {capabilitySlug} is generated from the Capability name. For example, Summarize Article becomes summarize-article. Find your specific URLs in the API Surface’s Endpoints or Ship tab.

Making a request

Send a POST request with your input data:

$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",
> "variables": {
> "customVar": "value"
> }
> }'

Request body

The request body accepts these fields:

FieldTypeRequiredDescription
inputstringYesMain input for the capability
variablesobjectNoAdditional variables for template substitution
streambooleanNoEnable streaming responses
recordIdstringNoRecord to use as context

Response format

Successful responses return JSON:

1{
2 "executionId": "exec_xxxxxx",
3 "output": "AI-generated response text",
4 "metadata": {
5 "model": "gpt-4o",
6 "tokensUsed": 245,
7 "latencyMs": 1823
8 }
9}

Streaming responses

For real-time output, enable streaming:

$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": "Tell me a story", "stream": true}'

Streaming responses use Server-Sent Events (SSE):

data: {"type":"token","content":"Once"}
data: {"type":"token","content":" upon"}
data: {"type":"token","content":" a"}
data: {"type":"done","metadata":{"tokensUsed":245}}

Error responses

Errors return appropriate HTTP status codes:

400 Bad Request:

1{
2 "error": "Missing required field: input"
3}

401 Unauthorized:

1{
2 "error": "Invalid or missing API key"
3}

404 Not Found:

1{
2 "error": "Capability not found"
3}

500 Internal Server Error:

1{
2 "error": "Flow execution failed",
3 "executionId": "exec_xxxxxx"
4}

Use the executionId to debug failures in execution logs.

Rate limits

API Surfaces enforce rate limits that can be configured per API key. You can set per-minute and per-day limits when creating keys in the Keys tab of your API Surface.

Next steps

  • Auto-generated OpenAPI spec for programmatic API documentation
  • Scoping API keys to capabilities for security
  • Authenticating with product API keys