Skip to main content
POST
cURL

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

Model ID to run inference against (for example zai-org/GLM-5.3, zai-org/GLM-5.3-Flash, zai-org/GLM-5.2, or deepseek-ai/DeepSeek-V4.1-Flash-1017), or a dedicated endpoint name when calling https://api-inference.together.ai/v1/responses.

Example:

"zai-org/GLM-5.3"

input
required

A prompt string or an array of input items representing the full conversation history. Because requests are stateless, include prior user messages, model output items, and any tool outputs on each follow-up request.

Example:

"Explain what a mixture-of-experts model is in two sentences."

instructions
string | null

System-level instructions inserted before the conversation input.

Example:

"Answer concisely."

max_output_tokens
integer | null

Upper bound on the number of generated tokens, including reasoning tokens.

Required range: x >= 1
Example:

1024

temperature
number<float> | null

Sampling temperature between 0 and 2. Higher values increase randomness.

Required range: 0 <= x <= 2
Example:

1

top_p
number<float> | null

Nucleus sampling threshold between 0 and 1.

Required range: 0 <= x <= 1
Example:

1

stream
boolean
default:false

When true, streams Server-Sent Events (text/event-stream) as output items are generated instead of returning a single JSON response.

tools
object[]

Client-executed tools the model may call. Hosted server-side tools (such as file_search, code_interpreter, image_generation, computer_use_preview, and remote mcp URLs) are not supported.

A tool definition available to the model.

tool_choice

Controls whether and which tool the model calls (auto, required, none, or a specific named function).

Available options:
auto,
required,
none
parallel_tool_calls
boolean
default:true

Whether the model may emit multiple tool calls in a single response turn.

text
object

Controls the format and verbosity of generated text output.

reasoning
object

Reasoning configuration for reasoning-capable models. Exact effort behavior depends on the selected model's chat template.

include
enum<string>[]

Additional fields to include in the response output. Passing reasoning.encrypted_content returns a base64-encoded copy of the reasoning text on reasoning items for stateless multi-turn replay (not encrypted).

Available options:
reasoning.encrypted_content
prompt_cache_key
string | null

Stable routing key (such as a conversation or session ID) used to route related requests together and improve automatic prefix cache hit rates.

frequency_penalty
number<float> | null

Penalty applied to tokens based on their existing frequency in the generated text.

Required range: -2 <= x <= 2
presence_penalty
number<float> | null

Penalty applied to tokens that have already appeared in the generated text.

Required range: -2 <= x <= 2
top_logprobs
integer | null

Number of most likely tokens to return log probabilities for at each position.

Required range: 0 <= x <= 20
truncation
enum<string>
default:disabled

Context truncation strategy when input approaches the model context window.

Available options:
disabled,
auto
metadata
object | null

Up to 16 string key-value pairs echoed back on the response object.

store
boolean
default:false

Accepted for OpenAI SDK compatibility. Together serves Responses statelessly and does not persist responses even when store is true.

Response

OK

id
string
required

Unique identifier for the response.

Example:

"resp_01a24252-8fc2-7322-9779-7a1a0d217dcb"

object
string
required

Object type, always response.

Allowed value: "response"
created_at
integer
required

Unix timestamp (in seconds) when the response was created.

status
enum<string>
required

Terminal or in-progress status of the response.

Available options:
completed,
incomplete,
failed,
in_progress,
queued,
cancelled
model
string
required

Model ID that generated the response.

output
object[]
required

Ordered list of output items generated by the model (reasoning, messages, and tool calls).

An output item generated by the model.

completed_at
integer | null

Unix timestamp (in seconds) when the response completed.

error
object | null

Error object populated when status is failed.

incomplete_details
object | null

Details explaining why a response ended with status set to incomplete (for example max_output_tokens).

instructions
string | null

System instructions echoed from the request, if provided.

max_output_tokens
integer | null

Maximum output token limit echoed from the request.

parallel_tool_calls
boolean

Whether parallel tool calls were enabled.

reasoning
object

Reasoning configuration for reasoning-capable models. Exact effort behavior depends on the selected model's chat template.

temperature
number<float> | null
top_p
number<float> | null
text
object

Controls the format and verbosity of generated text output.

tool_choice

Controls whether and which tool the model calls (auto, required, none, or a specific named function).

Available options:
auto,
required,
none
tools
object[]

A tool definition available to the model.

truncation
string | null
store
boolean

Always stateless on Together; responses are not stored server-side.

background
boolean

Always false on Together; background execution is not supported.

usage
object | null
metadata
object | null
prompt_cache_key
string | null
service_tier
string | null
frequency_penalty
number<float> | null
presence_penalty
number<float> | null
top_logprobs
integer | null