curl --request POST \
--url https://inference.api.nscale.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"background": false,
"include": [],
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": true,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"effort": "medium",
"mode": "<string>"
},
"include_reasoning": true,
"service_tier": "auto",
"store": true,
"stream": false,
"temperature": 123,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"min_p": 123,
"truncation": "disabled",
"user": "<string>",
"skip_special_tokens": true,
"include_stop_str_in_output": false,
"presence_penalty": 0,
"frequency_penalty": 0,
"prompt_cache_key": "<string>",
"watermarking": true,
"request_id": "<string>",
"session_id": "<string>",
"media_io_kwargs": {},
"mm_processor_kwargs": {},
"priority": 0,
"cache_salt": "<string>",
"enable_response_messages": false,
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": [
"<string>"
],
"grammar": "<string>",
"json_object": true,
"disable_any_whitespace": false,
"disable_additional_properties": false,
"whitespace_pattern": "<string>",
"structural_tag": "<string>"
},
"repetition_penalty": 123,
"seed": 0,
"stop": [],
"stop_token_ids": [],
"ignore_eos": false,
"vllm_xargs": {},
"chat_template_kwargs": {}
}
'import requests
url = "https://inference.api.nscale.com/v1/responses"
payload = {
"input": "<string>",
"model": "<string>",
"background": False,
"include": [],
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": True,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"effort": "medium",
"mode": "<string>"
},
"include_reasoning": True,
"service_tier": "auto",
"store": True,
"stream": False,
"temperature": 123,
"text": {
"format": { "type": "text" },
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"min_p": 123,
"truncation": "disabled",
"user": "<string>",
"skip_special_tokens": True,
"include_stop_str_in_output": False,
"presence_penalty": 0,
"frequency_penalty": 0,
"prompt_cache_key": "<string>",
"watermarking": True,
"request_id": "<string>",
"session_id": "<string>",
"media_io_kwargs": {},
"mm_processor_kwargs": {},
"priority": 0,
"cache_salt": "<string>",
"enable_response_messages": False,
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": ["<string>"],
"grammar": "<string>",
"json_object": True,
"disable_any_whitespace": False,
"disable_additional_properties": False,
"whitespace_pattern": "<string>",
"structural_tag": "<string>"
},
"repetition_penalty": 123,
"seed": 0,
"stop": [],
"stop_token_ids": [],
"ignore_eos": False,
"vllm_xargs": {},
"chat_template_kwargs": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
model: '<string>',
background: false,
include: [],
instructions: '<string>',
max_output_tokens: 123,
max_tool_calls: 123,
metadata: {},
logit_bias: {},
parallel_tool_calls: true,
previous_response_id: '<string>',
prompt: {id: '<string>', variables: {}, version: '<string>'},
reasoning: {effort: 'medium', mode: '<string>'},
include_reasoning: true,
service_tier: 'auto',
store: true,
stream: false,
temperature: 123,
text: {format: {type: 'text'}, verbosity: 'medium'},
tool_choice: 'auto',
tools: [],
top_logprobs: 0,
top_p: 123,
top_k: 123,
min_p: 123,
truncation: 'disabled',
user: '<string>',
skip_special_tokens: true,
include_stop_str_in_output: false,
presence_penalty: 0,
frequency_penalty: 0,
prompt_cache_key: '<string>',
watermarking: true,
request_id: '<string>',
session_id: '<string>',
media_io_kwargs: {},
mm_processor_kwargs: {},
priority: 0,
cache_salt: '<string>',
enable_response_messages: false,
structured_outputs: {
json: '<string>',
regex: '<string>',
choice: ['<string>'],
grammar: '<string>',
json_object: true,
disable_any_whitespace: false,
disable_additional_properties: false,
whitespace_pattern: '<string>',
structural_tag: '<string>'
},
repetition_penalty: 123,
seed: 0,
stop: [],
stop_token_ids: [],
ignore_eos: false,
vllm_xargs: {},
chat_template_kwargs: {}
})
};
fetch('https://inference.api.nscale.com/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inference.api.nscale.com/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>',
'model' => '<string>',
'background' => false,
'include' => [
],
'instructions' => '<string>',
'max_output_tokens' => 123,
'max_tool_calls' => 123,
'metadata' => [
],
'logit_bias' => [
],
'parallel_tool_calls' => true,
'previous_response_id' => '<string>',
'prompt' => [
'id' => '<string>',
'variables' => [
],
'version' => '<string>'
],
'reasoning' => [
'effort' => 'medium',
'mode' => '<string>'
],
'include_reasoning' => true,
'service_tier' => 'auto',
'store' => true,
'stream' => false,
'temperature' => 123,
'text' => [
'format' => [
'type' => 'text'
],
'verbosity' => 'medium'
],
'tool_choice' => 'auto',
'tools' => [
],
'top_logprobs' => 0,
'top_p' => 123,
'top_k' => 123,
'min_p' => 123,
'truncation' => 'disabled',
'user' => '<string>',
'skip_special_tokens' => true,
'include_stop_str_in_output' => false,
'presence_penalty' => 0,
'frequency_penalty' => 0,
'prompt_cache_key' => '<string>',
'watermarking' => true,
'request_id' => '<string>',
'session_id' => '<string>',
'media_io_kwargs' => [
],
'mm_processor_kwargs' => [
],
'priority' => 0,
'cache_salt' => '<string>',
'enable_response_messages' => false,
'structured_outputs' => [
'json' => '<string>',
'regex' => '<string>',
'choice' => [
'<string>'
],
'grammar' => '<string>',
'json_object' => true,
'disable_any_whitespace' => false,
'disable_additional_properties' => false,
'whitespace_pattern' => '<string>',
'structural_tag' => '<string>'
],
'repetition_penalty' => 123,
'seed' => 0,
'stop' => [
],
'stop_token_ids' => [
],
'ignore_eos' => false,
'vllm_xargs' => [
],
'chat_template_kwargs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inference.api.nscale.com/v1/responses"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inference.api.nscale.com/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.api.nscale.com/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "response",
"output": [
{
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "file_citation"
}
],
"text": "<string>",
"type": "output_text",
"logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>",
"top_logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
]
}
]
}
],
"id": "<string>",
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"temperature": 123,
"tool_choice": "none",
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": true,
"type": "function",
"allowed_callers": [
"direct"
],
"async": true,
"defer_loading": true,
"description": "<string>",
"output_schema": {}
}
],
"top_p": 123,
"background": true,
"max_output_tokens": 123,
"service_tier": "auto",
"status": "completed",
"truncation": "auto",
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "<string>",
"metadata": {},
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"context": "auto",
"effort": "medium",
"generate_summary": "auto",
"mode": "<string>",
"summary": "auto"
},
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 123,
"input_tokens_per_turn": [],
"cached_tokens_per_turn": []
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 0,
"tool_output_tokens": 0,
"output_tokens_per_turn": [],
"tool_output_tokens_per_turn": []
},
"total_tokens": 123
},
"user": "<string>",
"metrics": {
"time_to_first_token_ms": 123,
"generation_time_ms": 123,
"queue_time_ms": 123,
"mean_itl_ms": 123,
"tokens_per_second": 123,
"speculative_decoding": {
"mean_acceptance_length": 123,
"draft_acceptance_rate": 123,
"acceptance_histogram": [
123
],
"num_spec_steps": 123,
"num_accepted_draft_tokens": 123,
"num_draft_tokens": 123,
"num_spec_tokens": 123,
"per_step_accepted": [
123
],
"per_step_drafted": [
123
]
}
},
"presence_penalty": 0,
"frequency_penalty": 0,
"input_messages": [
{
"content": "<string>",
"role": "developer",
"name": "<string>"
}
],
"output_messages": [
{
"content": "<string>",
"role": "developer",
"name": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Create a response
Creates a model response. Tool and background-processing support depend on the selected model. Response retrieval, deletion, cancellation and input-item endpoints are not available in this API.
curl --request POST \
--url https://inference.api.nscale.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"background": false,
"include": [],
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": true,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"effort": "medium",
"mode": "<string>"
},
"include_reasoning": true,
"service_tier": "auto",
"store": true,
"stream": false,
"temperature": 123,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"min_p": 123,
"truncation": "disabled",
"user": "<string>",
"skip_special_tokens": true,
"include_stop_str_in_output": false,
"presence_penalty": 0,
"frequency_penalty": 0,
"prompt_cache_key": "<string>",
"watermarking": true,
"request_id": "<string>",
"session_id": "<string>",
"media_io_kwargs": {},
"mm_processor_kwargs": {},
"priority": 0,
"cache_salt": "<string>",
"enable_response_messages": false,
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": [
"<string>"
],
"grammar": "<string>",
"json_object": true,
"disable_any_whitespace": false,
"disable_additional_properties": false,
"whitespace_pattern": "<string>",
"structural_tag": "<string>"
},
"repetition_penalty": 123,
"seed": 0,
"stop": [],
"stop_token_ids": [],
"ignore_eos": false,
"vllm_xargs": {},
"chat_template_kwargs": {}
}
'import requests
url = "https://inference.api.nscale.com/v1/responses"
payload = {
"input": "<string>",
"model": "<string>",
"background": False,
"include": [],
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": True,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"effort": "medium",
"mode": "<string>"
},
"include_reasoning": True,
"service_tier": "auto",
"store": True,
"stream": False,
"temperature": 123,
"text": {
"format": { "type": "text" },
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"min_p": 123,
"truncation": "disabled",
"user": "<string>",
"skip_special_tokens": True,
"include_stop_str_in_output": False,
"presence_penalty": 0,
"frequency_penalty": 0,
"prompt_cache_key": "<string>",
"watermarking": True,
"request_id": "<string>",
"session_id": "<string>",
"media_io_kwargs": {},
"mm_processor_kwargs": {},
"priority": 0,
"cache_salt": "<string>",
"enable_response_messages": False,
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": ["<string>"],
"grammar": "<string>",
"json_object": True,
"disable_any_whitespace": False,
"disable_additional_properties": False,
"whitespace_pattern": "<string>",
"structural_tag": "<string>"
},
"repetition_penalty": 123,
"seed": 0,
"stop": [],
"stop_token_ids": [],
"ignore_eos": False,
"vllm_xargs": {},
"chat_template_kwargs": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
model: '<string>',
background: false,
include: [],
instructions: '<string>',
max_output_tokens: 123,
max_tool_calls: 123,
metadata: {},
logit_bias: {},
parallel_tool_calls: true,
previous_response_id: '<string>',
prompt: {id: '<string>', variables: {}, version: '<string>'},
reasoning: {effort: 'medium', mode: '<string>'},
include_reasoning: true,
service_tier: 'auto',
store: true,
stream: false,
temperature: 123,
text: {format: {type: 'text'}, verbosity: 'medium'},
tool_choice: 'auto',
tools: [],
top_logprobs: 0,
top_p: 123,
top_k: 123,
min_p: 123,
truncation: 'disabled',
user: '<string>',
skip_special_tokens: true,
include_stop_str_in_output: false,
presence_penalty: 0,
frequency_penalty: 0,
prompt_cache_key: '<string>',
watermarking: true,
request_id: '<string>',
session_id: '<string>',
media_io_kwargs: {},
mm_processor_kwargs: {},
priority: 0,
cache_salt: '<string>',
enable_response_messages: false,
structured_outputs: {
json: '<string>',
regex: '<string>',
choice: ['<string>'],
grammar: '<string>',
json_object: true,
disable_any_whitespace: false,
disable_additional_properties: false,
whitespace_pattern: '<string>',
structural_tag: '<string>'
},
repetition_penalty: 123,
seed: 0,
stop: [],
stop_token_ids: [],
ignore_eos: false,
vllm_xargs: {},
chat_template_kwargs: {}
})
};
fetch('https://inference.api.nscale.com/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inference.api.nscale.com/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>',
'model' => '<string>',
'background' => false,
'include' => [
],
'instructions' => '<string>',
'max_output_tokens' => 123,
'max_tool_calls' => 123,
'metadata' => [
],
'logit_bias' => [
],
'parallel_tool_calls' => true,
'previous_response_id' => '<string>',
'prompt' => [
'id' => '<string>',
'variables' => [
],
'version' => '<string>'
],
'reasoning' => [
'effort' => 'medium',
'mode' => '<string>'
],
'include_reasoning' => true,
'service_tier' => 'auto',
'store' => true,
'stream' => false,
'temperature' => 123,
'text' => [
'format' => [
'type' => 'text'
],
'verbosity' => 'medium'
],
'tool_choice' => 'auto',
'tools' => [
],
'top_logprobs' => 0,
'top_p' => 123,
'top_k' => 123,
'min_p' => 123,
'truncation' => 'disabled',
'user' => '<string>',
'skip_special_tokens' => true,
'include_stop_str_in_output' => false,
'presence_penalty' => 0,
'frequency_penalty' => 0,
'prompt_cache_key' => '<string>',
'watermarking' => true,
'request_id' => '<string>',
'session_id' => '<string>',
'media_io_kwargs' => [
],
'mm_processor_kwargs' => [
],
'priority' => 0,
'cache_salt' => '<string>',
'enable_response_messages' => false,
'structured_outputs' => [
'json' => '<string>',
'regex' => '<string>',
'choice' => [
'<string>'
],
'grammar' => '<string>',
'json_object' => true,
'disable_any_whitespace' => false,
'disable_additional_properties' => false,
'whitespace_pattern' => '<string>',
'structural_tag' => '<string>'
],
'repetition_penalty' => 123,
'seed' => 0,
'stop' => [
],
'stop_token_ids' => [
],
'ignore_eos' => false,
'vllm_xargs' => [
],
'chat_template_kwargs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inference.api.nscale.com/v1/responses"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inference.api.nscale.com/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.api.nscale.com/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"metadata\": {},\n \"logit_bias\": {},\n \"parallel_tool_calls\": true,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"reasoning\": {\n \"effort\": \"medium\",\n \"mode\": \"<string>\"\n },\n \"include_reasoning\": true,\n \"service_tier\": \"auto\",\n \"store\": true,\n \"stream\": false,\n \"temperature\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 123,\n \"top_k\": 123,\n \"min_p\": 123,\n \"truncation\": \"disabled\",\n \"user\": \"<string>\",\n \"skip_special_tokens\": true,\n \"include_stop_str_in_output\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"prompt_cache_key\": \"<string>\",\n \"watermarking\": true,\n \"request_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"media_io_kwargs\": {},\n \"mm_processor_kwargs\": {},\n \"priority\": 0,\n \"cache_salt\": \"<string>\",\n \"enable_response_messages\": false,\n \"structured_outputs\": {\n \"json\": \"<string>\",\n \"regex\": \"<string>\",\n \"choice\": [\n \"<string>\"\n ],\n \"grammar\": \"<string>\",\n \"json_object\": true,\n \"disable_any_whitespace\": false,\n \"disable_additional_properties\": false,\n \"whitespace_pattern\": \"<string>\",\n \"structural_tag\": \"<string>\"\n },\n \"repetition_penalty\": 123,\n \"seed\": 0,\n \"stop\": [],\n \"stop_token_ids\": [],\n \"ignore_eos\": false,\n \"vllm_xargs\": {},\n \"chat_template_kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "response",
"output": [
{
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "file_citation"
}
],
"text": "<string>",
"type": "output_text",
"logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>",
"top_logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
]
}
]
}
],
"id": "<string>",
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"temperature": 123,
"tool_choice": "none",
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": true,
"type": "function",
"allowed_callers": [
"direct"
],
"async": true,
"defer_loading": true,
"description": "<string>",
"output_schema": {}
}
],
"top_p": 123,
"background": true,
"max_output_tokens": 123,
"service_tier": "auto",
"status": "completed",
"truncation": "auto",
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "<string>",
"metadata": {},
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"reasoning": {
"context": "auto",
"effort": "medium",
"generate_summary": "auto",
"mode": "<string>",
"summary": "auto"
},
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 123,
"input_tokens_per_turn": [],
"cached_tokens_per_turn": []
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 0,
"tool_output_tokens": 0,
"output_tokens_per_turn": [],
"tool_output_tokens_per_turn": []
},
"total_tokens": 123
},
"user": "<string>",
"metrics": {
"time_to_first_token_ms": 123,
"generation_time_ms": 123,
"queue_time_ms": 123,
"mean_itl_ms": 123,
"tokens_per_second": 123,
"speculative_decoding": {
"mean_acceptance_length": 123,
"draft_acceptance_rate": 123,
"acceptance_histogram": [
123
],
"num_spec_steps": 123,
"num_accepted_draft_tokens": 123,
"num_draft_tokens": 123,
"num_spec_tokens": 123,
"per_step_accepted": [
123
],
"per_step_drafted": [
123
]
}
},
"presence_penalty": 0,
"frequency_penalty": 0,
"input_messages": [
{
"content": "<string>",
"role": "developer",
"name": "<string>"
}
],
"output_messages": [
{
"content": "<string>",
"role": "developer",
"name": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Authorizations
Headers
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.
1Body
Show child attributes
Show child attributes
- Function
- File search
- Computer
- Computer use preview
- Web search
- MCP tool
- Code interpreter
- Option 8
- Image generation tool
- Local shell tool
- Shell tool
- Custom tool
- Namespace
- Tool search tool
- Web search preview
- Apply patch tool
Show child attributes
Show child attributes
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).
1 - 1024Response
Successful inference. Feature availability depends on the selected model.
- Output message
- File search tool call
- Function tool call
- Function tool call output
- Web search tool call
- Computer tool call
- Computer tool call output
- Reasoning
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Compaction item
- Image generation call
- Code interpreter tool call
- Local shell call
- Local shell call output
- Shell tool call
- Shell call output
- Apply patch tool call
- Apply patch tool call output
- MCP tool call
- MCP list tools
- MCP approval request
- MCP approval response
- Custom tool call
- ResponseCustomToolCallOutputItem
Show child attributes
Show child attributes
- Function
- File search
- Computer
- Computer use preview
- Web search
- MCP tool
- Code interpreter
- Option 8
- Image generation tool
- Local shell tool
- Shell tool
- Custom tool
- Namespace
- Tool search tool
- Web search preview
- Apply patch tool
Show child attributes
Show child attributes
If enable_response_messages, we can show raw token input to model.
- Developer message
- System message
- User message
- Assistant message
- Tool message
- Function message
Show child attributes
Show child attributes
If enable_response_messages, we can show raw token output of model.
- Developer message
- System message
- User message
- Assistant message
- Tool message
- Function message
Show child attributes
Show child attributes
Was this page helpful?