Настройка Harness
SuperAgent API
Создавайте conversations, читайте SSE streams, отправляйте follow-up и запрашивайте conversation metadata.
/v2/conversationsАутентификация
Bearer API key
Content type
application/json and text/event-stream
Ограничения
Connect to stream immediately. Use offset for reconnects.
SuperAgent API предоставляет AI conversation with real-time SSE output and LiveDoc integration. Typical flow: create conversation, consume stream, follow up, query conversation detail, and manage context resources with LiveDoc.
Аутентификация
Authorization: Bearer YOUR_API_KEY1. Создать диалог
POST https://openapi.felo.ai/v2/conversationsТело запроса
| Параметр | Тип | Обязательный | Описание |
|---|---|---|---|
query | string | Да | Запрос пользователя, 1–2000 символов |
live_doc_short_id | string | Нет | Повторно использовать существующий LiveDoc; если опустить, будет создан новый |
selected_resource_ids | array of strings | Нет | Resource IDs, которые нужно включить в контекст |
skill_id | string | Нет | Skill ID для этого диалога |
accept_language | string | Нет | Предпочитаемый язык, например en |
device_id | string | Нет | Идентификатор устройства |
extra | object | Нет | Дополнительные параметры, передаваемые в SuperAgent |
ext | object | Нет | Параметры расширения, such as style_id or theme |
curl -X POST 'https://openapi.felo.ai/v2/conversations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"query":"What is the latest news about AI?","accept_language":"en"}'Поля ответа
| Поле | Тип | Описание |
|---|---|---|
stream_key | string | Key used to consume the SSE stream |
thread_short_id | string | ID диалога for follow-up and detail query |
live_doc_short_id | string | Связанный LiveDoc ID |
2. Читать SSE stream
After creating a conversation, connect to the stream endpoint with stream_key чтобы получать вывод в реальном времени.
GET https://openapi.felo.ai/v2/conversations/stream/{stream_key}| Параметр | Тип | Обязательный | Описание |
|---|---|---|---|
offset | integer | Нет | Resume streaming from this position after disconnect |
curl -N 'https://openapi.felo.ai/v2/conversations/stream/sk_abc123xyz' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: text/event-stream'The response uses standard SSE format with events such as message, done, and error. Connect soon after creating the conversation because stream_key имеет ограниченное время действия.
3. Продолжить диалог
Ask a follow-up question in the same conversation. The endpoint returns a new stream_key for the SSE stream.
POST https://openapi.felo.ai/v2/conversations/{thread_short_id}/follow_up| Параметр | Тип | Обязательный | Описание |
|---|---|---|---|
query | string | Да | Уточняющий вопрос, 1–2000 символов |
4. Получить детали диалога
Query conversation metadata, including title, creation time, update time, and associated LiveDoc ID.
GET https://openapi.felo.ai/v2/conversations/{thread_short_id}Поля ответа
| Поле | Тип | Описание |
|---|---|---|
thread_short_id | string | ID диалога |
title | string | Название диалога derived from the query |
created_at | string | Timestamp создания, ISO 8601 |
updated_at | string | Timestamp последнего обновления, ISO 8601 |
live_doc_short_id | string | Связанный LiveDoc ID |
Typical Integration Flow
1. POST /v2/conversations -> get stream_key + thread_short_id + live_doc_short_id
2. GET /v2/conversations/stream/{stream_key} -> consume SSE until done
3. POST /v2/conversations/{thread_short_id}/follow_up -> ask follow-up, get new stream_key
4. GET /v2/conversations/stream/{new_stream_key} -> consume follow-up SSE until done
5. GET /v2/conversations/{thread_short_id} -> fetch conversation metadataFor LiveDoc CRUD, resource upload, URL import, and retrieval, see the LiveDoc API.
Коды ошибок
| Code | HTTP Status | Описание |
|---|---|---|
INVALID_API_KEY | 401 | API Key is invalid or revoked |
SUPER_AGENT_CONVERSATION_CREATE_FAILED | 502 | Failed to create conversation |
SUPER_AGENT_CONVERSATION_FOLLOW_UP_FAILED | 502 | Failed to follow up conversation |
SUPER_AGENT_CONVERSATION_QUERY_FAILED | 502 | Failed to query conversation detail |