Skip to main content
POST
Create a response

Authorizations

Authorization
string
header
required

Nscale bearer token supplied in the Authorization header.

Headers

X-Organization-Id
string

Selects the caller's public-cloud organization. Required when the caller belongs to multiple public-cloud organizations and the URL does not select an organization; omission then returns 400. With one public-cloud organization, omission selects it automatically. An explicitly supplied value, including an empty value, that is not one of the caller's public-cloud organizations returns 403. On /organizations/{organization_id}/endpoints, the path organization_id takes precedence over this header.

Minimum string length: 1
X-Request-Id
string

Optional correlation identifier. Use the X-Request-Id returned in the response when contacting support. The response ID may differ from this value. Supplying this header does not make a request idempotent.

Body

application/json
input
required
model
string
required

Model ID from GET /v1/models. Capabilities depend on the selected model.

Minimum string length: 1
background
boolean | null
default:false
include
enum<string>[] | null
Available options:
code_interpreter_call.outputs,
computer_call_output.output.image_url,
file_search_call.results,
message.input_image.image_url,
message.output_text.logprobs,
reasoning.encrypted_content
instructions
string | null
max_output_tokens
integer | null
max_tool_calls
integer | null
metadata
object · null · null
logit_bias
object | null
parallel_tool_calls
boolean | null
default:true
previous_response_id
string | null
prompt
object · null · null
reasoning
Reasoning · object · null · null
include_reasoning
boolean
default:true

Whether to include reasoning content in the response. When false, reasoning tokens are still generated but excluded from the output. This reduces network traffic without affecting model inference.

service_tier
enum<string>
default:auto
Available options:
auto,
default,
flex,
scale,
priority
store
boolean | null
default:true
stream
boolean | null
default:false
temperature
number | null
text
object | null
tool_choice
default:auto
Available options:
none,
auto,
required
tools
(Function · object | File search · object | Computer · object | Computer use preview · object | Web search · object | MCP tool · object | Code interpreter · object | object | Image generation tool · object | Local shell tool · object | Shell tool · object | Custom tool · object | Namespace · object | Tool search tool · object | Web search preview · object | Apply patch tool · object)[]
top_logprobs
integer | null
default:0
top_p
number | null
top_k
integer | null
min_p
number | null
truncation
enum<string> | null
default:disabled
Available options:
auto,
disabled
user
string | null
skip_special_tokens
boolean
default:true
include_stop_str_in_output
boolean
default:false
presence_penalty
number

The presence penalty that was used to penalize new tokens based on whether they appear in the text so far.

Required range: -2 <= x <= 2
frequency_penalty
number

The frequency penalty that was used to penalize new tokens based on their frequency in the text so far.

Required range: -2 <= x <= 2
prompt_cache_key
string | null

Accepted for compatibility; currently ignored.

watermarking
boolean | null
request_id
string

Identifier for the generation request. Generated when omitted. This is separate from the X-Request-Id HTTP correlation header.

session_id
string | null

Stable session identity shared by related requests. Unlike request_id, this value is expected to remain stable across multiple requests in the same conversation or agent session.

media_io_kwargs
object | null

Model-specific options for reading image, audio and video inputs, keyed by modality.

mm_processor_kwargs
object | null

Model-specific options for processing image, audio and video inputs.

priority
integer
default:0

Scheduling priority; lower values are handled first. Non-zero priorities require support from the selected model.

Required range: -9223372036854776000 <= x <= 9223372036854776000
cache_salt
string

If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit).

Required string length: 1 - 1024
enable_response_messages
boolean
default:false

Dictates whether or not to return messages as part of the response object. Currently only supported for non-background.

structured_outputs
object | null

Additional kwargs for structured outputs

repetition_penalty
number | null
seed
integer
Required range: -9223372036854776000 <= x <= 9223372036854776000
stop
default:[]
stop_token_ids
integer[] | null
ignore_eos
boolean
default:false
vllm_xargs
object | null

Additional request parameters with (list of) string or numeric values, used by custom extensions.

chat_template_kwargs
object | null

Additional keyword args to pass to the chat template renderer. Will be accessible by the template.

Response

Successful inference. Feature availability depends on the selected model.

id
string
required
created_at
integer
required
model
string
required
object
enum<string>
default:response
required
Available options:
response
output
Output message · object · File search tool call · object · Function tool call · object · Function tool call output · object · Web search tool call · object · Computer tool call · object · Computer tool call output · object · Reasoning · object · object · object · object · object · object · Compaction item · object · Image generation call · object · Code interpreter tool call · object · Local shell call · object · Local shell call output · object · Shell tool call · object · Shell call output · object · Apply patch tool call · object · Apply patch tool call output · object · MCP tool call · object · MCP list tools · object · MCP approval request · object · MCP approval response · object · Custom tool call · object · ResponseCustomToolCallOutputItem · object[]
required
parallel_tool_calls
boolean
required
temperature
number
required
tool_choice
required
Available options:
none,
auto,
required
tools
(Function · object | File search · object | Computer · object | Computer use preview · object | Web search · object | MCP tool · object | Code interpreter · object | object | Image generation tool · object | Local shell tool · object | Shell tool · object | Custom tool · object | Namespace · object | Tool search tool · object | Web search preview · object | Apply patch tool · object)[]
required
top_p
number
required
background
boolean
required
max_output_tokens
integer
required
service_tier
enum<string>
required
Available options:
auto,
default,
flex,
scale,
priority
status
enum<string>
required
Available options:
completed,
failed,
in_progress,
cancelled,
queued,
incomplete
truncation
enum<string>
required
Available options:
auto,
disabled
incomplete_details
object · null · null
instructions
string | null
metadata
object · null · null
max_tool_calls
integer | null
previous_response_id
string | null
prompt
object · null · null
reasoning
Reasoning · object · null · null
text
object | null
top_logprobs
integer | null
usage
object | null
user
string | null
metrics
object | null
presence_penalty
number

The presence penalty that was used to penalize new tokens based on whether they appear in the text so far.

Required range: -2 <= x <= 2
frequency_penalty
number

The frequency penalty that was used to penalize new tokens based on their frequency in the text so far.

Required range: -2 <= x <= 2
input_messages

If enable_response_messages, we can show raw token input to model.

output_messages

If enable_response_messages, we can show raw token output of model.