curl -X POST https://aireiter.com/api/v1/responses \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": true }'
from openai import OpenAIclient = OpenAI( api_key="YOUR_API_KEY", base_url="https://aireiter.com/api/v1")response = client.responses.create( model="claude-sonnet-4-5-20250929", input="Write a one-sentence bedtime story about a unicorn.")print(response.output_text)
import OpenAI from "openai";const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://aireiter.com/api/v1",});const response = await client.responses.create({ model: "claude-sonnet-4-5-20250929", input: "Write a one-sentence bedtime story about a unicorn.",});console.log(response.output_text);
package mainimport ( "bytes" "encoding/json" "fmt" "net/http")func main() { payload := map[string]interface{}{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false, } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", "https://aireiter.com/api/v1/responses", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result)}
import com.fasterxml.jackson.databind.ObjectMapper;import java.net.URI;import java.net.http.*;import java.util.Map;public class ResponsesExample { public static void main(String[] args) throws Exception { var payload = Map.of( "model", "claude-sonnet-4-5-20250929", "input", "Write a one-sentence bedtime story about a unicorn.", "stream", false ); var body = new ObjectMapper().writeValueAsString(payload); var request = HttpRequest.newBuilder() .uri(URI.create("https://aireiter.com/api/v1/responses")) .header("Authorization", "Bearer YOUR_API_KEY") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); }}
<?php$client = new GuzzleHttp\Client();$response = $client->post('https://aireiter.com/api/v1/responses', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json', ], 'json' => [ 'model' => 'claude-sonnet-4-5-20250929', 'input' => 'Write a one-sentence bedtime story about a unicorn.', 'stream' => false, ],]);echo $response->getBody();
require 'net/http'require 'json'uri = URI('https://aireiter.com/api/v1/responses')req = Net::HTTP::Post.new(uri, { 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json'})req.body = { model: 'claude-sonnet-4-5-20250929', input: 'Write a one-sentence bedtime story about a unicorn.', stream: false}.to_jsonres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }puts res.body
import Foundationlet payload: [String: Any] = [ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false]var request = URLRequest(url: URL(string: "https://aireiter.com/api/v1/responses")!)request.httpMethod = "POST"request.setValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try! JSONSerialization.data(withJSONObject: payload)URLSession.shared.dataTask(with: request) { data, _, _ in if let data = data { print(String(data: data, encoding: .utf8)!) }}.resume()
using System.Net.Http;using System.Net.Http.Json;var client = new HttpClient();client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");var response = await client.PostAsJsonAsync("https://aireiter.com/api/v1/responses", new { model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = false});Console.WriteLine(await response.Content.ReadAsStringAsync());
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final response = await http.post( Uri.parse('https://aireiter.com/api/v1/responses'), headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: jsonEncode({ 'model': 'claude-sonnet-4-5-20250929', 'input': 'Write a one-sentence bedtime story about a unicorn.', 'stream': false, }), ); print(response.body);}
library(httr)library(jsonlite)response <- POST( "https://aireiter.com/api/v1/responses", add_headers( Authorization = "Bearer YOUR_API_KEY", `Content-Type` = "application/json" ), body = toJSON(list( model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = FALSE ), auto_unbox = TRUE))content(response, "text")
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0123", "object": "response", "created_at": 1742000000.123, "status": "completed", "model": "claude-sonnet-4-5-20250929", "task_id": "task_xyz123", "output": [ { "id": "msg_AbCdEfGhIjKl0123", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "annotations": [] } ] } ], "output_text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "usage": { "input_tokens": 20, "output_tokens": 35, "total_tokens": 55, "output_tokens_details": { "reasoning_tokens": 0 } }}
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0789", "object": "response", "created_at": 1742000200.789, "status": "incomplete", "model": "claude-sonnet-4-5-20250929", "task_id": "task_def789", "output": [ { "id": "msg_AbCdEfGhIjKl0789", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "Here is a very long story that was cut off due to max_output_tokens...", "annotations": [] } ] } ], "output_text": "Here is a very long story that was cut off due to max_output_tokens...", "incomplete_details": { "reason": "max_output_tokens" }, "usage": { "input_tokens": 15, "output_tokens": 256, "total_tokens": 271, "output_tokens_details": { "reasoning_tokens": 0 } }}
Compatible with OpenAI Responses API protocol, supporting text conversation, image understanding, tool invocation, structured output, and reasoning mode
Mainly used by tools such as Codex CLI and AI SDK
POST
/
api
/
v1
/
responses
curl -X POST https://aireiter.com/api/v1/responses \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": true }'
from openai import OpenAIclient = OpenAI( api_key="YOUR_API_KEY", base_url="https://aireiter.com/api/v1")response = client.responses.create( model="claude-sonnet-4-5-20250929", input="Write a one-sentence bedtime story about a unicorn.")print(response.output_text)
import OpenAI from "openai";const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://aireiter.com/api/v1",});const response = await client.responses.create({ model: "claude-sonnet-4-5-20250929", input: "Write a one-sentence bedtime story about a unicorn.",});console.log(response.output_text);
package mainimport ( "bytes" "encoding/json" "fmt" "net/http")func main() { payload := map[string]interface{}{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false, } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", "https://aireiter.com/api/v1/responses", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result)}
import com.fasterxml.jackson.databind.ObjectMapper;import java.net.URI;import java.net.http.*;import java.util.Map;public class ResponsesExample { public static void main(String[] args) throws Exception { var payload = Map.of( "model", "claude-sonnet-4-5-20250929", "input", "Write a one-sentence bedtime story about a unicorn.", "stream", false ); var body = new ObjectMapper().writeValueAsString(payload); var request = HttpRequest.newBuilder() .uri(URI.create("https://aireiter.com/api/v1/responses")) .header("Authorization", "Bearer YOUR_API_KEY") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); }}
<?php$client = new GuzzleHttp\Client();$response = $client->post('https://aireiter.com/api/v1/responses', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json', ], 'json' => [ 'model' => 'claude-sonnet-4-5-20250929', 'input' => 'Write a one-sentence bedtime story about a unicorn.', 'stream' => false, ],]);echo $response->getBody();
require 'net/http'require 'json'uri = URI('https://aireiter.com/api/v1/responses')req = Net::HTTP::Post.new(uri, { 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json'})req.body = { model: 'claude-sonnet-4-5-20250929', input: 'Write a one-sentence bedtime story about a unicorn.', stream: false}.to_jsonres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }puts res.body
import Foundationlet payload: [String: Any] = [ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false]var request = URLRequest(url: URL(string: "https://aireiter.com/api/v1/responses")!)request.httpMethod = "POST"request.setValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try! JSONSerialization.data(withJSONObject: payload)URLSession.shared.dataTask(with: request) { data, _, _ in if let data = data { print(String(data: data, encoding: .utf8)!) }}.resume()
using System.Net.Http;using System.Net.Http.Json;var client = new HttpClient();client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");var response = await client.PostAsJsonAsync("https://aireiter.com/api/v1/responses", new { model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = false});Console.WriteLine(await response.Content.ReadAsStringAsync());
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final response = await http.post( Uri.parse('https://aireiter.com/api/v1/responses'), headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: jsonEncode({ 'model': 'claude-sonnet-4-5-20250929', 'input': 'Write a one-sentence bedtime story about a unicorn.', 'stream': false, }), ); print(response.body);}
library(httr)library(jsonlite)response <- POST( "https://aireiter.com/api/v1/responses", add_headers( Authorization = "Bearer YOUR_API_KEY", `Content-Type` = "application/json" ), body = toJSON(list( model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = FALSE ), auto_unbox = TRUE))content(response, "text")
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0123", "object": "response", "created_at": 1742000000.123, "status": "completed", "model": "claude-sonnet-4-5-20250929", "task_id": "task_xyz123", "output": [ { "id": "msg_AbCdEfGhIjKl0123", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "annotations": [] } ] } ], "output_text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "usage": { "input_tokens": 20, "output_tokens": 35, "total_tokens": 55, "output_tokens_details": { "reasoning_tokens": 0 } }}
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0789", "object": "response", "created_at": 1742000200.789, "status": "incomplete", "model": "claude-sonnet-4-5-20250929", "task_id": "task_def789", "output": [ { "id": "msg_AbCdEfGhIjKl0789", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "Here is a very long story that was cut off due to max_output_tokens...", "annotations": [] } ] } ], "output_text": "Here is a very long story that was cut off due to max_output_tokens...", "incomplete_details": { "reason": "max_output_tokens" }, "usage": { "input_tokens": 15, "output_tokens": 256, "total_tokens": 271, "output_tokens_details": { "reasoning_tokens": 0 } }}
Bearer Token authentication. Format: Authorization: Bearer <api-key>Get API Key:Visit the API Key management page to get your API Key
string
Alternative authentication method, choose either this or Authorization. Format: x-api-key: <api-key>
Request Body Parameters
string
required
The name of the model to use. Examples: gpt-4o, gpt-5.4, gpt-5.5, etc.The full list of models can be obtained via GET /api/v1/models.
array
required
List of input contentsAn array of inputs, each containing the fields role and content. Supports multi-turn conversations and multi-modal content (text + images).
Show Detailed Field Description
string
default:"user"
required
Message roleOptions: user (user message), assistant (AI reply for multi-turn dialogue), system (system prompt)
array
required
Content arraySupports various types of content blocks, including text and images.
Show Content Block Types
string
required
Content typeOptions:
input_text: text input
input_image: image input
string
Text contentUsed when type is input_text; fill in the text content
string
Image URLUsed when type is input_imageSupports two formats:1. Full image URL address
Publicly accessible image URLs (http:// or https://)
Note: Must include the prefix data:image/jpeg;base64,
string
System Prompt. Used to set the model’s behavior guidelines, role identity, or context.Equivalent to a message in the array with role: "system".
boolean
default:"true"
Whether to enable streaming output.
true (default): returns tokens incrementally as SSE event stream, suitable for real-time display
false: returns the full response at once after completion, suitable for batch processing
integer
Maximum number of tokens to generate in the reply. If exceeded, the response status will be "incomplete", and incomplete_details.reason will be "max_output_tokens".
number
Sampling temperature, range 0 to 2. Higher values result in more random output, lower values more deterministic. Not recommended to adjust temperature and top_p simultaneously.
number
Nucleus sampling probability, range 0 to 1. The model samples only from tokens whose cumulative probability reaches top_p.
array
List of tools available for the model to call. Currently, only type: "function" is supported; built-in tools like web_search, file_search, computer_use are not supported.
Show Function Tool Format
string
required
Fixed as "function"
string
required
Function name, must match ^[a-zA-Z0-9_-]{1,64}$
string
Function description to help the model decide when to call this tool
object
Parameter definitions, following JSON Schema format
string | object
default:"auto"
Tool calling policy:
"auto": model decides automatically whether to call tools
"none": prohibit calling tools
"required": force calling at least one tool
{ "type": "function", "name": "function_name" }: force call the specified tool
boolean
default:"true"
Whether the model is allowed to call multiple tools in parallel. Only effective if tools are provided.
object
Output format control.
Show Text Object
object
Show Format Object
string
required
Output format type:
"text": plain text (default)
"json_object": JSON format
"json_schema": JSON complying with specified Schema
string
Schema name (effective only for json_schema)
string
Schema description (effective only for json_schema)
boolean
default:"true"
Whether to strictly follow the Schema (effective only for json_schema)
object
JSON Schema definition (required only for json_schema)
object
Reasoning mode configuration (applicable to models supporting reasoning, such as gpt-5.2 and above).
Show Reasoning Object
string
Reasoning intensity: "low" | "medium" | "high"
Response Fields
string
Unique response identifier, format: resp_ + 24-character random string
string
Fixed as "response"
number
Response creation time, Unix timestamp (seconds, with millisecond precision)
string
Response status:
"completed": Completed successfully
"incomplete": Cut off early due to max_output_tokens
"in_progress": Streaming output in progress (only in streaming events)
"failed": Generation failed
string
Actual model name used
string
Platform extension field. Billing task ID for this call, used for reconciliation and consumption queries.Note:
Non-streaming: task_id is located directly at the top level of the response JSON
Streaming: task_id is nested inside the response object of response.created (first event) and response.completed (last event). It needs to be parsed from the raw SSE event. The OpenAI SDK streaming interface does not automatically expose this field
array
Array of output items, which may contain two types: text messages and tool calls.
Show message type
string
Message ID, format: msg_ + 16-character random string
string
Fixed as "message"
string
Fixed as "assistant"
string
"completed" | "in_progress"
array
Array of content blocks:
Show output_text content block
string
Fixed as "output_text"
string
Model-generated text content
array
Text annotations, usually an empty array []
Show function_call type
string
Tool call entry ID, format: fc_ + 16-character random string
string
Fixed as "function_call"
string
Tool call ID, used to reference when submitting tool execution results
string
Name of the called function
string
Function arguments, JSON serialized string
string
Shortcut field, equivalent to output[0].content[0].text (in plain text scenarios). Empty string in tool call scenarios.
object
Token usage statistics.
Show usage object
integer
Number of input tokens (including system prompt)
integer
Number of output tokens
integer
Total tokens = input + output
object
Show Details
integer
Reasoning/thinking tokens (usually 0 for general models)
object | null
Not null when status is "incomplete".
Show incomplete_details object
string
Cutoff reason. Currently only "max_output_tokens"
curl -X POST https://aireiter.com/api/v1/responses \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": true }'
from openai import OpenAIclient = OpenAI( api_key="YOUR_API_KEY", base_url="https://aireiter.com/api/v1")response = client.responses.create( model="claude-sonnet-4-5-20250929", input="Write a one-sentence bedtime story about a unicorn.")print(response.output_text)
import OpenAI from "openai";const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://aireiter.com/api/v1",});const response = await client.responses.create({ model: "claude-sonnet-4-5-20250929", input: "Write a one-sentence bedtime story about a unicorn.",});console.log(response.output_text);
package mainimport ( "bytes" "encoding/json" "fmt" "net/http")func main() { payload := map[string]interface{}{ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false, } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", "https://aireiter.com/api/v1/responses", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result)}
import com.fasterxml.jackson.databind.ObjectMapper;import java.net.URI;import java.net.http.*;import java.util.Map;public class ResponsesExample { public static void main(String[] args) throws Exception { var payload = Map.of( "model", "claude-sonnet-4-5-20250929", "input", "Write a one-sentence bedtime story about a unicorn.", "stream", false ); var body = new ObjectMapper().writeValueAsString(payload); var request = HttpRequest.newBuilder() .uri(URI.create("https://aireiter.com/api/v1/responses")) .header("Authorization", "Bearer YOUR_API_KEY") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); }}
<?php$client = new GuzzleHttp\Client();$response = $client->post('https://aireiter.com/api/v1/responses', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json', ], 'json' => [ 'model' => 'claude-sonnet-4-5-20250929', 'input' => 'Write a one-sentence bedtime story about a unicorn.', 'stream' => false, ],]);echo $response->getBody();
require 'net/http'require 'json'uri = URI('https://aireiter.com/api/v1/responses')req = Net::HTTP::Post.new(uri, { 'Authorization' => 'Bearer YOUR_API_KEY', 'Content-Type' => 'application/json'})req.body = { model: 'claude-sonnet-4-5-20250929', input: 'Write a one-sentence bedtime story about a unicorn.', stream: false}.to_jsonres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }puts res.body
import Foundationlet payload: [String: Any] = [ "model": "claude-sonnet-4-5-20250929", "input": "Write a one-sentence bedtime story about a unicorn.", "stream": false]var request = URLRequest(url: URL(string: "https://aireiter.com/api/v1/responses")!)request.httpMethod = "POST"request.setValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try! JSONSerialization.data(withJSONObject: payload)URLSession.shared.dataTask(with: request) { data, _, _ in if let data = data { print(String(data: data, encoding: .utf8)!) }}.resume()
using System.Net.Http;using System.Net.Http.Json;var client = new HttpClient();client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");var response = await client.PostAsJsonAsync("https://aireiter.com/api/v1/responses", new { model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = false});Console.WriteLine(await response.Content.ReadAsStringAsync());
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final response = await http.post( Uri.parse('https://aireiter.com/api/v1/responses'), headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: jsonEncode({ 'model': 'claude-sonnet-4-5-20250929', 'input': 'Write a one-sentence bedtime story about a unicorn.', 'stream': false, }), ); print(response.body);}
library(httr)library(jsonlite)response <- POST( "https://aireiter.com/api/v1/responses", add_headers( Authorization = "Bearer YOUR_API_KEY", `Content-Type` = "application/json" ), body = toJSON(list( model = "claude-sonnet-4-5-20250929", input = "Write a one-sentence bedtime story about a unicorn.", stream = FALSE ), auto_unbox = TRUE))content(response, "text")
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0123", "object": "response", "created_at": 1742000000.123, "status": "completed", "model": "claude-sonnet-4-5-20250929", "task_id": "task_xyz123", "output": [ { "id": "msg_AbCdEfGhIjKl0123", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "annotations": [] } ] } ], "output_text": "The little unicorn tiptoed through the moonlit meadow, leaving a trail of shimmering stardust as she galloped home to her cozy cloud.", "usage": { "input_tokens": 20, "output_tokens": 35, "total_tokens": 55, "output_tokens_details": { "reasoning_tokens": 0 } }}
{ "id": "resp_AbCdEfGhIjKlMnOpQrSt0789", "object": "response", "created_at": 1742000200.789, "status": "incomplete", "model": "claude-sonnet-4-5-20250929", "task_id": "task_def789", "output": [ { "id": "msg_AbCdEfGhIjKl0789", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "text": "Here is a very long story that was cut off due to max_output_tokens...", "annotations": [] } ] } ], "output_text": "Here is a very long story that was cut off due to max_output_tokens...", "incomplete_details": { "reason": "max_output_tokens" }, "usage": { "input_tokens": 15, "output_tokens": 256, "total_tokens": 271, "output_tokens_details": { "reasoning_tokens": 0 } }}
from openai import OpenAIclient = OpenAI( api_key="YOUR_API_KEY", base_url="https://aireiter.com/api/v1")response = client.responses.create( model="claude-sonnet-4-5-20250929", instructions="You are a helpful coding assistant.", input="How do I reverse a string in Python?",)print(response.output_text)
response = client.responses.create( model="claude-3-7-sonnet-20250219", # Model supporting reasoning input="Solve: If x + y = 10 and x * y = 21, what are x and y?", reasoning={"effort": "high"},)print(response.output_text)
Multi-turn Conversation
previous_response_id is currently ineffective; you need to manually concatenate historical messages in input:
# First turnresponse1 = client.responses.create( model="claude-sonnet-4-5-20250929", input="My name is Bob.",)# Second turn: manually concatenate historyresponse2 = client.responses.create( model="claude-sonnet-4-5-20250929", input=[ {"role": "user", "content": "My name is Bob."}, {"role": "assistant", "content": response1.output_text}, {"role": "user", "content": "What's my name?"}, ],)print(response2.output_text) # "Your name is Bob."
Notes
Streaming by Default: The stream parameter defaults to true. To receive a non-streaming response, explicitly pass "stream": false.
Insufficient Credits: An HTTP 402 is returned when the balance is insufficient. Please recharge and try again.
Limited Support for text.format: The underlying provider currently has limited support for structured output—models may still output Markdown code blocks instead of pure JSON in json_object mode; Schema constraints may not be enforced in json_schema mode. For structured output, it is recommended to clearly describe the required format in instructions or input.
Tool Parameters: The parameters field must be a valid JSON Schema, and the required array specifies which parameters are mandatory.