Skip to main content

Overview

The SketricGen Runtime API executes agents that you created in SketricGen. Use it to send a message, continue a conversation, attach previously uploaded files, stream the response, or resume a Human Input pause. The customer-facing Runtime API intentionally exposes one programmatic execution endpoint. Teamspace and agent management belong to the Admin API, while conversational AI management belongs to the SketricGen MCP server. Base URL: https://chat-v2.sketricgen.ai/api/v1

When to use the Runtime API

Use the Runtime API when you want to call an existing SketricGen agent from your own product, backend, workflow runner, or custom UI. Common use cases:
  • Run AI Workforce agents from your own application
  • Add SketricGen agents to an internal product experience
  • Build a custom chat UI instead of using the hosted website widget
  • Trigger an agent from backend jobs or server-side automations
  • Keep conversation identity aligned with users or contacts in your own system
If you only need a copy-paste website chat bubble or iframe, use Deploy an AI Chatbot to a Custom Website instead.

Authentication

Every Runtime API request requires a Teamspace Runtime API key beginning with sk_runtime_. Create it from Teamspace settings → API keys → Create key → Runtime key. Choose the narrowest project and agent scope that supports the integration. The plaintext key is shown once. Required Header:
Do not use an Admin API key beginning with sk_admin_ here. Admin keys manage Teamspace resources; they do not execute agents.

Quick start

Keep the Runtime API key on a server or in a secret manager. Do not call the Runtime API directly from public browser code.

Endpoints

Run Workflow

POST /run-workflow Execute an AI workflow using a specified agent to generate intelligent responses based on user input.

Request Headers

Request Body

Example Request

Contact ID and User Grouping

Use contact_id when your product already knows who the end user or contact is. Conversations sent with the same agent_id and contact_id are grouped under the same contact in SketricGen. This is useful when you want to:
  • See all conversations from one customer or app user together
  • Continue reviewing a user’s history across multiple sessions
  • Connect SketricGen conversations back to your CRM, database, or product user record
  • Use the same identity model across API, widget, iframe, and other channels
Use a stable internal ID, UUID, or hashed value. Do not send emails, phone numbers, names, or other directly identifiable personal data as the contact ID. Good examples:
Avoid:

Identity Fields by Deployment Method

The same agent can be deployed through the website widget, iframe, fullscreen link, or Public API. The identity fields change slightly by deployment method: API example:
Widget equivalent:
Iframe equivalent:
If the visitor is anonymous, omit the contact identifier. The widget will use its browser-stored anonymous contact behavior, while API requests without contact_id create conversations without your external user mapping.

Response Formats

The endpoint supports two response modes.

1. Standard Response (stream: false)

HTTP Status: 201 Created Response Body: Example Response:

2. Streaming Response (stream: true)

HTTP Status: 200 OK Content-Type: text/event-stream When streaming is enabled, the endpoint returns real-time Server-Sent Events (SSE) as the AI processes the request. Event Types: Example Streaming Events: