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()):
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 aparts array:
Supported Component Types
| Type | Fields | Description |
|---|---|---|
text | text | Markdown text |
thinking | thinking | Reasoning bubble |
code | code, language | Code block |
table | headers, rows | Data table |
callout | callout, style, title | Alert box |
image | src, alt, caption | Image |
status | status | Progress indicator |
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.