OpenAI Responses API Application and Usage
Compatible model requests accepted by the platform are billed according to the model's input, output, and cached usage. Total Responses input includes reported cached tokens, and the cached portion is billed at the corresponding cache rate; switching the API format does not change billing to a fixed per-call charge. Charges are based on the current model prices in the console and usage.cost in the response.
The Responses API uses OpenAI-compatible request and response formats. Available input types, tools, and conversation features depend on the selected model.
¶ Gemini 3.8 Flash and Gemini 4
For model, you can select gemini-3.8-flash, gemini-4-argon, gemini-4-carbon, gemini-4-hydrogen, or gemini-4-neon.
Send the following JSON to POST https://api.acedata.cloud/v1/responses. These models accept text or image input and generate text. The body of a standard response is in the output_text content block of a message item in output. Set "stream": true to receive incremental text through response.output_text.delta events.
{"model": "gemini-4-neon", "input": "只回复 OK", "store": false}
For multi-turn conversations, the client saves the history and sends it back in the input array of the next request. When using a function tool, the client executes the function, retains the previous turn's input and complete output items, and then appends a function_call_output containing the same call_id. Omit previous_response_id from the request, and omit store or set it to false.
¶ GPT-6.2 Astra and GPT-6.2 Sol
Use model: "gpt-6.2-astra" or model: "gpt-6.2-sol" to select the model. Text and image input and text output are supported. It is recommended to start with reasoning: {"effort": "low"}; low, medium, high, xhigh, and max are supported, while none and minimal are not. For tool calls and structured output, use the public parameter formats for the corresponding API.
The official context window is 1,050,000 tokens, with a maximum input of 922,000 and a maximum output of 128,000; actual requests must also comply with this API's parameter and account limits. When input exceeds 272,000 tokens, long-context rates apply to the entire request: input and cache rates are twice the base rates, and output is 1.5 times the base rate. Prices and charges are based on the current model prices in the console, the selected plan, and actual usage.
¶ GPT-6.1 Terra
Use model: "gpt-6.1-terra" to select this model. Text and image input, streaming output, function tools, and structured output are supported. Reasoning levels low, medium, high, xhigh, and max are supported, and it is recommended to start with reasoning: {"effort": "low"}; none and minimal are not supported. Long-context pricing applies when input exceeds 272,000 tokens, and actual charges are based on the current prices in the console and usage in the response.
¶ GPT-6.1 Sol
Use model: "gpt-6.1-sol" to select this model. Streaming output, function calling, structured output, and image input are supported. During the first week after launch, access is limited to verified ACE T1+ holders (at least 100,000 ACE) or authorized users; the exact availability time is subject to the access notice in the console.
Reasoning levels low, medium, high, xhigh, and max are supported, while none and minimal are not currently supported. It is recommended to start with reasoning: {"effort": "low"}. When input exceeds 272,000 tokens, long-context pricing applies to the entire request, and charges are based on the current prices in the console.
¶ Application Process
To use the OpenAI Responses API, first go to the Ace Data Cloud console to obtain your API Token and save it for later use.

If you have not yet logged in or registered, you will be automatically redirected to the login page to register and log in, and then automatically returned to the current page.
A general application's API Key can be used for services enabled for the account; a dedicated application's Key is used within that application's service scope. Please check the Key's permissions, validity period, and limits, and confirm that the application balance is sufficient to pay for the request. Available trial credit is subject to what is shown in the account; if the balance is insufficient, click the "Recharge" button.
📘 Full documentation: OpenAI Responses API →
¶ Basic Usage
Next, you can fill in the corresponding content in the interface, as shown:

In the debugging interface, select the API Token for authorization, select a model from the model list, and enter text or a message array in input. The message's role represents the role, and content represents the content.
You can also see the corresponding call code generated on the right. You can copy the code and run it directly, or click the "Try" button to test it directly.
Common optional parameters:
max_tokens: Limits the maximum number of tokens in a single reply.temperature: Generation randomness, between 0 and 2; the higher the value, the more varied the output.n: The number of candidate replies to generate at once.response_format: Response format setting.tools: Function/tool call definitions.background: Whether to run asynchronously in the background.

After making the call, we find that the result is as follows:
{
"id": "resp_68a98322e3c88191a027de2711a02a490554cad0b36c0400",
"object": "response",
"created_at": 1755939618,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-5.5",
"output": [
{
"id": "msg_68a98323422c8191a7f383eea48ba5160554cad0b36c0400",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"text": "Hello! How can I assist you today?"
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 8,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 10,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 18
},
"user": null,
"metadata": {}
}
The returned result contains multiple fields, described below:
id, the ID generated for this conversation task, used to uniquely identify it.model, the selected model from the official OpenAI ChatGPT website.output, the response ChatGPT provides to the prompt.usage: token statistics for this question and answer.
The output contains ChatGPT's response information, and the output inside it is ChatGPT, as shown in the figure.

As you can see, the content field inside output contains the specific content of ChatGPT's response.
¶ Streaming Response
This API also supports streaming responses, which is very useful for web integration and allows web pages to display text character by character.
To return a streaming response, you can change the stream parameter in the request header to true.
Make the change as shown in the figure, but the calling code also needs corresponding changes to support streaming responses.

After changing stream to true, the API will return the corresponding JSON data line by line, and we need to make corresponding changes to the code to obtain the results line by line.
Python sample calling code:
import requests
url = "https://api.acedata.cloud/openai/responses"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "gpt-4.1",
"input": [{"role":"user","content":"Hello"}],
"stream": True
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
The output is as follows:
data: {"type": "response.created", "sequence_number": 0, "response": {"id": "resp_68a9837bb9bc8190b403947311db6faa0721186e8fbb89d0", "object": "response", "created_at": 1755939707, "status": "in_progress", "background": false, "content_filters": null, "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": null, "max_tool_calls": null, "model": "gpt-4.1-data", "output": [], "parallel_tool_calls": true, "previous_response_id": null, "prompt_cache_key": null, "reasoning": {"effort": null, "summary": null}, "safety_identifier": null, "service_tier": "auto", "store": true, "temperature": 1.0, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [], "top_p": 1.0, "truncation": "disabled", "usage": null, "user": null, "metadata": {}}, "model": "gpt-4.1"}
data: {"type": "response.in_progress", "sequence_number": 1, "response": {"id": "resp_68a9837bb9bc8190b403947311db6faa0721186e8fbb89d0", "object": "response", "created_at": 1755939707, "status": "in_progress", "background": false, "content_filters": null, "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": null, "max_tool_calls": null, "model": "gpt-4.1-data", "output": [], "parallel_tool_calls": true, "previous_response_id": null, "prompt_cache_key": null, "reasoning": {"effort": null, "summary": null}, "safety_identifier": null, "service_tier": "auto", "store": true, "temperature": 1.0, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [], "top_p": 1.0, "truncation": "disabled", "usage": null, "user": null, "metadata": {}}, "model": "gpt-4.1"}
data: {"type": "response.output_item.added", "sequence_number": 2, "output_index": 0, "item": {"id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "type": "message", "status": "in_progress", "content": [], "role": "assistant"}, "model": "gpt-4.1"}
data: {"type": "response.content_part.added", "sequence_number": 3, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "part": {"type": "output_text", "annotations": [], "text": ""}, "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 4, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": "Hello", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 5, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": "!", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 6, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " How", "model": "gpt-4.1"}
data:
{"type": "response.output_text.delta", "sequence_number": 7, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " can", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 8, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " I", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 9, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " help", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 10, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " you", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 11, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " today", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 12, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": "?", "model": "gpt-4.1"}
data: {"type": "response.output_text.delta", "sequence_number": 13, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "delta": " 😊", "model": "gpt-4.1"}
data: {"type": "response.output_text.done", "sequence_number": 14, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "text": "Hello! How can I help you today? 😊", "model": "gpt-4.1"}
data: {"type": "response.content_part.done", "sequence_number": 15, "item_id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "output_index": 0, "content_index": 0, "part": {"type": "output_text", "annotations": [], "text": "Hello! How can I help you today? 😊"}, "model": "gpt-4.1"}
data: {"type": "response.output_item.done", "sequence_number": 16, "output_index": 0, "item": {"id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "type": "message", "status": "completed", "content": [{"type": "output_text", "annotations": [], "text": "Hello! How can I help you today? 😊"}], "role": "assistant"}, "model": "gpt-4.1"}
data: {"type": "response.completed", "sequence_number": 17, "response": {"id": "resp_68a9837bb9bc8190b403947311db6faa0721186e8fbb89d0", "object": "response", "created_at": 1755939707, "status": "completed", "background": false, "content_filters": null, "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": null, "max_tool_calls": null, "model": "gpt-4.1-data", "output": [{"id": "msg_68a9837c49f081908f568bf9c6065c620721186e8fbb89d0", "type": "message", "status": "completed", "content": [{"type": "output_text", "annotations": [], "text": "Hello! How can I help you today? 😊"}], "role": "assistant"}], "parallel_tool_calls": true, "previous_response_id": null, "prompt_cache_key": null, "reasoning": {"effort": null, "summary": null}, "safety_identifier": null, "service_tier": "default", "store": true, "temperature": 1.0, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [], "top_p": 1.0, "truncation": "disabled", "usage": {"input_tokens": 8, "input_tokens_details": {"cached_tokens": 0}, "output_tokens": 11, "output_tokens_details": {"reasoning_tokens": 0}, "total_tokens": 19}, "user": null, "metadata": {}}, "model": "gpt-4.1"}
As you can see, the response contains many data entries, and the delta in each data entry is the latest response content, consistent with what was described above. delta is the newly added response content, which you can integrate into your system based on the results. A streaming response ends with either response.completed or response.incomplete as its terminal state; the usage in the terminal state is the final token usage for the request and is also the basis for billing.
If the client disconnects before the terminal state arrives, the request is recorded as client closed (499), and locally estimated tokens are not used for billing; if the connection ends normally but the terminal state and final usage are not received, the request is recorded as an incomplete response (502), and estimated tokens are likewise not used for billing. If either of these situations occurs, please send the request again.
The returned data results contain several fields, described below:
item_id, the ID generated for this conversation task, used to uniquely identify the task.type, the type of Responses task generated for this conversation.model, the selected model from the official OpenAI ChatGPT website.delta, the response information ChatGPT provides for the prompt.
JavaScript is also supported. For example, the Node.js streaming call code is as follows:
const options = {
method: "post",
headers: {
accept: "application/json",
authorization: "Bearer YOUR_API_TOKEN",
"content-type": "application/json",
},
body: JSON.stringify({
model: "gpt-4.1",
input: [{ role: "user", content: "Hello" }],
stream: true,
}),
};
fetch("https://api.acedata.cloud/openai/responses", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
Java sample code:
JSONObject jsonObject = new JSONObject();
jsonObject.put("model", "gpt-4.1");
jsonObject.put("input", [{"role":"user","content":"Hello"}]);
jsonObject.put("stream", true);
MediaType mediaType = "application/json; charset=utf-8".toMediaType();
RequestBody body = jsonObject.toString().toRequestBody(mediaType);
Request request = new Request.Builder()
.url("https://api.acedata.cloud/openai/responses")
.post(body)
.addHeader("accept", "application/json")
.addHeader("authorization", "Bearer YOUR_API_TOKEN")
.addHeader("content-type", "application/json")
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
System.out.print(response.body!!.string())
You can adapt the code for other languages yourself; the principle is the same.
¶ Multi-Turn Conversations
If you want to integrate multi-turn conversation functionality, you need to upload multiple prompts to the input field. A specific example of multiple prompts is shown in the image below:

Python sample call code:
import requests
url = "https://api.acedata.cloud/openai/responses"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "gpt-4.1",
"input": [{"role":"user","content":"Hello"},{"role":"assistant","content":"Hello! How can I help you today? 😊"},{"role":"user","content":"What did I just say?"}]
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
By uploading multiple prompts, you can easily implement multi-turn conversations and obtain the following response:
{
"id": "resp_68a989c03c508191a1dd82ce2e37e88a0932a4328c0a5d5b",
"object": "response",
"created_at": 1755941312,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4.1",
"output": [
{
"id": "msg_68a989c092e4819189821a9eb8247e1e0932a4328c0a5d5b",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"text": "You just said \"Hello.\" \n\nWould you like to continue the conversation or ask a question?"
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 32,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 20,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 52
},
"user": null,
"metadata": {}
}
As you can see, the information contained in output is consistent with that in the basic usage example. It contains the specific content of ChatGPT's response to the multiple conversation turns, allowing it to answer the corresponding question based on those turns.
¶ Vision Model
gpt-4o is a multimodal large language model developed by OpenAI. It adds visual understanding capabilities to GPT-4. The model can process both text and image inputs, enabling cross-modal understanding and generation.
Text processing with the gpt-4o model is consistent with the basic usage described above. Below is a brief introduction to using the model's image processing capabilities.
The gpt-4o model's image processing capabilities are mainly used by adding a type field to the existing content. This field indicates whether the uploaded content is text or an image, enabling the use of the gpt-4o model's image processing capabilities. Below, we mainly describe two ways to call this feature: Curl and Python.
- Curl script method
curl -X POST 'https://api.acedata.cloud/openai/responses' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": [
{"type": "input_text", "text": "what is in this image?"},
{
"type": "input_image",
"image_url": "https://cdn.acedata.cloud/e724d7f13d.png"
}
]
}
]
}'
- Python script method
import requests
url = "https://api.acedata.cloud/openai/chat/completions"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": [
{"type": "input_text", "text": "what is in this image?"},
{
"type": "input_image",
"image_url": "https://cdn.acedata.cloud/e724d7f13d.png"
}
]
}
]
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
You can then obtain the result below. The field information in the result is consistent with the above, as shown below:
{
"id": "resp_68a98c1bb784819e9b9f622007a2d37602483949012d2193",
"object": "response",
"created_at": 1755941915,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4.1",
"output": [
{
"id": "msg_68a98c1dd030819e97fb71e6ee33f5a902483949012d2193",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"text": "This image shows a scenic path, possibly a boardwalk, running through a lush green field or meadow. The sky above is bright blue with some white clouds, and there are green trees and bushes in the background. It looks like a peaceful nature scene, possibly in a park, wetland, or prairie area. The image conveys a sense of tranquility and natural beauty."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 1118,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 75,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 1193
},
"user": null,
"metadata": {}
}
As you can see, the response is based on the image, so you can easily use the text and image processing capabilities of the gpt-4.1 model through the two methods above.
Besides gpt-4.1, there is another lower-cost model called gpt-4o-mini. gpt-4o-mini is the latest generation of large language models developed by OpenAI. It not only responds quickly but is also cheaper and supports multimodal input. For information on using the vision feature, refer to the section above on using the gpt-4.1 model.
¶ Creating a File Processing Model
Request example:
{
"model": "gpt-4.1",
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "what is in this file?" },
{
"type": "input_file",
"file_url": "https://cdn.acedata.cloud/assets/examples/fish/64adc04b-c196-4a0f-9070-222ba101ce6c-fc50de38c165.wav"
}
]
}
]
}
Example result:
{
"id": "resp_68a98d7bb57c819ba25424f5f50a29a300a1af2af822e88a",
"object": "response",
"created_at": 1755942267,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-4.1",
"output": [
{
"id": "msg_68a98d7d9b80819b9b0f09b7bcd00bf900a1af2af822e88a",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"text": "The file you posted contains the **2024 annual letter to shareholders from Berkshire Hathaway Inc.**, written by Warren E. Buffett, Chairman of the Board. This document is a comprehensive communication that is typically included in Berkshire's annual report to shareholders.\n\n### What's Inside the File:\n\n#### 1. **Chairman's Letter to Shareholders**\n - **Introduction & Philosophy:** Warren Buffett discusses the purpose of the annual report, Berkshire Hathaway’s communication style, and his philosophy for transparency and candid discussion of both successes and failures.\n - **Discussion of Mistakes:** He talks openly about the mistakes made in capital allocation and personnel decisions, emphasizing the importance of admitting errors and acting promptly to correct them.\n - **Succession Comments:** Buffett references his eventual retirement, and that Greg Abel will succeed him as CEO and writer of these letters.\n - **Anecdotal Story:** The story of Pete Liegl, founder of Forest River (an RV manufacturer acquired by Berkshire), is told to illustrate management philosophy and business decision-making.\n\n#### 2. **2024 Business and Financial Performance**\n - **Key Results:** Summary of how Berkshire performed financially in 2024 vs. 2023, including operating earnings breakdown by business segments such as insurance, BNSF railroad, and energy.\n - **Insurance Business:** GEICO and the property-casualty insurance division had a standout year, with commentary on the industry and how Berkshire approaches insurance risk, pricing, and investment of insurance \"float.\"\n - **Investments:** Discussion on Berkshire’s strategy of owning both full businesses and partial stakes (marketable securities) in large companies (e.g., Apple, American Express, Coca-Cola), and its deployment of cash.\n - **Taxes:** Reference to Berkshire breaking records in corporate tax payments ($26.8 billion to the IRS in 2024).\n\n#### 3. **Long-term Philosophy & Capitalism Commentary**\n - **On Equities:** Buffett explains why Berkshire prioritizes ownership of businesses (equities) over cash or bonds, and why the company favors long-term investments.\n - **On Capitalism:** There’s a reflection on America’s growth, the role of capitalism, savings, and capital allocation in the nation’s success, and a nod to the importance of maintaining a stable currency.\n\n#### 4. **Japanese Investments**\n - **Update on Japanese Holdings:** Berkshire’s growing investments in five Japanese trading companies, and the positive view of their management and governance.\n\n#### 5. **Berkshire Hathaway Annual Meeting**\n - **Annual Gathering Info:** Details about the annual meeting in Omaha, including social events, book sales, and charitable initiatives related to the meeting.\n - **Personal Stories:** Personal anecdotes involving Buffett’s family, (including his sister Bertie), to add a human touch to the letter.\n\n#### 6. **Performance Tables**\n - **Berkshire vs S&P 500 (1965-2024):** Two detailed tables showing annual percentage change in Berkshire’s share price vs. total return for the S&P 500, as well as long-term compounded and overall gains.\n\n---\n\n### In Summary\n\nThis file is the **2024 Berkshire Hathaway annual letter to shareholders**, primarily written by Warren Buffett. It covers business performance, management philosophy, investment strategy, earnings and taxes, insurance operations, significant holdings, capital allocation, succession updates, and more. Tables show a remarkable outperformance of Berkshire Hathaway vs. the S&P 500 over nearly six decades – a central point of pride in the letter.\n\nIf you want specifics from any particular section, let me know!"
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": null,
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 8438,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 731,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 9169
},
"user": null,
"metadata": {}
}
As you can see, we also processed the input file, and the result is similar to the one above.
¶ Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:
400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.
¶ Example Error Response
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ Conclusion
Through this document, you have learned how to easily create Responses using the official OpenAI Responses API. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.
