Responses
Beta: This endpoint is currently in beta and may be unstable. Request/response schemas and behavior may change without notice. It is available to all API users.
Create a model response in OpenAI’s Responses API format. Works with every Venice text model and returns typed output items such as reasoning, message, and function_call. Set stream: true to receive Server-Sent Events.
Most OpenAI models are forwarded to OpenAI’s Responses API natively. Other models, and requests that use Venice features such as web search or characters, are translated through Chat Completions, where some Responses features are not supported. Send x-venice-responses-mode: native or compat to choose the mode, and read the x-venice-responses-lane response header to see which one served the request.
Venice does not store responses, so send the full conversation in input on every request. E2EE-capable models are not supported on this endpoint; use /api/v1/chat/completions with the required E2EE headers instead.
See the Responses API guide for the features and limitations of each mode.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.
curl --request POST \
--url https://api.venice.ai/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "zai-org-glm-5-1",
"input": "<string>",
"instructions": "<string>",
"include": [
"<string>"
],
"max_output_tokens": 1,
"temperature": 1,
"top_p": 0.5,
"fallbacks": [
{
"model": "claude-opus-4-8"
}
],
"reasoning": {
"enabled": true
},
"parallel_tool_calls": true,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true,
"defer_loading": true
},
"defer_loading": true
}
],
"tool_choice": "auto",
"web_search": true,
"stream": true,
"anon_user_id": "end-user-123",
"venice_parameters": {
"character_slug": "<string>",
"enable_e2ee": true,
"enable_web_scraping": true,
"enable_web_citations": true,
"include_venice_system_prompt": true,
"include_search_results_in_stream": true
}
}
'import requests
url = "https://api.venice.ai/api/v1/responses"
payload = {
"model": "zai-org-glm-5-1",
"input": "<string>",
"instructions": "<string>",
"include": ["<string>"],
"max_output_tokens": 1,
"temperature": 1,
"top_p": 0.5,
"fallbacks": [{ "model": "claude-opus-4-8" }],
"reasoning": { "enabled": True },
"parallel_tool_calls": True,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True,
"defer_loading": True
},
"defer_loading": True
}
],
"tool_choice": "auto",
"web_search": True,
"stream": True,
"anon_user_id": "end-user-123",
"venice_parameters": {
"character_slug": "<string>",
"enable_e2ee": True,
"enable_web_scraping": True,
"enable_web_citations": True,
"include_venice_system_prompt": True,
"include_search_results_in_stream": True
}
}
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: 'zai-org-glm-5-1',
input: '<string>',
instructions: '<string>',
include: ['<string>'],
max_output_tokens: 1,
temperature: 1,
top_p: 0.5,
fallbacks: [{model: 'claude-opus-4-8'}],
reasoning: {enabled: true},
parallel_tool_calls: true,
tools: [
{
type: 'function',
function: {
name: '<string>',
description: '<string>',
parameters: {},
strict: true,
defer_loading: true
},
defer_loading: true
}
],
tool_choice: 'auto',
web_search: true,
stream: true,
anon_user_id: 'end-user-123',
venice_parameters: {
character_slug: '<string>',
enable_e2ee: true,
enable_web_scraping: true,
enable_web_citations: true,
include_venice_system_prompt: true,
include_search_results_in_stream: true
}
})
};
fetch('https://api.venice.ai/api/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://api.venice.ai/api/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([
'model' => 'zai-org-glm-5-1',
'input' => '<string>',
'instructions' => '<string>',
'include' => [
'<string>'
],
'max_output_tokens' => 1,
'temperature' => 1,
'top_p' => 0.5,
'fallbacks' => [
[
'model' => 'claude-opus-4-8'
]
],
'reasoning' => [
'enabled' => true
],
'parallel_tool_calls' => true,
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true,
'defer_loading' => true
],
'defer_loading' => true
]
],
'tool_choice' => 'auto',
'web_search' => true,
'stream' => true,
'anon_user_id' => 'end-user-123',
'venice_parameters' => [
'character_slug' => '<string>',
'enable_e2ee' => true,
'enable_web_scraping' => true,
'enable_web_citations' => true,
'include_venice_system_prompt' => true,
'include_search_results_in_stream' => true
]
]),
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.venice.ai/api/v1/responses"
payload := strings.NewReader("{\n \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\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.venice.ai/api/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/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 \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_abc123",
"object": "response",
"created_at": 123,
"model": "<string>",
"status": "completed",
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
"<string>"
],
"encrypted_content": "<string>"
}
],
"incomplete_details": {
"reason": "max_output_tokens"
},
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens_details": {
"reasoning_tokens": 123
}
},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "This API key is restricted to configured IP addresses, and this request's source IP is not allowed"
}{
"error": "<string>"
}{
"error": "<string>"
}Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
Request body for the Responses API endpoint. E2EE-capable models are not supported on /api/v1/responses; use /api/v1/chat/completions with the required E2EE headers instead.
The ID of the model to use. E2EE-capable models are not supported on /api/v1/responses; use /api/v1/chat/completions with the required E2EE headers instead.
"zai-org-glm-5-1"
The input to generate a response for. Can be a simple string or an array of messages.
System instructions for the model, applied before input.
Additional response fields to include (OpenAI-compatible).
Maximum number of tokens to generate.
x > 0Sampling temperature between 0 and 2.
0 <= x <= 2Nucleus sampling parameter.
0 <= x <= 1Anthropic beta parameter for Claude Fable 5 server-side refusal fallback. Forwarded only for direct Anthropic routes; ignored for other providers.
10Show child attributes
Show child attributes
[{ "model": "claude-opus-4-8" }]
Reasoning controls for models that support reasoning.
Show child attributes
Show child attributes
Whether the model may call more than one tool in a single turn.
A list of tools the model may call.
- Function Tool
- Tool Definition
- Web Search Tool
- X Search Tool
- Code Interpreter Tool
- File Search Tool
- Computer Use Tool
- Generic Tool
Show child attributes
Show child attributes
Controls which tool is called by the model.
auto Enable web search for this request.
Whether to stream back partial progress.
Optional identifier for the API customer's end user. Combined with the Venice user id when attributing the request to upstream providers. Distinct from the discarded OpenAI user field. Must be printable ASCII and must not contain ||.
1 - 128^[\x20-\x7E]+$"end-user-123"
Venice-specific options, such as web search, characters, and the Venice system prompt.
Show child attributes
Show child attributes
Risposta
Successful response
Response from the Responses API endpoint.
Unique identifier for the response.
"resp_abc123"
The object type.
response Unix timestamp of when the response was created.
The model used for the response.
The status of the response.
completed, failed, in_progress, cancelled, incomplete The output items generated by the model.
- Reasoning Output
- Message Output
- Function Call Output
- Option 4
- Option 5
- Web Search Call Output
Show child attributes
Show child attributes
Why generation ended before completion; partial output and usage are retained.
Show child attributes
Show child attributes
Token usage statistics.
Show child attributes
Show child attributes
Error information if the response failed.
Show child attributes
Show child attributes
Questa pagina è stata utile?
curl --request POST \
--url https://api.venice.ai/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "zai-org-glm-5-1",
"input": "<string>",
"instructions": "<string>",
"include": [
"<string>"
],
"max_output_tokens": 1,
"temperature": 1,
"top_p": 0.5,
"fallbacks": [
{
"model": "claude-opus-4-8"
}
],
"reasoning": {
"enabled": true
},
"parallel_tool_calls": true,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true,
"defer_loading": true
},
"defer_loading": true
}
],
"tool_choice": "auto",
"web_search": true,
"stream": true,
"anon_user_id": "end-user-123",
"venice_parameters": {
"character_slug": "<string>",
"enable_e2ee": true,
"enable_web_scraping": true,
"enable_web_citations": true,
"include_venice_system_prompt": true,
"include_search_results_in_stream": true
}
}
'import requests
url = "https://api.venice.ai/api/v1/responses"
payload = {
"model": "zai-org-glm-5-1",
"input": "<string>",
"instructions": "<string>",
"include": ["<string>"],
"max_output_tokens": 1,
"temperature": 1,
"top_p": 0.5,
"fallbacks": [{ "model": "claude-opus-4-8" }],
"reasoning": { "enabled": True },
"parallel_tool_calls": True,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True,
"defer_loading": True
},
"defer_loading": True
}
],
"tool_choice": "auto",
"web_search": True,
"stream": True,
"anon_user_id": "end-user-123",
"venice_parameters": {
"character_slug": "<string>",
"enable_e2ee": True,
"enable_web_scraping": True,
"enable_web_citations": True,
"include_venice_system_prompt": True,
"include_search_results_in_stream": True
}
}
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: 'zai-org-glm-5-1',
input: '<string>',
instructions: '<string>',
include: ['<string>'],
max_output_tokens: 1,
temperature: 1,
top_p: 0.5,
fallbacks: [{model: 'claude-opus-4-8'}],
reasoning: {enabled: true},
parallel_tool_calls: true,
tools: [
{
type: 'function',
function: {
name: '<string>',
description: '<string>',
parameters: {},
strict: true,
defer_loading: true
},
defer_loading: true
}
],
tool_choice: 'auto',
web_search: true,
stream: true,
anon_user_id: 'end-user-123',
venice_parameters: {
character_slug: '<string>',
enable_e2ee: true,
enable_web_scraping: true,
enable_web_citations: true,
include_venice_system_prompt: true,
include_search_results_in_stream: true
}
})
};
fetch('https://api.venice.ai/api/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://api.venice.ai/api/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([
'model' => 'zai-org-glm-5-1',
'input' => '<string>',
'instructions' => '<string>',
'include' => [
'<string>'
],
'max_output_tokens' => 1,
'temperature' => 1,
'top_p' => 0.5,
'fallbacks' => [
[
'model' => 'claude-opus-4-8'
]
],
'reasoning' => [
'enabled' => true
],
'parallel_tool_calls' => true,
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true,
'defer_loading' => true
],
'defer_loading' => true
]
],
'tool_choice' => 'auto',
'web_search' => true,
'stream' => true,
'anon_user_id' => 'end-user-123',
'venice_parameters' => [
'character_slug' => '<string>',
'enable_e2ee' => true,
'enable_web_scraping' => true,
'enable_web_citations' => true,
'include_venice_system_prompt' => true,
'include_search_results_in_stream' => true
]
]),
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.venice.ai/api/v1/responses"
payload := strings.NewReader("{\n \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\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.venice.ai/api/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/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 \"model\": \"zai-org-glm-5-1\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"max_output_tokens\": 1,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"fallbacks\": [\n {\n \"model\": \"claude-opus-4-8\"\n }\n ],\n \"reasoning\": {\n \"enabled\": true\n },\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"defer_loading\": true\n },\n \"defer_loading\": true\n }\n ],\n \"tool_choice\": \"auto\",\n \"web_search\": true,\n \"stream\": true,\n \"anon_user_id\": \"end-user-123\",\n \"venice_parameters\": {\n \"character_slug\": \"<string>\",\n \"enable_e2ee\": true,\n \"enable_web_scraping\": true,\n \"enable_web_citations\": true,\n \"include_venice_system_prompt\": true,\n \"include_search_results_in_stream\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_abc123",
"object": "response",
"created_at": 123,
"model": "<string>",
"status": "completed",
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
"<string>"
],
"encrypted_content": "<string>"
}
],
"incomplete_details": {
"reason": "max_output_tokens"
},
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens_details": {
"reasoning_tokens": 123
}
},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "This API key is restricted to configured IP addresses, and this request's source IP is not allowed"
}{
"error": "<string>"
}{
"error": "<string>"
}