Harness 設定
SuperAgent API
会話を作成し、SSE stream を受信し、follow-up と会話メタデータの取得を行います。
/v2/conversations認証
Bearer API key
Content type
application/json and text/event-stream
レート制限
Connect to stream immediately. Use offset for reconnects.
SuperAgent API は、リアルタイム SSE 出力と LiveDoc 連携を備えた AI 会話 API です。基本フローは、会話作成、stream の受信、フォローアップ、会話詳細の取得、LiveDoc によるコンテキストリソース管理です。
認証
Authorization: Bearer YOUR_API_KEY1. 会話を作成
POST https://openapi.felo.ai/v2/conversationsリクエスト Body
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
query | string | はい | ユーザー query。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 ストリームを受信
After creating a conversation, connect to the stream endpoint with stream_key を使って stream endpoint に接続し、リアルタイム出力を受け取ります。
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 | 作成タイムスタンプ, ISO 8601 |
updated_at | string | 最終更新タイムスタンプ, 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 |