全部產品
Search
文件中心

Qoder CN 系列:擷取 Session 詳情

更新時間:Jul 15, 2026

根據 ID 擷取 Forward Session。

GET /api/v1/forward/sessions/{session_id}

返回 Forward 承諾的穩定 Session 欄位,預設不暴露運行時私人欄位。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

路徑參數

參數

類型

是否必填

說明

session_id

string

Session ID。

樣本請求

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx' \
  -H "Authorization: Bearer $QODER_PAT"

樣本響應

HTTP 200 OK

{
  "id": "sess_xxx",
  "type": "session",
  "identity_id": "idn_xxx",
  "template": {
    "id": "tmpl_support",
    "type": "template",
    "name": "Support assistant",
    "model": "ultimate",
    "version": 3
  },
  "source_type": "api",
  "status": "running",
  "title": "Customer support session",
  "incremental_streaming_enabled": true,
  "metadata": {
    "source": "web"
  },
  "config": {
    "environment_variables": {
      "API_KEY": "sk-xxx"
    }
  },
  "stats": {
    "active_seconds": 30,
    "duration_seconds": 3600
  },
  "usage": {
    "credits": 12.5
  },
  "created_at": "2026-06-22T10:00:00Z",
  "updated_at": "2026-06-22T11:00:00Z"
}

響應欄位

欄位

類型

說明

傳回值

object

Session 對象。

錯誤

HTTP

Type

Code

觸發條件

404

not_found_error

session_not_found

Session 不存在或當前調用方不可見。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • Forward 先校正帳號和 Template 歸屬,再讀取運行時事實。

  • 底層運行時 Session 不存在時統一返回 404 session_not_found

相關