openapi: 3.1.0 info: title: Friendli Suite API Reference Container.Audio Dedicated.Messages API description: This is an OpenAPI reference of Friendli Suite API. termsOfService: https://friendli.ai/terms-of-service contact: name: FriendliAI Support Team email: support@friendli.ai version: 0.1.0 servers: - url: https://api.friendli.ai tags: - name: Dedicated.Messages paths: /dedicated/v1/messages: post: tags: - Dedicated.Messages summary: Messages description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. operationId: dedicatedMessages security: - token: [] parameters: - name: X-Friendli-Team in: header required: false schema: anyOf: - type: string - type: 'null' description: ID of team to run requests as (optional parameter). title: X-Friendli-Team description: ID of team to run requests as (optional parameter). requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DedicatedMessagesBody' responses: '200': description: Successfully generated a Messages-style response. For streaming (`text/event-stream`) event and chunk details, see [Messages chunk object](/openapi/dedicated/inference/messages-chunk-object). content: application/json: schema: $ref: '#/components/schemas/DedicatedMessagesSuccess' examples: Example: value: id: msg_4b71d12c86d94e719c7e3984a7bb7941 type: message role: assistant content: - type: text text: I can answer questions, generate text, and help with coding tasks. stop_reason: end_turn usage: input_tokens: 17 output_tokens: 14 cache_read_input_tokens: 0 model: (endpoint-id) '422': description: Unprocessable Entity content: application/json: examples: Invalid request error: value: type: error error: type: invalid_request_error message: '...' request_id: req_... schema: $ref: '#/components/schemas/MessagesErrorResponse' x-speakeasy-name-override: messages x-mint: metadata: title: Dedicated Messages sidebarTitle: Messages og:title: Dedicated Messages description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. og:description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. tag: Beta href: /openapi/dedicated/inference/messages content: 'Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. To request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp_XXX) value in the **Bearer Token** field. Refer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key. When streaming mode is used (i.e., `stream` option is set to `true`), the response is in MIME type `text/event-stream`. Otherwise, the content type is `application/json`. You can view the schema of the streamed sequence of chunk objects in streaming mode [here](/openapi/dedicated/inference/messages-chunk-object). Server-side tools are not supported in the Messages API. In `tools`, only custom/client function tools are used; non-`custom` tool types are ignored. This API is currently in **Beta**. While we strive to provide a stable and reliable experience, this feature is still under active development. As a result, you may encounter unexpected behavior or limitations. We encourage you to provide feedback to help us improve the feature before its official release. - [Feature request & feedback](mailto:support@friendli.ai) - [Contact support](mailto:support@friendli.ai) ' /dedicated/v1/messages#stream: post: tags: - Dedicated.Messages summary: Stream messages description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. operationId: dedicatedMessagesStream security: - token: [] parameters: - name: X-Friendli-Team in: header required: false schema: anyOf: - type: string - type: 'null' description: ID of team to run requests as (optional parameter). title: X-Friendli-Team description: ID of team to run requests as (optional parameter). requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DedicatedMessagesStreamBody' responses: '200': description: Successfully generated a streamed Messages-style response. content: text/event-stream: examples: Example: value: 'event: message_start data: {"type":"message_start","message":{"id":"msg_4b71d12c86d94e719c7e3984a7bb7941","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":0,"output_tokens":0,"cache_read_input_tokens":0}}} event: content_block_start data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", how can I help?"}} event: content_block_stop data: {"type":"content_block_stop","index":0} event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":11}} event: message_stop data: {"type":"message_stop"} ' schema: $ref: '#/components/schemas/DedicatedMessagesStreamSuccess' '422': description: Unprocessable Entity content: application/json: examples: Invalid request error: value: type: error error: type: invalid_request_error message: '...' request_id: req_... schema: $ref: '#/components/schemas/MessagesErrorResponse' x-speakeasy-name-override: stream x-mint: metadata: title: Dedicated Stream Messages sidebarTitle: Stream Messages og:title: Dedicated Stream Messages description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. og:description: Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. tag: Beta href: /openapi/dedicated/inference/messages content: 'Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking. To request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp_XXX) value in the **Bearer Token** field. Refer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key. When streaming mode is used (i.e., `stream` option is set to `true`), the response is in MIME type `text/event-stream`. Otherwise, the content type is `application/json`. You can view the schema of the streamed sequence of chunk objects in streaming mode [here](/openapi/dedicated/inference/messages-chunk-object). Server-side tools are not supported in the Messages API. In `tools`, only custom/client function tools are used; non-`custom` tool types are ignored. This API is currently in **Beta**. While we strive to provide a stable and reliable experience, this feature is still under active development. As a result, you may encounter unexpected behavior or limitations. We encourage you to provide feedback to help us improve the feature before its official release. - [Feature request & feedback](mailto:support@friendli.ai) - [Contact support](mailto:support@friendli.ai) ' components: schemas: MessagesResponseTextBlock: properties: type: type: string const: text title: Type description: Content block type. text: type: string title: Text description: Assistant-generated text for this block. type: object required: - type - text title: MessagesResponseTextBlock MessagesUsage: properties: input_tokens: type: integer minimum: 0.0 title: Input Tokens description: Number of billed input tokens for this request. output_tokens: type: integer minimum: 0.0 title: Output Tokens description: Number of billed output tokens generated by the model. cache_read_input_tokens: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Cache Read Input Tokens description: Number of input tokens served from cache, when cache reads are applicable. type: object required: - input_tokens - output_tokens title: MessagesUsage MessagesCompatibilityBlock: properties: type: type: string enum: - document - search_result - redacted_thinking - server_tool_use - web_search_tool_result - web_fetch_tool_result - code_execution_tool_result - bash_code_execution_tool_result - text_editor_code_execution_tool_result - tool_search_tool_result - container_upload title: Type description: Compatibility block type. These blocks are accepted for parsing compatibility and ignored for generation. type: object required: - type title: MessagesCompatibilityBlock MessagesImageSource: oneOf: - $ref: '#/components/schemas/MessagesBase64ImageSource' title: Base64 - $ref: '#/components/schemas/MessagesUrlImageSource' title: URL discriminator: propertyName: type mapping: base64: '#/components/schemas/MessagesBase64ImageSource' url: '#/components/schemas/MessagesUrlImageSource' MessagesToolResultBlock: properties: type: type: string const: tool_result title: Type description: Content block type. Must be `tool_result`. tool_use_id: type: string title: Tool Use Id description: Identifier of the related `tool_use` block this result answers. content: anyOf: - type: string - items: additionalProperties: true type: object type: array - type: 'null' title: Content description: Tool result payload. Can be plain text, a list of objects, or null when no body is returned. type: object required: - type - tool_use_id title: MessagesToolResultBlock MessagesTextBlock: properties: type: type: string const: text title: Type description: Content block type. Must be `text`. text: type: string title: Text description: Text content for this block. type: object required: - type - text title: MessagesTextBlock MessagesStreamContentBlockStop: properties: type: type: string const: content_block_stop title: Type description: The type of the event. index: type: integer title: Index description: Index of the block that has finished streaming. type: object required: - type - index title: MessagesStreamContentBlockStop MessagesStreamMessageDeltaPayload: properties: stop_reason: anyOf: - type: string enum: - end_turn - max_tokens - tool_use - stop_sequence - type: 'null' title: Stop Reason description: Why generation stopped. stop_sequence: anyOf: - type: string - type: 'null' title: Stop Sequence description: Matched stop sequence when `stop_reason=stop_sequence`. type: object title: MessagesStreamMessageDeltaPayload MessagesStreamMessageStart: properties: type: type: string const: message_start title: Type description: The type of the event. message: $ref: '#/components/schemas/MessagesStreamMessageEnvelope' description: Initial response envelope for this streamed message. type: object required: - type - message title: MessagesStreamMessageStart MessagesResponseContentBlock: oneOf: - $ref: '#/components/schemas/MessagesResponseThinkingBlock' title: Thinking - $ref: '#/components/schemas/MessagesResponseTextBlock' title: Text - $ref: '#/components/schemas/MessagesResponseToolUseBlock' title: Tool Use discriminator: propertyName: type mapping: text: '#/components/schemas/MessagesResponseTextBlock' thinking: '#/components/schemas/MessagesResponseThinkingBlock' tool_use: '#/components/schemas/MessagesResponseToolUseBlock' MessagesStreamErrorEvent: properties: type: type: string const: error title: Type description: The type of the event. error: $ref: '#/components/schemas/MessagesStreamErrorDetail' description: Error payload object. request_id: anyOf: - type: string - type: 'null' title: Request Id description: Request identifier for debugging and support. type: object required: - type - error title: MessagesStreamErrorEvent MessagesStreamMessageStop: properties: type: type: string const: message_stop title: Type description: The type of the event. type: object required: - type title: MessagesStreamMessageStop MessagesStreamContentBlockDelta: properties: type: type: string const: content_block_delta title: Type description: The type of the event. index: type: integer title: Index description: Index of the content block being updated. delta: $ref: '#/components/schemas/MessagesStreamContentBlockDeltaPayload' description: Incremental delta payload. type: object required: - type - index - delta title: MessagesStreamContentBlockDelta MessagesErrorResponse: properties: type: type: string const: error title: Type description: Top-level response type for Messages API errors. error: $ref: '#/components/schemas/MessagesErrorObject' description: Structured error object. request_id: anyOf: - type: string - type: 'null' title: Request Id description: Request identifier for debugging and support. It may be omitted in some failure paths. type: object required: - type - error title: MessagesErrorResponse MessagesStreamContentBlockDeltaPayload: oneOf: - $ref: '#/components/schemas/MessagesStreamTextDelta' title: Text Delta - $ref: '#/components/schemas/MessagesStreamThinkingDelta' title: Thinking Delta - $ref: '#/components/schemas/MessagesStreamSignatureDelta' title: Signature Delta - $ref: '#/components/schemas/MessagesStreamInputJsonDelta' title: Input JSON Delta discriminator: propertyName: type mapping: input_json_delta: '#/components/schemas/MessagesStreamInputJsonDelta' signature_delta: '#/components/schemas/MessagesStreamSignatureDelta' text_delta: '#/components/schemas/MessagesStreamTextDelta' thinking_delta: '#/components/schemas/MessagesStreamThinkingDelta' MessagesStreamStartThinkingBlock: properties: type: type: string const: thinking title: Type description: Content block type. thinking: type: string title: Thinking description: Reasoning content when `type=thinking`. signature: anyOf: - type: string - type: 'null' title: Signature description: Optional signature when `type=thinking`. type: object required: - type - thinking title: MessagesStreamStartThinkingBlock MessagesStreamMessageEnvelope: properties: id: type: string title: Id description: Unique ID of the response message. type: type: string const: message title: Type description: Object type, always `message`. role: type: string const: assistant title: Role description: Author role of streamed output, always `assistant`. content: items: $ref: '#/components/schemas/MessagesResponseContentBlock' type: array title: Content description: Initialized as an empty array at start. Populated by subsequent block events. stop_reason: anyOf: - type: string enum: - end_turn - max_tokens - tool_use - stop_sequence - type: 'null' title: Stop Reason description: Stop reason placeholder at start. stop_sequence: anyOf: - type: string - type: 'null' title: Stop Sequence description: Matched stop sequence placeholder at start. usage: $ref: '#/components/schemas/MessagesUsage' description: Running usage object. model: anyOf: - type: string - type: 'null' title: Model description: Model identifier for this response, when available. type: object required: - id - type - role - usage title: MessagesStreamMessageEnvelope MessagesToolChoice: properties: type: type: string enum: - auto - any - tool - none title: Type description: Tool-calling mode. `auto` lets the model decide, `any` requires at least one tool call, `tool` forces a named tool, and `none` disables tool calls. name: anyOf: - type: string - type: 'null' title: Name description: Tool name to force when `type=tool`. Ignored for other `type` values. disable_parallel_tool_use: anyOf: - type: boolean - type: 'null' title: Disable Parallel Tool Use description: If true, restricts the model to at most one tool call at a time. Must not be provided when `type=none`. type: object required: - type title: MessagesToolChoice MessagesStreamEvent: oneOf: - $ref: '#/components/schemas/MessagesStreamMessageStart' title: Message Start - $ref: '#/components/schemas/MessagesStreamContentBlockStart' title: Content Block Start - $ref: '#/components/schemas/MessagesStreamContentBlockDelta' title: Content Block Delta - $ref: '#/components/schemas/MessagesStreamContentBlockStop' title: Content Block Stop - $ref: '#/components/schemas/MessagesStreamMessageDelta' title: Message Delta - $ref: '#/components/schemas/MessagesStreamMessageStop' title: Message Stop - $ref: '#/components/schemas/MessagesStreamErrorEvent' title: Error discriminator: propertyName: type mapping: content_block_delta: '#/components/schemas/MessagesStreamContentBlockDelta' content_block_start: '#/components/schemas/MessagesStreamContentBlockStart' content_block_stop: '#/components/schemas/MessagesStreamContentBlockStop' error: '#/components/schemas/MessagesStreamErrorEvent' message_delta: '#/components/schemas/MessagesStreamMessageDelta' message_start: '#/components/schemas/MessagesStreamMessageStart' message_stop: '#/components/schemas/MessagesStreamMessageStop' MessagesStreamInputJsonDelta: properties: type: type: string const: input_json_delta title: Type description: Delta type. partial_json: type: string title: Partial Json description: Partial JSON fragment for tool arguments when `type=input_json_delta`. type: object required: - type - partial_json title: MessagesStreamInputJsonDelta DedicatedMessagesStreamSuccess: properties: data: $ref: '#/components/schemas/MessagesStreamEvent' description: A server-sent event containing a streamed Messages API update. type: object required: - data title: DedicatedMessagesStreamSuccess MessagesErrorObject: properties: type: type: string title: Type description: Error category. For HTTP 422 in Messages API, this is `invalid_request_error`. message: type: string title: Message description: Human-readable error message. type: object required: - type - message title: MessagesErrorObject MessagesInputMessage: properties: role: type: string enum: - user - assistant title: Role description: Author role for this message turn. Use `user` for user input and `assistant` for prior assistant turns. content: anyOf: - type: string - items: $ref: '#/components/schemas/MessagesContentBlock' type: array title: Content description: Message payload. Supports plain string shorthand or a typed block array. type: object required: - role - content title: MessagesInputMessage DedicatedMessagesStreamBody: properties: messages: items: $ref: '#/components/schemas/MessagesInputMessage' type: array minItems: 1 title: Messages description: A list of conversation messages ordered from oldest to newest. Must contain at least one item. examples: - - content: Explain top_p in one sentence. role: user max_tokens: anyOf: - type: integer minimum: 1.0 - type: 'null' title: Max Tokens description: Maximum number of tokens to generate for the assistant response. Must be greater than 0 when provided. model: type: string title: Model description: ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone. examples: - (endpoint-id) system: anyOf: - anyOf: - type: string - items: $ref: '#/components/schemas/MessagesSystemTextBlock' type: array description: Payload format for the top-level `system` instruction. - type: 'null' title: System description: Optional top-level system instruction applied before conversation turns. Supports a plain string or an array of text blocks. stream: type: boolean title: Stream description: Whether to stream the response. When set to `true`, events are sent as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format) once generated. default: true temperature: anyOf: - type: number - type: 'null' title: Temperature description: Sampling temperature. Lower values make outputs more deterministic; higher values increase diversity. top_p: anyOf: - type: number - type: 'null' title: Top P description: Nucleus sampling parameter. The model samples from the smallest token set whose cumulative probability reaches `top_p`. top_k: anyOf: - type: integer - type: 'null' title: Top K description: Limits sampling to the `k` most likely tokens at each decoding step. stop_sequences: anyOf: - items: type: string type: array - type: 'null' title: Stop Sequences description: Stop strings that terminate generation when matched in output. The matched value is returned in `stop_sequence` when applicable. tools: anyOf: - items: $ref: '#/components/schemas/MessagesToolDefinition' type: array - type: 'null' title: Tools description: Tool definitions available to the model. Use this to allow tool calls with structured arguments. tool_choice: anyOf: - $ref: '#/components/schemas/MessagesToolChoice' - type: 'null' description: Controls tool-calling behavior (`auto`, `any`, `tool`, `none`) and optional parallel-call behavior. thinking: anyOf: - $ref: '#/components/schemas/MessagesThinkingConfig' - type: 'null' description: Controls reasoning behavior with mode (`enabled`, `disabled`, `adaptive`). `enabled` requires `budget_tokens`; `disabled` and `adaptive` must not include it. output_config: anyOf: - $ref: '#/components/schemas/MessagesOutputConfig' - type: 'null' description: Output generation options including effort level and structured output format settings. cache_control: anyOf: - additionalProperties: true type: object - type: 'null' title: Cache Control description: Compatibility field accepted for request portability. Parsed but not used for generation. container: anyOf: - additionalProperties: true type: object - type: 'null' title: Container description: Compatibility field accepted for request portability. Parsed but not used for generation. context_manager: anyOf: - additionalProperties: true type: object - type: 'null' title: Context Manager description: Compatibility field accepted for request portability. Parsed but not used for generation. inference_geo: anyOf: - additionalProperties: true type: object - type: 'null' title: Inference Geo description: Compatibility field accepted for request portability. Parsed but not used for generation. metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata description: Compatibility field accepted for request portability. Parsed but not used for generation. service_tier: anyOf: - type: string - additionalProperties: true type: object - type: 'null' title: Service Tier description: Compatibility field accepted for request portability. Parsed but not used for generation. additionalProperties: true type: object required: - messages - model title: DedicatedMessagesStreamBody example: messages: - content: Hello, summarize what you can do in one sentence. role: user model: (endpoint-id) MessagesResponseThinkingBlock: properties: type: type: string const: thinking title: Type description: Content block type. thinking: type: string title: Thinking description: Reasoning content returned by the model. signature: type: string title: Signature description: Signature associated with the reasoning content. type: object required: - type - thinking - signature title: MessagesResponseThinkingBlock MessagesOutputConfig: properties: effort: anyOf: - type: string enum: - minimal - low - medium - high - xhigh - max - ultracode - type: 'null' title: Effort description: Relative generation effort level. Higher effort can improve quality on harder prompts at the cost of additional compute. format: anyOf: - $ref: '#/components/schemas/MessagesOutputFormat' - type: 'null' description: Structured output settings. Currently supports only `json_schema`. type: object title: MessagesOutputConfig MessagesStreamStartToolUseBlock: properties: type: type: string const: tool_use title: Type description: Content block type. id: type: string title: Id description: Tool call ID when `type=tool_use`. name: type: string title: Name description: Tool name when `type=tool_use`. input: additionalProperties: true type: object title: Input description: Parsed tool input object when `type=tool_use`. type: object required: - type - id - name - input title: MessagesStreamStartToolUseBlock MessagesStreamContentBlockStart: properties: type: type: string const: content_block_start title: Type description: The type of the event. index: type: integer title: Index description: Index of the content block in the response `content` array. content_block: $ref: '#/components/schemas/MessagesStreamContentBlockStartPayload' description: Initial content block payload. type: object required: - type - index - content_block title: MessagesStreamContentBlockStart MessagesStreamTextDelta: properties: type: type: string const: text_delta title: Type description: Delta type. text: type: string title: Text description: Text fragment when `type=text_delta`. type: object required: - type - text title: MessagesStreamTextDelta DedicatedMessagesSuccess: properties: id: type: string title: Id description: Unique identifier for this message response. type: type: string const: message title: Type description: Response object type (`message`). role: type: string const: assistant title: Role description: Role of the output message author (`assistant`). content: items: $ref: '#/components/schemas/MessagesResponseContentBlock' type: array title: Content description: Assistant output blocks in generation order. stop_reason: anyOf: - type: string enum: - end_turn - max_tokens - tool_use - stop_sequence - type: 'null' title: Stop Reason description: Why generation stopped (`end_turn`, `max_tokens`, `tool_use`, `stop_sequence`). stop_sequence: anyOf: - type: string - type: 'null' title: Stop Sequence description: Matched stop string when `stop_reason` is `stop_sequence`; otherwise null. usage: $ref: '#/components/schemas/MessagesUsage' description: Token usage details for this response. model: anyOf: - type: string - type: 'null' title: Model description: Model used to generate the response. additionalProperties: true type: object required: - id - type - role - content - usage title: DedicatedMessagesSuccess MessagesThinkingBlock: properties: type: type: string const: thinking title: Type description: Content block type. Must be `thinking`. thinking: type: string title: Thinking description: Reasoning content for this block. signature: anyOf: - type: string - type: 'null' title: Signature description: Optional signature associated with the reasoning content. type: object required: - type - thinking title: MessagesThinkingBlock MessagesStreamMessageDelta: properties: type: type: string const: message_delta title: Type description: The type of the event. delta: $ref: '#/components/schemas/MessagesStreamMessageDeltaPayload' description: Final message-level delta. usage: anyOf: - $ref: '#/components/schemas/MessagesStreamMessageDeltaUsage' - type: 'null' description: Usage delta object that may be emitted near stream completion. type: object required: - type - delta title: MessagesStreamMessageDelta MessagesOutputFormat: properties: type: anyOf: - type: string const: json_schema - type: 'null' title: Type description: Output format type. Set to `json_schema` to constrain output to a JSON schema. schema: anyOf: - additionalProperties: true type: object - type: 'null' title: Schema description: JSON Schema object applied when `type` is `json_schema`. type: object title: MessagesOutputFormat DedicatedMessagesBody: properties: messages: items: $ref: '#/components/schemas/MessagesInputMessage' type: array minItems: 1 title: Messages description: A list of conversation messages ordered from oldest to newest. Must contain at least one item. examples: - - content: Explain top_p in one sentence. role: user max_tokens: anyOf: - type: integer minimum: 1.0 - type: 'null' title: Max Tokens description: Maximum number of tokens to generate for the assistant response. Must be greater than 0 when provided. model: type: string title: Model description: ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone. examples: - (endpoint-id) system: anyOf: - anyOf: - type: string - items: $ref: '#/components/schemas/MessagesSystemTextBlock' type: array description: Payload format for the top-level `system` instruction. - type: 'null' title: System description: Optional top-level system instruction applied before conversation turns. Supports a plain string or an array of text blocks. stream: anyOf: - type: boolean - type: 'null' title: Stream description: Whether to stream the response. When set to `true`, events are sent as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format) once generated. default: false temperature: anyOf: - type: number - type: 'null' title: Temperature description: Sampling temperature. Lower values make outputs more deterministic; higher values increase diversity. top_p: anyOf: - type: number - type: 'null' title: Top P description: Nucleus sampling parameter. The model samples from the smallest token set whose cumulative probability reaches `top_p`. top_k: anyOf: - type: integer - type: 'null' title: Top K description: Limits sampling to the `k` most likely tokens at each decoding step. stop_sequences: anyOf: - items: type: string type: array - type: 'null' title: Stop Sequences description: Stop strings that terminate generation when matched in output. The matched value is returned in `stop_sequence` when applicable. tools: anyOf: - items: $ref: '#/components/schemas/MessagesToolDefinition' type: array - type: 'null' title: Tools description: Tool definitions available to the model. Use this to allow tool calls with structured arguments. tool_choice: anyOf: - $ref: '#/components/schemas/MessagesToolChoice' - type: 'null' description: Controls tool-calling behavior (`auto`, `any`, `tool`, `none`) and optional parallel-call behavior. thinking: anyOf: - $ref: '#/components/schemas/MessagesThinkingConfig' - type: 'null' description: Controls reasoning behavior with mode (`enabled`, `disabled`, `adaptive`). `enabled` requires `budget_tokens`; `disabled` and `adaptive` must not include it. output_config: anyOf: - $ref: '#/components/schemas/MessagesOutputConfig' - type: 'null' description: Output generation options including effort level and structured output format settings. cache_control: anyOf: - additionalProperties: true type: object - type: 'null' title: Cache Control description: Compatibility field accepted for request portability. Parsed but not used for generation. container: anyOf: - additionalProperties: true type: object - type: 'null' title: Container description: Compatibility field accepted for request portability. Parsed but not used for generation. context_manager: anyOf: - additionalProperties: true type: object - type: 'null' title: Context Manager description: Compatibility field accepted for request portability. Parsed but not used for generation. inference_geo: anyOf: - additionalProperties: true type: object - type: 'null' title: Inference Geo description: Compatibility field accepted for request portability. Parsed but not used for generation. metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata description: Compatibility field accepted for request portability. Parsed but not used for generation. service_tier: anyOf: - type: string - additionalProperties: true type: object - type: 'null' title: Service Tier description: Compatibility field accepted for request portability. Parsed but not used for generation. additionalProperties: true type: object required: - messages - model title: DedicatedMessagesBody example: messages: - content: Hello, summarize what you can do in one sentence. role: user model: (endpoint-id) MessagesStreamContentBlockStartPayload: oneOf: - $ref: '#/components/schemas/MessagesStreamStartTextBlock' title: Text - $ref: '#/components/schemas/MessagesStreamStartThinkingBlock' title: Thinking - $ref: '#/components/schemas/MessagesStreamStartToolUseBlock' title: Tool Use discriminator: propertyName: type mapping: text: '#/components/schemas/MessagesStreamStartTextBlock' thinking: '#/components/schemas/MessagesStreamStartThinkingBlock' tool_use: '#/components/schemas/MessagesStreamStartToolUseBlock' MessagesStreamThinkingDelta: properties: type: type: string const: thinking_delta title: Type description: Delta type. thinking: type: string title: Thinking description: Reasoning fragment when `type=thinking_delta`. type: object required: - type - thinking title: MessagesStreamThinkingDelta MessagesImageBlock: properties: type: type: string const: image title: Type description: Content block type. Must be `image`. source: $ref: '#/components/schemas/MessagesImageSource' description: Image source descriptor (`url` or `base64`). type: object required: - type - source title: MessagesImageBlock MessagesUrlImageSource: properties: type: type: string const: url title: Type description: Image source type. Must be `url`. url: type: string minLength: 1 title: Url description: Publicly accessible image URL that the service can fetch. type: object required: - type - url title: MessagesUrlImageSource MessagesStreamMessageDeltaUsage: properties: input_tokens: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Input Tokens description: Input token count delta when included. output_tokens: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Output Tokens description: Output token count delta when included. cache_read_input_tokens: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Cache Read Input Tokens description: Cached input token count delta when included. type: object title: MessagesStreamMessageDeltaUsage MessagesResponseToolUseBlock: properties: type: type: string const: tool_use title: Type description: Content block type. id: type: string title: Id description: Identifier of the tool call emitted by the model. name: type: string title: Name description: Name of the invoked tool. input: additionalProperties: true type: object title: Input description: Parsed tool argument object generated by the model. type: object required: - type - id - name - input title: MessagesResponseToolUseBlock MessagesStreamStartTextBlock: properties: type: type: string const: text title: Type description: Content block type. text: type: string title: Text description: Text content when `type=text`. type: object required: - type - text title: MessagesStreamStartTextBlock MessagesStreamSignatureDelta: properties: type: type: string const: signature_delta title: Type description: Delta type. signature: type: string title: Signature description: Signature fragment when `type=signature_delta`. type: object required: - type - signature title: MessagesStreamSignatureDelta MessagesThinkingConfig: properties: type: type: string enum: - enabled - disabled - adaptive title: Type description: Reasoning mode. `enabled` forces reasoning, `disabled` suppresses it, and `adaptive` lets the system decide. budget_tokens: anyOf: - type: integer minimum: 1.0 - type: 'null' title: Budget Tokens description: Reasoning token budget. Required when `type=enabled`; must not be provided when `type=disabled` or `type=adaptive`. If `max_tokens` is set, this must be smaller than `max_tokens`. type: object required: - type title: MessagesThinkingConfig MessagesStreamErrorDetail: properties: type: type: string title: Type description: Error category, such as `invalid_request_error`. message: type: string title: Message description: Human-readable error message. type: object required: - type - message title: MessagesStreamErrorDetail MessagesBase64ImageSource: properties: type: type: string const: base64 title: Type description: Image source type. Must be `base64`. data: type: string minLength: 1 title: Data description: Base64-encoded image bytes (without data URL prefix). media_type: type: string minLength: 1 title: Media Type description: MIME type, for example `image/png`. type: object required: - type - data - media_type title: MessagesBase64ImageSource MessagesContentBlock: oneOf: - $ref: '#/components/schemas/MessagesTextBlock' title: Text - $ref: '#/components/schemas/MessagesImageBlock' title: Image - $ref: '#/components/schemas/MessagesThinkingBlock' title: Thinking - $ref: '#/components/schemas/MessagesToolUseBlock' title: Tool Use - $ref: '#/components/schemas/MessagesToolResultBlock' title: Tool Result - $ref: '#/components/schemas/MessagesCompatibilityBlock' title: Compatibility Block discriminator: propertyName: type mapping: bash_code_execution_tool_result: '#/components/schemas/MessagesCompatibilityBlock' code_execution_tool_result: '#/components/schemas/MessagesCompatibilityBlock' container_upload: '#/components/schemas/MessagesCompatibilityBlock' document: '#/components/schemas/MessagesCompatibilityBlock' image: '#/components/schemas/MessagesImageBlock' redacted_thinking: '#/components/schemas/MessagesCompatibilityBlock' search_result: '#/components/schemas/MessagesCompatibilityBlock' server_tool_use: '#/components/schemas/MessagesCompatibilityBlock' text: '#/components/schemas/MessagesTextBlock' text_editor_code_execution_tool_result: '#/components/schemas/MessagesCompatibilityBlock' thinking: '#/components/schemas/MessagesThinkingBlock' tool_result: '#/components/schemas/MessagesToolResultBlock' tool_search_tool_result: '#/components/schemas/MessagesCompatibilityBlock' tool_use: '#/components/schemas/MessagesToolUseBlock' web_fetch_tool_result: '#/components/schemas/MessagesCompatibilityBlock' web_search_tool_result: '#/components/schemas/MessagesCompatibilityBlock' MessagesToolDefinition: properties: name: type: string title: Name description: Tool identifier used in model tool-call outputs. Keep this name stable and unique within the request. type: anyOf: - type: string - type: 'null' title: Type description: Tool category. If missing, empty, or `custom`, it is converted to a function tool. Any non-empty value other than `custom` is treated as a server-side tool and skipped. description: anyOf: - type: string - type: 'null' title: Description description: Natural-language description of what the tool does and when to call it. input_schema: anyOf: - additionalProperties: true type: object - type: 'null' title: Input Schema description: JSON Schema describing tool arguments. The model uses this schema to construct the tool input object. strict: anyOf: - type: boolean - type: 'null' title: Strict description: If true, applies stricter schema adherence when generating tool arguments. type: object required: - name title: MessagesToolDefinition MessagesToolUseBlock: properties: type: type: string const: tool_use title: Type description: Content block type. Must be `tool_use`. id: anyOf: - type: string - type: 'null' title: Id description: Optional tool call identifier. Use this value to link follow-up `tool_result` blocks. name: type: string title: Name description: Name of the tool to invoke. input: additionalProperties: true type: object title: Input description: Tool input argument object. type: object required: - type - name - input title: MessagesToolUseBlock MessagesSystemTextBlock: properties: type: type: string const: text title: Type description: System block type. Must be `text`. text: type: string title: Text description: System instruction text content. type: object required: - type - text title: MessagesSystemTextBlock securitySchemes: token: type: http description: 'When using Friendli Suite API for inference requests, you need to provide a **Friendli Token** for authentication and authorization purposes. For more detailed information, please refer [here](https://friendli.ai/docs/openapi/introduction#authentication).' scheme: bearer x-speakeasy-retries: strategy: backoff backoff: initialInterval: 500 maxInterval: 60000 maxElapsedTime: 3600000 exponent: 1.5 statusCodes: - 429 - 500 - 502 - 503 - 504 retryConnectionErrors: true