メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

POST /v1/sessions 新しい Session を作成します。Session は Agent とユーザー間の対話コンテナです。作成直後の状態は idle で、Events API でメッセージを送信することで Agent の処理がトリガーされます。

ヘッダー

名称必須
AuthorizationはいBearer $QODER_PAT
Content-Typeはいapplication/json

リクエストボディ

フィールド必須説明
agentstringはいAgent ID(agent_ プレフィックス)
environment_idstringはいEnvironment ID(env_ プレフィックス)
titlestringいいえSession タイトル
metadataobjectいいえカスタムメタデータのキーバリュー
delta_flush_interval_msintegerいいえ増分フラッシュ間隔、範囲 50-5000、デフォルト 100
memory_store_idsarrayいいえ関連付ける Memory Store ID リスト
resourcesarrayいいえファイルリソースリスト(M3 ゲート)
vault_idsarrayいいえVault ID リスト(M3 ゲート)

リクエスト例

curl -X POST https://openapi.qoder.sh/api/v1/cloud/sessions \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "agent_019e390add9f7bac9b6cc806db46fcbd",
    "environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
    "title": "私の Session",
    "metadata": {"purpose": "customer-support"}
  }'

レスポンス例

HTTP 201 Created 完全な Session オブジェクトを返します。
{
  "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "type": "session",
  "agent_id": "agent_019e390add9f7bac9b6cc806db46fcbd",
  "agent": {
    "id": "agent_019e390add9f7bac9b6cc806db46fcbd",
    "type": "agent",
    "name": "test-agent-e2e",
    "description": "E2E テスト用 Agent",
    "model": "ultimate",
    "instructions": "あなたはテストアシスタントです",
    "system": "あなたはテストアシスタントです",
    "tools": [],
    "mcp_servers": [],
    "default_environment": "",
    "version": 2,
    "created_at": "2026-05-18T03:04:33.952256Z",
    "updated_at": "2026-05-18T03:05:28.023697Z"
  },
  "environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
  "title": "私の Session",
  "status": "idle",
  "resources": [],
  "vault_ids": [],
  "memory_store_ids": [],
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 0
    }
  },
  "created_at": "2026-05-18T15:26:15.747298Z",
  "updated_at": "2026-05-18T15:26:15.747298Z"
}

Session オブジェクトのフィールド

フィールド説明
idstringSession の一意識別子(sess_ プレフィックス)
typestring固定値 "session"
agent_idstring関連付けられた Agent ID
agentobjectAgent の完全オブジェクト(name、model、tools などを含む)
environment_idstring関連付けられた Environment ID
titlestringSession タイトル
statusstringSession 状態:idleprocessingcancelled
resourcesarray関連付けられたファイルリソース
vault_idsarray関連付けられた Vault ID リスト
memory_store_idsarray関連付けられた Memory Store ID リスト
usageobjectトークン使用量統計
created_atstring作成時刻(ISO 8601)
updated_atstring最終更新時刻(ISO 8601)

エラーレスポンス

HTTPtype説明
400invalid_request_errorリクエストボディの形式エラーまたは必須フィールド欠落
401authentication_errorPAT が無効または期限切れ
404not_found_errorAgent または Environment が存在しない