Expose Your AI as a REST API in 60 Seconds
Turn any Runtype flow or agent into a production REST API endpoint. Authenticated, documented, streaming-capable, and ready for integration.
Not every AI product is a chat widget. Sometimes you need your AI to be a backend service that other systems can call.
An internal tool that processes documents. A pipeline step that enriches data. A webhook handler that generates responses. A microservice that other teams integrate into their own products.
Runtype's REST API surface turns any flow or agent into a callable API endpoint.
The 60-second path
Here's the actual sequence:
- Create a flow (~15s): In the Runtype dashboard, click New Flow, pick a model, write a system prompt.
- Attach a REST surface (~10s): Go to Surfaces, click Add Surface, choose REST API.
- Copy the curl (~5s): The Ship tab generates a ready-to-paste curl command with your flow ID and API key.
- Run it (~5s): Paste into your terminal. You get a JSON response from your AI.
The rest of the 60 seconds is reading the output and deciding what to build next.
How it works
In Runtype, you build your AI logic as a flow or agent. Then you attach a REST API surface to it. That gives you a URL, authentication, and an endpoint that accepts JSON and returns the AI's output.
curl -X POST https://api.runtype.com/v1/dispatch/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flow": { "id": "your-flow-id" },
"messages": [{ "role": "user", "content": "Summarize this report" }],
"options": { "streamResponse": false }
}'That's a fully functional AI API call. The flow runs, the model processes the input, any tools execute, and you get the result back as JSON.
Streaming or synchronous
The API supports both modes. For real-time applications, enable streamResponse and you get Server-Sent Events with incremental output. For batch processing or backend pipelines, use synchronous mode and get the complete result in one response.
What you can do with it
Tool
Backend automation
Process documents, enrich data, generate content, or analyze inputs. Anything your flow can do, your API can expose.
Agent
Multi-step pipelines
Chain multiple flows together. One API call triggers a research step, an analysis step, and a formatting step. The output is the finished product.
Surface
Third-party integration
Give partners, customers, or internal teams an API they can call from their own systems. Standard REST, standard auth, standard JSON.
Records and context
The dispatch API supports records, which let you attach structured metadata to each call. This is useful for building AI features that operate on specific entities in your system.
{
"record": {
"name": "Customer #4521",
"type": "support-ticket",
"metadata": {
"tier": "enterprise",
"issue": "billing",
"previousInteractions": 3
}
},
"flow": { "id": "support-triage-flow" },
"messages": [{ "role": "user", "content": "I was charged twice" }]
}The flow has access to all that record metadata through template variables. Your AI knows who the customer is, what tier they're on, and what they've asked about before.
Runtime tools
You can also define tools inline with each API request. Need the AI to call an external service? Define the tool's endpoint, parameters, and description right in the request body. The model will call it when appropriate.
This means your API surface isn't limited to what was configured in the dashboard. Each API consumer can extend the AI's capabilities for their specific use case.
Authentication and environments
Each API surface gets its own keys with test and production environments. Keys are scoped to specific capabilities, so you can give different consumers different levels of access.
Create a flow, attach a REST surface, and paste the curl into your terminal — your first API response is one command away.