データ構造リファレンス
以下のリクエスト / レスポンスのデータ構造は、newapi の OpenAPIOpenAPIREST API を記述するオープン仕様(旧 Swagger)です。Lurus のデータ構造はゲートウェイの OpenAPI 仕様から自動同期生成されます。詳しく見る → 仕様(relay.json)から自動同期生成され、常にゲートウェイの実装と一致します。完全なエンドポイント一覧は API 概要、呼び出し例は Chat Completions を参照してください。
更新方法
本ページの <!-- sync:schemas --> マーカー領域は bun run sync により 2b-svc-newapi/docs/openapi/relay.json から再生成されます。この領域を手動で編集しないでください。
計 35 個のデータ構造(OpenAPI 仕様から自動生成)。
AudioTranscriptionResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
text | string | — |
ChatCompletionRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | モデル ID |
messages | array<Message> | はい | 会話メッセージのリスト |
temperature | number | — | サンプリング温度 |
top_p | number | — | 核サンプリングパラメータ |
n | integer | — | 生成数 |
stream | boolean | — | ストリーミングレスポンスを使用するか |
stream_options | object | — | |
stop | string | array<string> | — | 停止シーケンス |
max_tokens | integer | — | 最大生成 Token 数 |
max_completion_tokens | integer | — | 最大補完 Token 数 |
presence_penalty | number | — | |
frequency_penalty | number | — | |
logit_bias | object | — | |
user | string | — | |
tools | array<Tool> | — | |
tool_choice | string (none / auto / required) | object | — | |
response_format | ResponseFormat | — | |
seed | integer | — | |
reasoning_effort | string (low / medium / high) | — | 推論強度(推論をサポートするモデル向け) |
modalities | array<string (text / audio)> | — | |
audio | object | — |
ChatCompletionResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
object | string | — | |
created | integer | — | |
model | string | — | |
choices | array<object> | — | |
usage | Usage | — | |
system_fingerprint | string | — |
ClaudeMessage
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
role | string (user / assistant) | はい | |
content | string | array<object> | はい |
ClaudeRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
messages | array<ClaudeMessage> | はい | |
system | string | array<object> | — | |
cache_control | object | — | |
inference_geo | string | — | |
max_tokens | integer | はい | |
temperature | number | — | |
top_p | number | — | |
top_k | integer | — | |
stream | boolean | — | |
stop_sequences | array<string> | — | |
tools | array<object> | — | |
tool_choice | object | — | |
thinking | object | — | |
context_management | object | — | |
output_config | object | — | |
output_format | object | — | |
container | string | object | — | |
mcp_servers | array<object> | — | |
metadata | object | — | |
speed | string (standard / fast) | — | |
service_tier | string (auto / standard_only) | — |
ClaudeResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
type | string | — | |
role | string | — | |
content | array<object> | — | |
model | string | — | |
stop_reason | string (end_turn / max_tokens / stop_sequence / tool_use) | — | |
usage | object | — |
CompletionRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
prompt | string | array<string> | はい | |
max_tokens | integer | — | |
temperature | number | — | |
top_p | number | — | |
n | integer | — | |
stream | boolean | — | |
stop | string | array<string> | — | |
suffix | string | — | |
echo | boolean | — |
CompletionResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
object | string | — | |
created | integer | — | |
model | string | — | |
choices | array<object> | — | |
usage | Usage | — |
EmbeddingRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
input | string | array<string> | はい | 埋め込み対象のテキスト |
encoding_format | string (float / base64) | — | |
dimensions | integer | — | 出力ベクトルの次元数 |
EmbeddingResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
object | string | — | |
data | array<object> | — | |
model | string | — | |
usage | object | — |
GeminiModelsResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
models | array<object> | — |
GeminiResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
candidates | array<object> | — | |
usageMetadata | object | — |
ImageResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
created | integer | — | |
data | array<object> | — |
Message
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
role | string (system / user / assistant / tool / developer) | はい | メッセージのロール |
content | string | array<MessageContent> | はい | メッセージの内容 |
name | string | — | 送信者名 |
tool_calls | array<ToolCall> | — | |
tool_call_id | string | — | ツール呼び出し ID(tool ロールのメッセージで使用) |
reasoning_content | string | — | 推論内容 |
MessageContent
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string (text / image_url / input_audio / file / video_url) | — | |
text | string | — | |
image_url | object | — | |
input_audio | object | — | |
file | object | — | |
video_url | object | — |
Model
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | モデル ID |
object | string | — | オブジェクトタイプ |
created | integer | — | 作成タイムスタンプ |
owned_by | string | — | モデルの所有者 |
ModelsResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
object | string | — | |
data | array<Model> | — |
ModerationRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
input | string | array<string> | はい | |
model | string | — |
ModerationResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
model | string | — | |
results | array<object> | — |
RerankRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
query | string | はい | クエリテキスト |
documents | array<string | object> | はい | 再ランク付けするドキュメントのリスト |
top_n | integer | — | 上位 N 件の結果を返す |
return_documents | boolean | — |
RerankResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
results | array<object> | — | |
meta | object | — |
ResponseFormat
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string (text / json_object / json_schema) | — | |
json_schema | object | — | JSON Schema 定義 |
ResponsesCompactionRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
input | string | array<object> | — | 入力内容。文字列またはメッセージ配列を指定できます |
instructions | string | — | |
previous_response_id | string | — |
ResponsesCompactionResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
object | string | — | |
created_at | integer | — | |
output | array<object> | — | |
usage | Usage | — | |
error | object | — |
ResponsesRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
input | string | array<object> | — | 入力内容。文字列またはメッセージ配列を指定できます |
instructions | string | — | |
max_output_tokens | integer | — | |
temperature | number | — | |
top_p | number | — | |
stream | boolean | — | |
tools | array<object> | — | |
tool_choice | string | object | — | |
reasoning | object | — | |
previous_response_id | string | — | |
truncation | string (auto / disabled) | — |
ResponsesResponse
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
object | string | — | |
created_at | integer | — | |
status | string (completed / failed / in_progress / incomplete) | — | |
model | string | — | |
output | array<object> | — | |
usage | Usage | — |
SpeechRequest
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | |
input | string | はい | 変換対象のテキスト |
voice | string (alloy / echo / fable / onyx / nova / shimmer) | はい | |
response_format | string (mp3 / opus / aac / flac / wav / pcm) | — | |
speed | number | — |
Tool
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
type | string | — | |
function | object | — |
ToolCall
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | — | |
type | string | — | |
function | object | — |
Usage
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
prompt_tokens | integer | — | プロンプトの Token 数 |
completion_tokens | integer | — | 補完の Token 数 |
total_tokens | integer | — | 合計 Token 数 |
prompt_tokens_details | object | — | |
completion_tokens_details | object | — |
VideoRequest
動画生成リクエスト
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | — | モデル / スタイル ID |
prompt | string | — | テキスト記述プロンプト |
image | string | — | 画像入力(URL または Base64) |
duration | number | — | 動画の長さ(秒) |
width | integer | — | 動画の幅 |
height | integer | — | 動画の高さ |
fps | integer | — | 動画のフレームレート |
seed | integer | — | 乱数シード |
n | integer | — | 生成する動画の数 |
response_format | string | — | レスポンス形式 |
user | string | — | ユーザー識別子 |
metadata | object | — | 拡張パラメータ(negative_prompt、style、quality_level など) |
VideoResponse
動画生成タスク投入レスポンス
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
task_id | string | — | タスク ID |
status | string | — | タスクの状態 |
VideoTaskError
動画タスクのエラー情報
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
code | integer | — | エラーコード |
message | string | — | エラーメッセージ |
VideoTaskMetadata
動画タスクのメタデータ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
duration | number | — | 実際に生成された動画の長さ |
fps | integer | — | 実際のフレームレート |
width | integer | — | 実際の幅 |
height | integer | — | 実際の高さ |
seed | integer | — | 使用された乱数シード |
VideoTaskResponse
動画タスク状態照会レスポンス
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
task_id | string | — | タスク ID |
status | string (queued / in_progress / completed / failed) | — | タスクの状態 |
url | string | — | 動画リソースの URL(成功時) |
format | string | — | 動画フォーマット |
metadata | VideoTaskMetadata | — | |
error | VideoTaskError | — |