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 |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|
agent | string | はい | Agent ID(agent_ プレフィックス) |
environment_id | string | はい | Environment ID(env_ プレフィックス) |
title | string | いいえ | Session タイトル |
metadata | object | いいえ | カスタムメタデータのキーバリュー |
delta_flush_interval_ms | integer | いいえ | 増分フラッシュ間隔、範囲 50-5000、デフォルト 100 |
memory_store_ids | array | いいえ | 関連付ける Memory Store ID リスト |
resources | array | いいえ | ファイルリソースリスト(M3 ゲート) |
vault_ids | array | いいえ | 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 オブジェクトのフィールド
| フィールド | 型 | 説明 |
|---|
id | string | Session の一意識別子(sess_ プレフィックス) |
type | string | 固定値 "session" |
agent_id | string | 関連付けられた Agent ID |
agent | object | Agent の完全オブジェクト(name、model、tools などを含む) |
environment_id | string | 関連付けられた Environment ID |
title | string | Session タイトル |
status | string | Session 状態:idle、processing、cancelled |
resources | array | 関連付けられたファイルリソース |
vault_ids | array | 関連付けられた Vault ID リスト |
memory_store_ids | array | 関連付けられた Memory Store ID リスト |
usage | object | トークン使用量統計 |
created_at | string | 作成時刻(ISO 8601) |
updated_at | string | 最終更新時刻(ISO 8601) |
エラーレスポンス
| HTTP | type | 説明 |
|---|
| 400 | invalid_request_error | リクエストボディの形式エラーまたは必須フィールド欠落 |
| 401 | authentication_error | PAT が無効または期限切れ |
| 404 | not_found_error | Agent または Environment が存在しない |