Felo APIs
SuperAgent API
बातचीत बनाएं, SSE स्ट्रीम पढ़ें, आगे सवाल पूछें और बातचीत का मेटाडेटा देखें।
/v2/conversationsप्रमाणीकरण
Bearer API key
कंटेंट टाइप
application/json and text/event-stream
दर संबंधी नोट
Connect to stream immediately. Use offset for reconnects.
यह पृष्ठ मौजूदा /v2 Felo APIs का दस्तावेज़ीकरण करता है, जो Felo account entitlements और Pro-credit rules का उपयोग करती हैं। Credits deduct होंगी या नहीं, यह operation पर निर्भर करता है। Platform-balance calls के लिए, समर्थित Felo OpenAPI endpoint चुनें; request और response shapes अलग हो सकती हैं।
SuperAgent API real-time streaming output और LiveDoc integration के साथ AI-powered conversation capabilities प्रदान करती है। Typical workflow इस प्रकार है:
- एक conversation बनाएँ —
stream_key,thread_short_id, औरlive_doc_short_idप्राप्त करें - SSE stream consume करें —
stream_keyका उपयोग करके stream endpoint से connect करें - Follow up करें — उसी conversation में follow-up questions पूछें, नया
stream_keyप्राप्त करें - Conversation detail query करें — conversation metadata लाने के लिए
thread_short_idउपयोग करें - LiveDocs manage करें — पूर्ण CRUD और resource management के लिए LiveDoc API देखें
AI एजेंटों के साथ उपयोग करें
किसी Agent को SuperAgent workflows और हर अन्य उपलब्ध Felo Skill देने के लिए पूरा felo-ai package install करें। Installer SKILL.md वाली हर package directory को dynamically discover करता है, जिसमें future package additions भी शामिल हैं। सभी discovered Skills को Codex ~/.codex/skills, Claude Code ~/.claude/skills, OpenClaw ~/.agents/skills, या Hermes Agent ~/.hermes/skills में install करें। manual AI Agent setup guide safe installation process और per-platform configuration समझाती है।
प्रमाणीकरण
सभी requests के लिए Authorization header में API Key आवश्यक है:
Authorization: Bearer YOUR_API_KEY1. बातचीत बनाएँ
एंडपॉइंट
POST https://openapi.felo.ai/v2/conversationsअनुरोध हेडर
| हेडर | आवश्यक | विवरण |
|---|---|---|
Authorization | हाँ | Bearer YOUR_API_KEY |
Content-Type | हाँ | application/json |
अनुरोध बॉडी
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
query | string | हाँ | उपयोगकर्ता क्वेरी, 1–2000 वर्ण |
live_doc_short_id | string | नहीं | मौजूदा LiveDoc का पुनःउपयोग करें; नया बनाने के लिए छोड़ दें |
selected_resource_ids | स्ट्रिंग्स की सरणी | नहीं | संदर्भ में शामिल करने के लिए संसाधन IDs |
skill_id | string | नहीं | इस बातचीत के लिए उपयोग करने हेतु Skill ID |
accept_language | string | नहीं | भाषा वरीयता, जैसे en |
device_id | string | नहीं | डिवाइस पहचानकर्ता |
extra | object | नहीं | SuperAgent को पारित किए गए अतिरिक्त पैरामीटर |
ext | object | नहीं | विस्तार पैरामीटर (जैसे style_id, 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",
"skill_id": "your-skill-id",
"device_id": "device-001",
"ext": {"style_id": "xxx", "theme": "dark"}
}'सफल प्रतिक्रिया (200)
{
"status": 200,
"code": "OK",
"request_id": "req_example",
"message": null,
"data": {
"stream_key": "sk_abc123xyz",
"thread_short_id": "TvyKouzJirXjFdst4uKRK3",
"live_doc_short_id": "PvyKouzJirXjFdst4uKRK3"
}
}प्रतिक्रिया फ़ील्ड
| फ़ील्ड | प्रकार | विवरण |
|---|---|---|
stream_key | string | SSE स्ट्रीम उपभोग करने के लिए उपयोग की गई कुंजी (अनुभाग 2 देखें) |
thread_short_id | string | बातचीत ID, बातचीत विवरण पूछने के लिए उपयोग किया जाता है |
live_doc_short_id | string | संबद्ध LiveDoc ID |
2. SSE स्ट्रीम उपभोग करें
Conversation create करने के बाद, real-time output प्राप्त करने के लिए stream_key का उपयोग करके stream endpoint से connect करें।
एंडपॉइंट
GET https://openapi.felo.ai/v2/conversations/stream/{stream_key}क्वेरी पैरामीटर
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
offset | integer | नहीं | इस स्थिति से स्ट्रीमिंग पुनःआरंभ करें। डिस्कनेक्ट के बाद पुनःकनेक्शन के लिए उपयोग करें। |
format | string | नहीं | raw (डिफ़ॉल्ट) अपस्ट्रीम content स्ट्रिंग को यथावत रखता है; structured JSON सामग्री को ऑब्जेक्ट या सरणी में डिकोड करता है |
उदाहरण
curl -N 'https://openapi.felo.ai/v2/conversations/stream/sk_abc123xyz' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: text/event-stream'Offset के साथ reconnect करें:
curl -N 'https://openapi.felo.ai/v2/conversations/stream/sk_abc123xyz?offset=42' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: text/event-stream'प्रतिक्रिया
Response एक standard Server-Sent Events (SSE) stream है जिसका Content-Type: text/event-stream होता है।
हर complete SSE event पढ़ें, उसकी JSON parse करने से पहले कई data: lines को newline के साथ जोड़ें। SSE event: name, content के भीतर application event type से अलग है।
Default रूप से, content स्वयं JSON-encoded string होती है:
event: message
data: {"content":"{\"type\":\"answer\",\"data\":{\"text\":\"The latest AI news includes...\"}}"}
event: message
data: {"content":"{\"type\":\"finished\",\"data\":{}}"}
Outer data JSON को decode करें और फिर content decode करें। एक chunk में एक event object, events की array, या कई consecutive JSON values हो सकती हैं। हर object को क्रम में process करें। Plain text और unknown event types भी आ सकते हैं; अपनी application के अनुसार उन्हें retain करें या ignore करें।
सरल parsing के लिए ?format=structured request करें। यह decoded content के साथ वही event metadata लौटाता है:
event: message
data: {"content":{"type":"answer","data":{"text":"The latest AI news includes..."}}}
event: message
data: {"content":{"type":"finished","data":{}}}
Structured mode में multiple consecutive JSON values एक array बन जाती हैं। Unparseable या plain-text content बिना बदले pass through की जाती है। दोनों modes, जहाँ मौजूद हों, upstream resource identifiers को preserve करते हैं।
अनुप्रयोग type | अर्थ | क्लाइंट हैंडलिंग |
|---|---|---|
start | जनरेशन प्रारंभ हुआ | UI स्थिति आरंभ करें |
message | मध्यवर्ती संदेश या मेटाडेटा | data का निरीक्षण करें; अपने अनुप्रयोग द्वारा उपयोग किए जाने वाले फ़ील्ड बनाए रखें |
processing | प्रगति सूचना | उत्तर से अलग प्रदर्शित करें; अंग्रेज़ी बातचीत के लिए भी शब्दावली चीनी हो सकती है |
answer | उत्तर पाठ | data.text पढ़ें और आगमन क्रम में पाठ संसाधित करें |
tools_result_stream, tools_result | टूल आउटपुट | data.tools का निरीक्षण करें; फ़ील्ड टूल पर निर्भर करते हैं |
finished | जनरेशन समाप्त हुई | उत्तर को अंतिम रूप दें और जनरेट किए गए LiveDoc संसाधन पढ़ें |
Table content के भीतर application events का वर्णन करती है; यह exhaustive list नहीं है। Additional fields और event types बाद में जोड़े जा सकते हैं। किसी progress message की language, final answer language से स्वतंत्र होती है।
Authenticated SSE client से structured events के लिए example decoder:
function handleSseData(rawData) {
if (rawData === '[DONE]') return;
const outer = JSON.parse(rawData);
let content = outer.content;
if (typeof content === 'string') {
try { content = JSON.parse(content); } catch { return; }
}
const events = Array.isArray(content) ? content : [content];
for (const event of events) {
if (event?.type === 'answer' && typeof event.data?.text === 'string') {
appendAnswerText(event.data.text); // Your UI callback
} else if (event?.type === 'finished') {
loadGeneratedResources(); // Your LiveDoc resource loader (see below)
}
}
}Upstream error पर:
event: error
data: {"message": "upstream error: 502"}
टिप्पणियाँ
- Conversation create करने के तुरंत बाद connect करें —
stream_keyकी validity window सीमित होती है। - ऐसा SSE-capable client उपयोग करें जो API Key header भेज सके, जैसे
fetch-based SSE reader याcurl -N। Browser-nativeEventSourceAuthorizationheader सेट नहीं कर सकता। - Completion एक application
finishedevent द्वारा signal होती है। यदि मौजूद हो, तो upstream SSEdoneevent या[DONE]sentinel को भी handle करें। Completion signal के बिना connection close होना interruption का अर्थ हो सकता है; जहाँ available हो,offsetके साथ upstream resume position का उपयोग करें।
जनरेट की गई रिपोर्ट पढ़ें
Long research requests के लिए, SuperAgent associated LiveDoc में report को ai_doc resource के रूप में save कर सकती है। Answer text में केवल report title या completion notice हो सकता है। Full report दिखाने के लिए:
- Create या follow-up response से
live_doc_short_idsave करें। Existing LiveDoc reuse करते समय, request शुरू करने से पहले उसके resources list करें और उनके IDs तथा modification timestamps retain करें। - Completion तक stream consume करें। उपलब्ध होने पर tool events से resource IDs उपयोग करें; उनकी presence tool-dependent है।
GET /v2/livedocs/{live_doc_short_id}/resources?resource_types=ai_doc&page=1&size=20list करें।data.total,data.page,data.size, औरdata.itemsका उपयोग करके सभी pages पढ़ें। New या updated reports खोजने के लिए IDs और modification timestamps compare करें।- प्रत्येक selected resource के लिए
GET /v2/livedocs/{live_doc_short_id}/resources/{resource_id}/contentपढ़ें। Full Markdown reportdata.contentमें होती है;snippetकेवल summary है।
यदि stream समाप्त होने पर resource storage पूरी न हुई हो, तो short bounded retry की अनुमति दें। जब आपको reliable report attribution चाहिए, तब प्रत्येक concurrent request के लिए separate LiveDoc उपयोग करें; shared LiveDoc में resource lists compare करने पर किसी अन्य request का output शामिल हो सकता है। resource content formats देखें।
3. अनुवर्ती बातचीत
Existing conversation में follow-up question पूछें। Response stream consume करने के लिए नया stream_key लौटाता है।
एंडपॉइंट
POST https://openapi.felo.ai/v2/conversations/{thread_short_id}/follow_upअनुरोध हेडर
| हेडर | आवश्यक | विवरण |
|---|---|---|
Authorization | हाँ | Bearer YOUR_API_KEY |
Content-Type | हाँ | application/json |
अनुरोध बॉडी
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
query | string | हाँ | अनुवर्ती प्रश्न, 1–2000 वर्ण |
उदाहरण
curl -X POST 'https://openapi.felo.ai/v2/conversations/TvyKouzJirXjFdst4uKRK3/follow_up' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"query": "Can you elaborate on that?"
}'सफल प्रतिक्रिया (200)
{
"status": 200,
"code": "OK",
"request_id": "req_example",
"message": null,
"data": {
"stream_key": "sk_def456uvw",
"thread_short_id": "TvyKouzJirXjFdst4uKRK3",
"live_doc_short_id": "PvyKouzJirXjFdst4uKRK3"
}
}प्रतिक्रिया फ़ील्ड
| फ़ील्ड | प्रकार | विवरण |
|---|---|---|
stream_key | string | इस अनुवर्ती के लिए SSE स्ट्रीम उपभोग करने हेतु प्रयुक्त कुंजी |
thread_short_id | string | अनुरोध के समान ही बातचीत ID |
live_doc_short_id | string | संबद्ध LiveDoc ID |
4. बातचीत विवरण पूछें
एंडपॉइंट
GET https://openapi.felo.ai/v2/conversations/{thread_short_id}उदाहरण
curl 'https://openapi.felo.ai/v2/conversations/TvyKouzJirXjFdst4uKRK3' \
-H 'Authorization: Bearer YOUR_API_KEY'सफल प्रतिक्रिया (200)
{
"status": 200,
"code": "OK",
"request_id": "req_example",
"message": null,
"data": {
"thread_short_id": "TvyKouzJirXjFdst4uKRK3",
"title": "What is the latest news about AI?",
"created_at": "2026-03-09T10:00:00Z",
"updated_at": "2026-03-09T10:00:30Z",
"live_doc_short_id": "PvyKouzJirXjFdst4uKRK3"
}
}प्रतिक्रिया फ़ील्ड
| फ़ील्ड | प्रकार | विवरण |
|---|---|---|
thread_short_id | string | बातचीत ID |
title | string | बातचीत शीर्षक (क्वेरी से व्युत्पन्न) |
created_at | string | निर्माण समय-चिह्न (ISO 8601) |
updated_at | string | अंतिम अद्यतन समय-चिह्न (ISO 8601) |
live_doc_short_id | string | संबद्ध LiveDoc ID |
त्रुटि कोड
| कोड | HTTP स्थिति | विवरण |
|---|---|---|
INVALID_API_KEY | 401 | API Key अमान्य या निरस्त है |
SUPER_AGENT_CONVERSATION_CREATE_FAILED | 502 | बातचीत बनाने में विफल (डाउनस्ट्रीम त्रुटि) |
SUPER_AGENT_CONVERSATION_FOLLOW_UP_FAILED | 502 | बातचीत पर अनुवर्ती करने में विफल (डाउनस्ट्रीम त्रुटि) |
SUPER_AGENT_CONVERSATION_QUERY_FAILED | 502 | बातचीत विवरण पूछने में विफल (डाउनस्ट्रीम त्रुटि) |
विशिष्ट एकीकरण प्रवाह
1. POST /v2/conversations → get stream_key + thread_short_id + live_doc_short_id
2. GET /v2/conversations/stream/{stream_key}?format=structured → consume content events until "finished"
3. POST /v2/conversations/{thread_short_id}/follow_up → ask follow-up, get new stream_key
4. GET /v2/conversations/stream/{new_stream_key}?format=structured → consume until "finished"
5. GET /v2/conversations/{thread_short_id} → fetch conversation metadata
6. GET /v2/livedocs/{live_doc_short_id}/resources → find generated reports
7. GET /v2/livedocs/{live_doc_short_id}/resources/{resource_id}/content → read full reportLiveDoc management (CRUD, resource upload, URL import, retrieval) के लिए LiveDoc API देखें।
मदद चाहिए?
- API, बिलिंग और अकाउंट से जुड़े सवालों के लिए सहायता से संपर्क करें।
- Discord पर Felo डेवलपर्स से बात करें।
- हमारा परिवर्तन लॉग देखें।
- वॉल्यूम प्राइसिंग या खरीद में मदद चाहिए? सेल्स से संपर्क करें।
- LLM से बना रहे हैं? llms.txt पढ़ें।