Quickstart
Use the Runtype API to make an authenticated request and run an inline flow.
Before you begin
Before you start, prepare the following:
Test your API key
Verify your API key by requesting your profile. The following TypeScript example sends the request:
The following Python example sends the same request:
Set RUNTYPE_API_KEY to your Runtype API key before you run either example.
The following cURL command sends the same request:
Replace YOUR_API_KEY with your Runtype API key before you run the cURL
command.
Define and run a flow
Send a POST request to /v1/dispatch with an inline flow definition. Set
flowMode and recordMode to virtual to run without creating a persisted
flow or record. The following TypeScript example sends the request and reads
the Server-Sent Events (SSE) stream:
The following cURL command sends the same request:
Replace YOUR_API_KEY with your Runtype API key before you run the cURL
command.
Use inputs to pass transient variables that templates reference as {{ variableName }}. Use
record.metadata when the data must persist with the record.
Read the response
Because streamResponse is true, the dispatch endpoint returns an SSE stream.
The output is similar to the following:
Stream events
The stream uses event names such as execution_start, step_start,
text_delta, tool_start, tool_input_complete, and execution_complete.
The API reference documents the event fields.
In tool_start and tool_input_complete, the API redacts values injected for
protected parameters as [REDACTED]. The hiddenParameterNames field
identifies the protected fields. The tool receives the resolved values.
Use the SDK
Use the TypeScript SDK to build and run the same flow. Install the SDK package:
The following TypeScript example builds a flow, passes input values, and runs it:
The withInputs method adds top-level variables that prompts reference as
{{variableName}}. Use it for values that change between runs.
Validate before running
Call the validate method with an authenticated client to check an inline flow
before running it. The method reports structural issues, undeclared-variable
warnings, and model recommendations without creating or running the flow. The
following TypeScript example reports validation errors:
The validate method calls the public validation endpoint and does not consume
execution quota. Pass an authenticated client to run account checks for
referenced tools, flows, and agents. Check
validation.context.accountChecksPerformed to confirm whether those checks ran.
Import an existing product spec
If you have a product definition in JSON, use the Runtype import flow to preview and create it without defining each step. Choose the path that matches your input:
- Use Importing products for Agent-to-Agent (A2A) cards, raw Full Product Objects (FPOs), or hosted JSON.
- Use FPO templates to publish reusable FPO definitions with values collected during import.
The import flow supports /now and Deploy to Runtype buttons. It also
supports integrations that submit complete product definitions to Runtype.
Next steps
Continue with one of these resources: