GET
/v1/schemas/baseten/chat/v1/messages
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source traceaa7bde20942ca711969ec6b81aab7d14ac913e23ef78ca5424d48038046d9da7{
"fetchedAt": 1791264068,
"extractorVersion": "1",
"verifiedAt": null
} |
Request body
12 properties · 3 required · 6 $defs| property | type | description | constraints |
|---|---|---|---|
| model* | string | The model slug to use. Find available models at [Model APIs](https://app.baseten.co/model-apis/create). | |
| messages* | InputMessage[] | The conversation history as an ordered list of input messages. Alternating `user` and `assistant` roles are expected; the final message must be from the `user`. | |
| max_tokens* | integer | The maximum number of tokens to generate in the response. Required by the Messages API. The response may be shorter if it finishes naturally or hits a stop sequence. | n ≥ 1 |
| system | string | TextBlock[] | A system prompt that sets the model's behavior. Pass either a single string or an array of text content blocks. | |
| temperature | number | Controls randomness. Lower values are more deterministic. Range: 0 to 1. | 0 ≤ n ≤ 1 · default: 1 |
| top_p | number | Nucleus sampling: only consider tokens with cumulative probability up to this value. | 0 < n ≤ 1 |
| top_k | integer | Limits token selection to the top K most probable tokens at each step. | n ≥ 0 |
| stop_sequences | string[] | Custom text sequences that will stop generation. When a stop sequence is hit, `stop_reason` is `stop_sequence` and `stop_sequence` contains the matched string. | |
| stream | boolean | If `true`, the response is streamed as server-sent events. Each event has a `type` such as `message_start`, `content_block_delta`, or `message_stop`. | default: false |
| tools | ToolDefinition[] | A list of tools the model may call. Each tool has a `name`, `description`, and `input_schema` (a JSON Schema object). | |
| tool_choice | object | object | object | … | Controls which tool (if any) the model must call. | |
| metadata | object | An object describing metadata about the request. Supports `user_id` for abuse detection. |
Types
6 $defsInputMessageobject
A message in the conversation.
| role* | enum | The role of the message author. System prompts are passed via the top-level `system` field, not as a message. | user | assistant |
| content* | string | TextBlock | ToolUseBlock | ToolResultBlock[] | The message content. Pass a string for text-only messages or an array of content blocks for messages that include tool calls or tool results. |
TextBlockobject
A text content block.
| type* | const | The block type, always `text`. | "text" |
| text* | string | The text content. |
ToolChoiceobject | object | object | …
Controls which tool (if any) the model calls.
ToolDefinitionobject
A tool the model can call.
| name* | string | A unique name for the tool. | |
| description | string | A description of what the tool does. The model uses this to decide when to call it. | |
| input_schema* | object | A JSON Schema object describing the tool's expected input. |
ToolResultBlockobject
A tool result content block supplied by the user in response to a tool call.
| type* | const | The block type, always `tool_result`. | "tool_result" |
| tool_use_id* | string | The `id` of the `tool_use` block this result responds to. | |
| content* | string | TextBlock[] | The tool's output. Pass a string for simple results or an array of text blocks for structured output. | |
| is_error | boolean | Set to `true` if the tool call raised an error. | default: false |
ToolUseBlockobject
A tool use content block generated by the model.
| type* | const | The block type, always `tool_use`. | "tool_use" |
| id* | string | A unique identifier for this tool call. Use this as `tool_use_id` in the matching tool result. | |
| name* | string | The name of the tool being called. | |
| input* | object | The arguments passed to the tool, matching the tool's `input_schema`. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"baseten","endpointId":"v1/messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}