Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --request POST \ --url https://aigw.portkey.ai/v1/responses \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "input": "<string>", "metadata": {}, "temperature": 1, "top_p": 1, "user": "<string>", "previous_response_id": "<string>", "reasoning": { "effort": "medium" }, "max_output_tokens": 123, "instructions": "<string>", "text": { "format": { "type": "text" } }, "tools": [ { "type": "file_search", "vector_store_ids": [ "<string>" ], "max_num_results": 123, "filters": { "type": "eq", "key": "<string>", "value": "<string>" }, "ranking_options": { "ranker": "auto", "score_threshold": 0 } } ], "truncation": "disabled", "include": [], "parallel_tool_calls": true, "store": true, "stream": false } '
import requests url = "https://aigw.portkey.ai/v1/responses" payload = { "input": "<string>", "metadata": {}, "temperature": 1, "top_p": 1, "user": "<string>", "previous_response_id": "<string>", "reasoning": { "effort": "medium" }, "max_output_tokens": 123, "instructions": "<string>", "text": { "format": { "type": "text" } }, "tools": [ { "type": "file_search", "vector_store_ids": ["<string>"], "max_num_results": 123, "filters": { "type": "eq", "key": "<string>", "value": "<string>" }, "ranking_options": { "ranker": "auto", "score_threshold": 0 } } ], "truncation": "disabled", "include": [], "parallel_tool_calls": True, "store": True, "stream": False } 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>', metadata: {}, temperature: 1, top_p: 1, user: '<string>', previous_response_id: '<string>', reasoning: {effort: 'medium'}, max_output_tokens: 123, instructions: '<string>', text: {format: {type: 'text'}}, tools: [ { type: 'file_search', vector_store_ids: ['<string>'], max_num_results: 123, filters: {type: 'eq', key: '<string>', value: '<string>'}, ranking_options: {ranker: 'auto', score_threshold: 0} } ], truncation: 'disabled', include: [], parallel_tool_calls: true, store: true, stream: false }) }; fetch('https://aigw.portkey.ai/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://aigw.portkey.ai/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>', 'metadata' => [ ], 'temperature' => 1, 'top_p' => 1, 'user' => '<string>', 'previous_response_id' => '<string>', 'reasoning' => [ 'effort' => 'medium' ], 'max_output_tokens' => 123, 'instructions' => '<string>', 'text' => [ 'format' => [ 'type' => 'text' ] ], 'tools' => [ [ 'type' => 'file_search', 'vector_store_ids' => [ '<string>' ], 'max_num_results' => 123, 'filters' => [ 'type' => 'eq', 'key' => '<string>', 'value' => '<string>' ], 'ranking_options' => [ 'ranker' => 'auto', 'score_threshold' => 0 ] ] ], 'truncation' => 'disabled', 'include' => [ ], 'parallel_tool_calls' => true, 'store' => true, 'stream' => false ]), 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://aigw.portkey.ai/v1/responses" payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 123,\n \"instructions\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"vector_store_ids\": [\n \"<string>\"\n ],\n \"max_num_results\": 123,\n \"filters\": {\n \"type\": \"eq\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \"score_threshold\": 0\n }\n }\n ],\n \"truncation\": \"disabled\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"stream\": false\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://aigw.portkey.ai/v1/responses") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .body("{\n \"input\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 123,\n \"instructions\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"vector_store_ids\": [\n \"<string>\"\n ],\n \"max_num_results\": 123,\n \"filters\": {\n \"type\": \"eq\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \"score_threshold\": 0\n }\n }\n ],\n \"truncation\": \"disabled\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"stream\": false\n}") .asString();
require 'uri' require 'net/http' url = URI("https://aigw.portkey.ai/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 \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 123,\n \"instructions\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"vector_store_ids\": [\n \"<string>\"\n ],\n \"max_num_results\": 123,\n \"filters\": {\n \"type\": \"eq\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \"score_threshold\": 0\n }\n }\n ],\n \"truncation\": \"disabled\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"stream\": false\n}" response = http.request(request) puts response.read_body
{ "metadata": {}, "temperature": 1, "top_p": 1, "model": "o1-pro", "instructions": "<string>", "tools": [ { "type": "file_search", "vector_store_ids": [ "<string>" ], "max_num_results": 123, "filters": { "type": "eq", "key": "<string>", "value": "<string>" }, "ranking_options": { "ranker": "auto", "score_threshold": 0 } } ], "tool_choice": "none", "id": "<string>", "object": "response", "created_at": 123, "error": { "code": "server_error", "message": "<string>" }, "incomplete_details": { "reason": "max_output_tokens" }, "output": [ { "id": "<string>", "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "<string>", "annotations": [ { "type": "file_citation", "index": 123, "file_id": "<string>" } ] } ], "status": "in_progress" } ], "parallel_tool_calls": true, "user": "<string>", "previous_response_id": "<string>", "reasoning": { "effort": "medium", "generate_summary": "concise" }, "max_output_tokens": 123, "text": { "format": { "type": "text" } }, "truncation": "disabled", "status": "completed", "output_text": "<string>", "usage": { "input_tokens": 123, "input_tokens_details": { "cached_tokens": 123 }, "output_tokens": 123, "output_tokens_details": { "reasoning_tokens": 123 }, "total_tokens": 123 } }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
o1-pro
o1-pro-2025-03-19
computer-use-preview
computer-use-preview-2025-03-11
Show child attributes
0 <= x <= 2
0 <= x <= 1
none
auto
required
disabled
file_search_call.results
message.input_image.image_url
computer_call_output.output.image_url
response
completed
failed
in_progress
incomplete
Was this page helpful?