API reference
Cowork
Model access for the Hane Cowork local harness.
Generated from the public API contract (OpenAPI). Descriptions in the contract are written in Japanese.
Endpoints
Section titled “Endpoints”getCoworkPolicy
Section titled “getCoworkPolicy”GET/v1/cowork/policy
プロジェクトと環境に適用する設定。cowork:run または cowork:manage が必要。端末は実行中もこの設定を読み直して手元の機能の決まりに反映し、読めなければ禁止として扱う。
Responses
Section titled “Responses”- 200 —
CoworkPolicy: 未設定なら利用を無効にし、手元の機能をすべて禁止した設定を返す。ETag は設定のバージョン。 - default —
Problem: RFC 9457 Problem Details
setCoworkPolicy
Section titled “setCoworkPolicy”PUT/v1/cowork/policy
組織の管理者が利用の可否・モデル・利用枠・手元の機能の決まりを設定する。cowork:manage が必要。local_tools を省くと、保存済みの手元の機能の決まりをそのまま使う。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
If-Match |
header | string | yes | 取得したときの ETag(version) |
Request body
Section titled “Request body”application/json — CoworkPolicyInput
| Name | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | yes | |
models |
string[] | yes | |
daily_token_limit |
integer | yes | |
session_token_limit |
integer | yes | |
max_output_tokens |
integer | yes | |
local_tools |
CoworkLocalTools |
Responses
Section titled “Responses”- 200 —
CoworkPolicy: 保存した設定。 - default —
Problem: RFC 9457 Problem Details
createCoworkModelSession
Section titled “createCoworkModelSession”POST/v1/cowork/model-sessions
本人の手元の会話にモデル利用を許可する。cowork:run が必要。同じ会話の有効な利用は再利用する。秘密値を含む応答は保存・再送しない。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
conversation_id |
string | yes | |
model |
string | yes |
Responses
Section titled “Responses”- 201 —
CoworkModelCredential: 本人と組織・プロジェクト・環境に束縛したモデル利用と短命の資格情報。 - default —
Problem: RFC 9457 Problem Details
getCoworkModelSession
Section titled “getCoworkModelSession”GET/v1/cowork/model-sessions/{session_id}
本人のモデル利用を読む。cowork:run が必要。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id |
path | string | yes |
Responses
Section titled “Responses”- 200 —
CoworkModelSession: モデル利用。 - default —
Problem: RFC 9457 Problem Details
revokeCoworkModelSession
Section titled “revokeCoworkModelSession”DELETE/v1/cowork/model-sessions/{session_id}
本人のモデル利用を取り消す。新規の呼出しは即座に拒否し、流れている呼出しも停止の確認で切る。cowork:run が必要。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id |
path | string | yes |
Responses
Section titled “Responses”- 204: 取り消した。すでに取り消していても同じ応答。
- default —
Problem: RFC 9457 Problem Details
refreshCoworkModelSession
Section titled “refreshCoworkModelSession”POST/v1/cowork/model-sessions/{session_id}/refresh
本人のいまの権限・設定・残りの利用枠を確かめて資格情報を更新する。古い資格情報での新規の呼出しは拒否する。流れている呼出しの記録は受け付ける。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id |
path | string | yes | |
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Responses
Section titled “Responses”- 200 —
CoworkModelCredential: 更新した資格情報。秘密値を含む応答は保存・再送しない。 - default —
Problem: RFC 9457 Problem Details
listCoworkModelInvocations
Section titled “listCoworkModelInvocations”GET/v1/cowork/model-sessions/{session_id}/invocations
本人のモデル呼出しの記録。cowork:run が必要。上流へ渡す前に記録し、応答が失われても呼出しが消えない。
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
session_id |
path | string | yes | |
limit |
query | integer | ||
cursor |
query | string |
Responses
Section titled “Responses”- 200 —
object: 呼出しの記録。 - default —
Problem: RFC 9457 Problem Details