Generate Responses
curl --request POST \
--url https://api.nugen.in/api/v3/inference/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "model_01kmqm4nrn9fw6r",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"temperature": 1,
"top_p": 123,
"stream": true,
"metadata": {}
}
'import requests
url = "https://api.nugen.in/api/v3/inference/responses"
payload = {
"model": "model_01kmqm4nrn9fw6r",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"temperature": 1,
"top_p": 123,
"stream": True,
"metadata": {}
}
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({
model: 'model_01kmqm4nrn9fw6r',
input: '<string>',
instructions: '<string>',
max_output_tokens: 123,
temperature: 1,
top_p: 123,
stream: true,
metadata: {}
})
};
fetch('https://api.nugen.in/api/v3/inference/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://api.nugen.in/api/v3/inference/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([
'model' => 'model_01kmqm4nrn9fw6r',
'input' => '<string>',
'instructions' => '<string>',
'max_output_tokens' => 123,
'temperature' => 1,
'top_p' => 123,
'stream' => true,
'metadata' => [
]
]),
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://api.nugen.in/api/v3/inference/responses"
payload := strings.NewReader("{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\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://api.nugen.in/api/v3/inference/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/inference/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 \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_9f2c1a7b3d4e5f60718293a4",
"created_at": 123,
"model": "<string>",
"output": [
{
"content": [
{
"text": "<string>",
"type": "output_text"
}
],
"type": "message",
"role": "assistant"
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"object": "response"
}{
"detail": "Model not found"
}{
"detail": "Model not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."
}{
"detail": "Model not found"
}Inference
Generate Responses
OpenAI responses.create compatible endpoint.
Accepts the same shape as openai.responses.create and returns a Response object.
Request Body:
model: Model ID (required)input: User input — a plain string or array of{"role": "system"|"user"|"assistant", "content": ...}objectsinstructions(optional): System-level instructions (maps to a system message prepended toinput)max_output_tokens(optional): Maximum tokens to generatetemperature(optional): Sampling temperature 0–2 (default: 1.0)top_p(optional): Nucleus sampling parameterstream(optional): Stream partial output as SSE (default: true). Passingnullis treated astrue. Setstream: falsefor a single JSON response — the call must complete within the timeout or returns 504. For long generations, keep streaming on.
Example Request:
POST /api/v3/inference/responses
Headers: {"Authorization": "Bearer <api_key>"}
{
"model": "Qwen/Qwen2.5-0.5B-Instruct",
"input": "What is the capital of France?",
"instructions": "You are a helpful assistant.",
"max_output_tokens": 200,
"stream": false
}
Example Response:
{
"id": "resp_abc123",
"object": "response",
"created_at": 1704123600,
"model": "Qwen/Qwen2.5-0.5B-Instruct",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "The capital of France is Paris."}]
}
],
"usage": {"input_tokens": 18, "output_tokens": 9, "total_tokens": 27}
}
Example Streaming Request (stream: true):
{
"model": "Qwen/Qwen2.5-0.5B-Instruct",
"input": "Write a short poem about the sea.",
"stream": true
}
Streaming response (SSE):
data: {"type": "response.output_text.delta", "delta": "The sea is"}
data: {"type": "response.output_text.delta", "delta": " vast and deep,"}
data: {"type": "response.completed", "usage": {"input_tokens": 12, "output_tokens": 8, "total_tokens": 20}}
POST
/
api
/
v3
/
inference
/
responses
Generate Responses
curl --request POST \
--url https://api.nugen.in/api/v3/inference/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "model_01kmqm4nrn9fw6r",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"temperature": 1,
"top_p": 123,
"stream": true,
"metadata": {}
}
'import requests
url = "https://api.nugen.in/api/v3/inference/responses"
payload = {
"model": "model_01kmqm4nrn9fw6r",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"temperature": 1,
"top_p": 123,
"stream": True,
"metadata": {}
}
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({
model: 'model_01kmqm4nrn9fw6r',
input: '<string>',
instructions: '<string>',
max_output_tokens: 123,
temperature: 1,
top_p: 123,
stream: true,
metadata: {}
})
};
fetch('https://api.nugen.in/api/v3/inference/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://api.nugen.in/api/v3/inference/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([
'model' => 'model_01kmqm4nrn9fw6r',
'input' => '<string>',
'instructions' => '<string>',
'max_output_tokens' => 123,
'temperature' => 1,
'top_p' => 123,
'stream' => true,
'metadata' => [
]
]),
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://api.nugen.in/api/v3/inference/responses"
payload := strings.NewReader("{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\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://api.nugen.in/api/v3/inference/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/inference/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 \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_output_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 123,\n \"stream\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_9f2c1a7b3d4e5f60718293a4",
"created_at": 123,
"model": "<string>",
"output": [
{
"content": [
{
"text": "<string>",
"type": "output_text"
}
],
"type": "message",
"role": "assistant"
}
],
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"object": "response"
}{
"detail": "Model not found"
}{
"detail": "Model not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."
}{
"detail": "Model not found"
}Body
application/json
A request in the OpenAI Responses API compatible format.
Response
Successful Response
A response in the Responses format.
Was this page helpful?