Skip to main content

Overview

Every agent automatically exposes two streaming API endpoints:
  • OpenAI-compatible endpoint (/chat/completions) - Works with any OpenAI SDK
  • Cycls Protocol endpoint (/chat/cycls) - Native protocol with rich UI components

API Endpoints

Your agent exposes these endpoints: Local Development (app.local()):
Cloud Deployment (app.deploy()):

OpenAI-Compatible API

The /chat/completions endpoint follows the standard OpenAI chat completion format, making it compatible with any OpenAI SDK or client.

Request Format

Using cURL

Using the OpenAI Python SDK

Using the OpenAI JavaScript SDK

Cycls Protocol

The /chat/cycls endpoint uses Server-Sent Events (SSE) to stream rich UI components including thinking bubbles, code blocks, tables, and more.

Request Format

Response Format

The response streams SSE events with JSON payloads:

Message Structure

Assistant responses contain a parts array:

Supported Component Types

Authentication

Public Access (auth=False)

If your agent is public, API endpoints are open:

Protected Access (auth=True)

If your agent requires auth, include a Bearer token:

Next Steps

User Authentication

Learn how to secure your agent with built-in user authentication.