Schema Reference
The following request / response data structures are auto-synced from newapi’s OpenAPIOpenAPIAn open specification for describing REST APIs (formerly Swagger). Lurus data structures are auto-generated from the gateway's OpenAPI spec.Learn more → spec (relay.json), always staying consistent with the gateway implementation. See the full endpoint list in the API Overview, and call examples in Chat Completions.
How to update
The <!-- sync:schemas --> marker region on this page is regenerated by bun run sync from 2b-svc-newapi/docs/openapi/relay.json. Do not edit this region manually.
35 data structures in total (auto-generated from the OpenAPI spec).
AudioTranscriptionResponse
| Field | Type | Required | Description |
|---|---|---|---|
text | string | — |
ChatCompletionRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
messages | array<Message> | Yes | List of conversation messages |
temperature | number | — | Sampling temperature |
top_p | number | — | Nucleus sampling parameter |
n | integer | — | Number of generations |
stream | boolean | — | Whether to stream the response |
stream_options | object | — | |
stop | string | array<string> | — | Stop sequences |
max_tokens | integer | — | Maximum number of tokens to generate |
max_completion_tokens | integer | — | Maximum number of completion tokens |
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) | — | Reasoning intensity (for models that support reasoning) |
modalities | array<string (text / audio)> | — | |
audio | object | — |
ChatCompletionResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
object | string | — | |
created | integer | — | |
model | string | — | |
choices | array<object> | — | |
usage | Usage | — | |
system_fingerprint | string | — |
ClaudeMessage
| Field | Type | Required | Description |
|---|---|---|---|
role | string (user / assistant) | Yes | |
content | string | array<object> | Yes |
ClaudeRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
messages | array<ClaudeMessage> | Yes | |
system | string | array<object> | — | |
cache_control | object | — | |
inference_geo | string | — | |
max_tokens | integer | Yes | |
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
| Field | Type | Required | Description |
|---|---|---|---|
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
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
prompt | string | array<string> | Yes | |
max_tokens | integer | — | |
temperature | number | — | |
top_p | number | — | |
n | integer | — | |
stream | boolean | — | |
stop | string | array<string> | — | |
suffix | string | — | |
echo | boolean | — |
CompletionResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
object | string | — | |
created | integer | — | |
model | string | — | |
choices | array<object> | — | |
usage | Usage | — |
EmbeddingRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
input | string | array<string> | Yes | Text to embed |
encoding_format | string (float / base64) | — | |
dimensions | integer | — | Output vector dimensions |
EmbeddingResponse
| Field | Type | Required | Description |
|---|---|---|---|
object | string | — | |
data | array<object> | — | |
model | string | — | |
usage | object | — |
GeminiModelsResponse
| Field | Type | Required | Description |
|---|---|---|---|
models | array<object> | — |
GeminiResponse
| Field | Type | Required | Description |
|---|---|---|---|
candidates | array<object> | — | |
usageMetadata | object | — |
ImageResponse
| Field | Type | Required | Description |
|---|---|---|---|
created | integer | — | |
data | array<object> | — |
Message
| Field | Type | Required | Description |
|---|---|---|---|
role | string (system / user / assistant / tool / developer) | Yes | Message role |
content | string | array<MessageContent> | Yes | Message content |
name | string | — | Sender name |
tool_calls | array<ToolCall> | — | |
tool_call_id | string | — | Tool call ID (for tool-role messages) |
reasoning_content | string | — | Reasoning content |
MessageContent
| Field | Type | Required | Description |
|---|---|---|---|
type | string (text / image_url / input_audio / file / video_url) | — | |
text | string | — | |
image_url | object | — | |
input_audio | object | — | |
file | object | — | |
video_url | object | — |
Model
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | Model ID |
object | string | — | Object type |
created | integer | — | Creation timestamp |
owned_by | string | — | Model owner |
ModelsResponse
| Field | Type | Required | Description |
|---|---|---|---|
object | string | — | |
data | array<Model> | — |
ModerationRequest
| Field | Type | Required | Description |
|---|---|---|---|
input | string | array<string> | Yes | |
model | string | — |
ModerationResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
model | string | — | |
results | array<object> | — |
RerankRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
query | string | Yes | Query text |
documents | array<string | object> | Yes | List of documents to rerank |
top_n | integer | — | Return the top N results |
return_documents | boolean | — |
RerankResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
results | array<object> | — | |
meta | object | — |
ResponseFormat
| Field | Type | Required | Description |
|---|---|---|---|
type | string (text / json_object / json_schema) | — | |
json_schema | object | — | JSON Schema definition |
ResponsesCompactionRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
input | string | array<object> | — | Input content, either a string or an array of messages |
instructions | string | — | |
previous_response_id | string | — |
ResponsesCompactionResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
object | string | — | |
created_at | integer | — | |
output | array<object> | — | |
usage | Usage | — | |
error | object | — |
ResponsesRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
input | string | array<object> | — | Input content, either a string or an array of messages |
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
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
object | string | — | |
created_at | integer | — | |
status | string (completed / failed / in_progress / incomplete) | — | |
model | string | — | |
output | array<object> | — | |
usage | Usage | — |
SpeechRequest
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
input | string | Yes | Text to convert |
voice | string (alloy / echo / fable / onyx / nova / shimmer) | Yes | |
response_format | string (mp3 / opus / aac / flac / wav / pcm) | — | |
speed | number | — |
Tool
| Field | Type | Required | Description |
|---|---|---|---|
type | string | — | |
function | object | — |
ToolCall
| Field | Type | Required | Description |
|---|---|---|---|
id | string | — | |
type | string | — | |
function | object | — |
Usage
| Field | Type | Required | Description |
|---|---|---|---|
prompt_tokens | integer | — | Number of prompt tokens |
completion_tokens | integer | — | Number of completion tokens |
total_tokens | integer | — | Total number of tokens |
prompt_tokens_details | object | — | |
completion_tokens_details | object | — |
VideoRequest
Video generation request
| Field | Type | Required | Description |
|---|---|---|---|
model | string | — | Model/style ID |
prompt | string | — | Text description prompt |
image | string | — | Image input (URL or Base64) |
duration | number | — | Video duration (seconds) |
width | integer | — | Video width |
height | integer | — | Video height |
fps | integer | — | Video frame rate |
seed | integer | — | Random seed |
n | integer | — | Number of videos to generate |
response_format | string | — | Response format |
user | string | — | User identifier |
metadata | object | — | Extended parameters (e.g. negative_prompt, style, quality_level) |
VideoResponse
Video generation task submission response
| Field | Type | Required | Description |
|---|---|---|---|
task_id | string | — | Task ID |
status | string | — | Task status |
VideoTaskError
Video task error information
| Field | Type | Required | Description |
|---|---|---|---|
code | integer | — | Error code |
message | string | — | Error message |
VideoTaskMetadata
Video task metadata
| Field | Type | Required | Description |
|---|---|---|---|
duration | number | — | Actual generated video duration |
fps | integer | — | Actual frame rate |
width | integer | — | Actual width |
height | integer | — | Actual height |
seed | integer | — | Random seed used |
VideoTaskResponse
Video task status query response
| Field | Type | Required | Description |
|---|---|---|---|
task_id | string | — | Task ID |
status | string (queued / in_progress / completed / failed) | — | Task status |
url | string | — | Video resource URL (on success) |
format | string | — | Video format |
metadata | VideoTaskMetadata | — | |
error | VideoTaskError | — |