지식 검색 API 가이드

요청 엔드포인트

POST /external/use/seek-knowledge/seek HTTP/1.1

사용 가능한 모델 목록 요청

GET /external/use/seek-knowledge/models HTTP/1.1

요청 헤더

헤더설명
AuthorizationBearer <your_token>사용자 신원을 확인하기 위한 인증 토큰. <your_token>을 실제 토큰으로 교체하세요.
Content-Typeapplication/json요청 본문이 JSON 형식임을 나타냅니다.
Hostedge.flowith.netAPI 서버 주소.
User-AgentHTTPie(선택) 클라이언트 식별자.

요청 본문 (JSON)

매개변수유형설명
messagesArray대화 메시지 목록. 각 메시지 객체는 rolecontent 필드를 포함합니다.
modelString모델 이름. 예: "gpt-4o-mini"
streamBoolean스트리밍 응답을 활성화할지 여부. true면 활성화, false면 비활성화.
kb_listString ArrayKnowledge Base ID 목록. 지식 검색 범위를 지정합니다.

messages 필드 상세

  • role: 메시지 역할로, "assistant" 또는 "user"가 될 수 있습니다.
  • content: 정교한 질의나 지침 같은 메시지 내용입니다.

응답

streamtrue일 때 (스트리밍 응답)

  • 응답 상태 코드: 200 OK
  • 응답 헤더: Content-Type: text/plain; charset=UTF-8 등 표준 HTTP 헤더를 포함합니다.
  • 응답 본문: data:로 시작하는 텍스트 스트림. 각 data: 블록은 다음과 같은 가능한 tag 값을 가진 JSON 객체를 포함합니다.
    • searching: 검색이 진행 중임을 나타내며, content 필드에 진행 상황 업데이트가 포함됩니다.
    • seeds: 중간 검색 결과로, content는 JSON 배열이며 각 요소는 id, tokens, content, order, source_id, source_title, nip를 포함하는 별개의 지식 조각입니다.
    • final: 최종 결과를 나타내며, content에 완전한 응답 텍스트가 포함됩니다.

streamfalse일 때

  • 응답 상태 코드: 200 OK
  • 응답 헤더: Content-Type: application/json 등 표준 HTTP 헤더를 포함합니다.
  • 응답 본문: tagcontent 필드를 포함하는 JSON 객체.
    • tag: 항상 "final".
    • content: 완전한 응답 텍스트.

curl 예제

스트리밍 응답 (stream = true)

curl -X POST "https://edge.flowith.net/external/use/knowledge-base/seek" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -H "Host: edge.flowith.net" \
  -d '{
    "messages": [
      {"role": "assistant", "content": "I'd like to explore effective social dynamics and interpersonal relationships"},
      {"role": "user", "content": "Share your best strategies for authentic connection and building rapport in professional settings"}
    ],
    "model": "gpt-4.1-mini",
    "stream": true,
    "kb_list": ["<knowledge_base_id>"]
  }' 

비스트리밍 응답 (stream = false)

curl -X POST "https://edge.flowith.net/external/use/knowledge-base/seek" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -H "Host: edge.flowith.net" \
  -d '{
    "messages": [
      {"role": "assistant", "content": "I'd like to explore effective social dynamics and interpersonal relationships"},
      {"role": "user", "content": "Share your best strategies for authentic connection and building rapport in professional settings"}
    ],
    "model": "gpt-4.1-mini",
    "stream": false,
    "kb_list": ["<knowledge_base_id>"]
  }' 

<your_token><knowledge_base_id>를 실제 값으로 교체하는 것을 잊지 마세요.

요청 제한

  • 요청: 분당 12회 요청(RPM)
  • 참고: 이 제한을 초과하면 HTTP 429(Too Many Requests) 오류가 발생합니다

과금

  • 할당량 사용: 요금은 해당 Flowith 계정의 Credits 할당량을 기준으로 계산됩니다
  • 과금 주기: 사용량은 계정 잔액에서 실시간으로 계산되어 차감됩니다