Generate a model response from a conversation using the Anthropic Messages API format. Supports streaming, function tool calls, and extended thinking.
See available models at this pricing table .
The Messages API may not be supported by all models available on Model APIs.
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 on our introduction page to learn how to acquire this variable and visit here 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 .
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. When using Friendli Suite API, you need to provide a Personal API Key (e.g. flp_XXX) as a Bearer token for authentication and authorization purposes.
For more detailed information, please refer here .
ID of team to run requests as (optional parameter).
messages
MessagesInputMessage · object[]
required
A list of conversation messages ordered from oldest to newest. Must contain at least one item.
Minimum array length: 1
Author role for this message turn. Use user for user input and assistant for prior assistant turns.
Available options:
user,
assistant
messages. content
string (Text · object | Image · object | Thinking · object | Tool Use · object | Tool Result · object | Compatibility Block · object)[] string (Text · object | Image · object | Thinking · object | Tool Use · object | Tool Result · object | Compatibility Block · object)[]
required
Message payload. Supports plain string shorthand or a typed block array.
Maximum number of tokens to generate for the assistant response. Must be greater than 0 when provided.
Required range: x >= 1
system
string MessagesSystemTextBlock · object[] string MessagesSystemTextBlock · object[]
Payload format for the top-level system instruction.
stream
boolean | null
default: false
Whether to stream the response. When set to true , events are sent as server-sent events once generated.
Sampling temperature. Lower values make outputs more deterministic; higher values increase diversity.
Nucleus sampling parameter. The model samples from the smallest token set whose cumulative probability reaches top_p .
Limits sampling to the k most likely tokens at each decoding step.
Stop strings that terminate generation when matched in output. The matched value is returned in stop_sequence when applicable.
tools
MessagesToolDefinition · object[] | null
Tool definitions available to the model. Use this to allow tool calls with structured arguments.
Tool identifier used in model tool-call outputs. Keep this name stable and unique within the request.
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.
Natural-language description of what the tool does and when to call it.
tools. input_schema
Input Schema · object | null
JSON Schema describing tool arguments. The model uses this schema to construct the tool input object.
If true, applies stricter schema adherence when generating tool arguments.
tool_choice
MessagesToolChoice · object | null
Controls tool-calling behavior (auto , any , tool , none ) and optional parallel-call behavior.
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.
Available options:
auto,
any,
tool,
none
Tool name to force when type=tool . Ignored for other type values.
tool_choice. disable_parallel_tool_use
If true, restricts the model to at most one tool call at a time. Must not be provided when type=none .
thinking
MessagesThinkingConfig · object | null
Controls reasoning behavior with mode (enabled , disabled , adaptive ). enabled requires budget_tokens ; disabled and adaptive must not include it.
Reasoning mode. enabled forces reasoning, disabled suppresses it, and adaptive lets the system decide.
Available options:
enabled,
disabled,
adaptive
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 .
Required range: x >= 1
output_config
MessagesOutputConfig · object | null
Output generation options including effort level and structured output format settings.
Relative generation effort level. Higher effort can improve quality on harder prompts at the cost of additional compute.
Available options:
minimal,
low,
medium,
high,
xhigh,
max,
ultracode
output_config. format
MessagesOutputFormat · object | null
Structured output settings. Currently supports only json_schema .
output_config.format. type
Output format type. Set to json_schema to constrain output to a JSON schema.
Allowed value: "json_schema"
output_config.format. schema
JSON Schema object applied when type is json_schema .
cache_control
Cache Control · object | null
Compatibility field accepted for request portability. Parsed but not used for generation.
container
Container · object | null
Compatibility field accepted for request portability. Parsed but not used for generation.
context_manager
Context Manager · object | null
Compatibility field accepted for request portability. Parsed but not used for generation.
inference_geo
Inference Geo · object | null
Compatibility field accepted for request portability. Parsed but not used for generation.
Compatibility field accepted for request portability. Parsed but not used for generation.
service_tier
string Service Tier · object string Service Tier · object
Compatibility field accepted for request portability. Parsed but not used for generation.
Successfully generated a Messages-style response. For streaming (text/event-stream ) event and chunk details, see Messages chunk object .
Unique identifier for this message response.
Response object type (message ).
Allowed value: "message"
Role of the output message author (assistant ).
Allowed value: "assistant"
content
(Thinking · object | Text · object | Tool Use · object)[]
required
Assistant output blocks in generation order.
Allowed value: "thinking"
Reasoning content returned by the model.
Signature associated with the reasoning content.
usage
MessagesUsage · object
required
Token usage details for this response.
Number of billed input tokens for this request.
Required range: x >= 0
Number of billed output tokens generated by the model.
Required range: x >= 0
usage. cache_read_input_tokens
Number of input tokens served from cache, when cache reads are applicable.
Required range: x >= 0
Why generation stopped (end_turn , max_tokens , tool_use , stop_sequence ).
Available options:
end_turn,
max_tokens,
tool_use,
stop_sequence
Matched stop string when stop_reason is stop_sequence ; otherwise null.
Model used to generate the response.
Last modified on June 9, 2026