SpyBara
Go Premium

Documentation 2026-10-10 23:58 UTC to 2026-10-11 23:59 UTC

4 files changed +108 −221. View all changes and history on the product overview
2026
Mon 19 06:01 Sun 18 23:00 Sat 17 22:57 Fri 16 23:02 Thu 15 23:00 Wed 14 23:59 Tue 13 23:00 Sun 11 23:59 Sat 10 23:58 Fri 9 22:57 Thu 8 23:01 Wed 7 23:57 Tue 6 22:58 Mon 5 22:59 Sun 4 22:58 Fri 2 23:58 Thu 1 22:59
Details

594# Terminal 1: use session_id from the creation request.594# Terminal 1: use session_id from the creation request.

595# Keep this stream open. Wait for HTTP 200 before sending input.595# Keep this stream open. Wait for HTTP 200 before sending input.

596set -o pipefail596set -o pipefail

597# Retain screenshot bytes privately even if saved history omits them.

598stream_file=$(mktemp -t openai-browser-stream.XXXXXX) || exit 1

599printf 'Saved event stream: %s\n' "$stream_file" >&2

597curl --silent --show-error --fail --no-buffer --dump-header - \600curl --silent --show-error --fail --no-buffer --dump-header - \

598 --suppress-connect-headers \601 --suppress-connect-headers \

599 "https://api.openai.com/v1/agents/sessions/$session_id/events" \602 "https://api.openai.com/v1/agents/sessions/$session_id/events" \

600 -H "OpenAI-Beta: agents=v1" \603 -H "OpenAI-Beta: agents=v1" \

601 -H "Authorization: Bearer $OPENAI_API_KEY" \604 -H "Authorization: Bearer $OPENAI_API_KEY" \

602 -H "Accept: text/event-stream" \605 -H "Accept: text/event-stream" \

606 | tee "$stream_file" \

603 | jq --raw-input --unbuffered '607 | jq --raw-input --unbuffered '

604 if startswith("HTTP/") then .608 if startswith("HTTP/") then .

605 elif startswith("data:") then609 elif startswith("data:") then


636```640```

637 641 

638```javascript642```javascript

643let screenshot;

639const events = await client.beta.agents.sessions.events.stream(session.id);644const events = await client.beta.agents.sessions.events.stream(session.id);

640const handledRequests = new Set();645const handledRequests = new Set();

641let completed = false;646let completed = false;


675 }680 }

676 break;681 break;

677 }682 }

683 case "agent.session.turn.item.done": {

684 // Preserve streamed screenshots; retrieved history may omit image bytes.

685 const item = event.item;

686 if (item.type === "computer_use_call") {

687 const output = item.output;

688 if (

689 output?.type === "computer_screenshot" &&

690 output.image_url.startsWith("data:image/jpeg;base64,")

691 ) {

692 screenshot = Buffer.from(

693 output.image_url.split(",", 2)[1],

694 "base64"

695 );

696 }

697 }

698 break;

699 }

678 case "agent.session.turn.output_text.done":700 case "agent.session.turn.output_text.done":

679 console.log(event.text);701 console.log(event.text);

680 break;702 break;


709```731```

710 732 

711```python733```python

734last_screenshot = None

712handled_requests = set()735handled_requests = set()

713completed = False736completed = False

714with client.beta.agents.sessions.events.stream(session.id) as events:737with client.beta.agents.sessions.events.stream(session.id) as events:


741 ):764 ):

742 respond_to_origin_approval(client, session.id, approval)765 respond_to_origin_approval(client, session.id, approval)

743 handled_requests.add(approval.request_id)766 handled_requests.add(approval.request_id)

767 elif event.type == "agent.session.turn.item.done":

768 # Preserve streamed screenshots; retrieved history may omit image bytes.

769 item = event.item

770 if item.type == "computer_use_call":

771 output = getattr(item, "output", None)

772 if output is not None and output.type == "computer_screenshot":

773 prefix = "data:image/jpeg;base64,"

774 if output.image_url.startswith(prefix):

775 last_screenshot = base64.b64decode(

776 output.image_url[len(prefix) :], validate=True

777 )

744 elif event.type == "agent.session.turn.output_text.done":778 elif event.type == "agent.session.turn.output_text.done":

745 print(event.text, flush=True)779 print(event.text, flush=True)

746 elif event.type == "agent.session.turn.completed":780 elif event.type == "agent.session.turn.completed":


766```800```

767 801 

768```go802```go

769handledRequests := map[string]bool{}803var lastScreenshot []byte

804 handledRequests := map[string]bool{}

770 events := client.Beta.Agents.Sessions.Events.StreamStreaming(ctx, session.ID)805 events := client.Beta.Agents.Sessions.Events.StreamStreaming(ctx, session.ID)

771 defer events.Close()806 defer events.Close()

772 if err := events.Err(); err != nil {807 if err := events.Err(); err != nil {


812 }847 }

813 handledRequests[approval.RequestID] = true848 handledRequests[approval.RequestID] = true

814 }849 }

850 case "agent.session.turn.item.done":

851 // Preserve streamed screenshots; retrieved history may omit image bytes.

852 item := event.Item

853 if item.Type == "computer_use_call" && item.Output.Type == "computer_screenshot" {

854 const prefix = "data:image/jpeg;base64,"

855 if strings.HasPrefix(item.Output.ImageURL, prefix) {

856 lastScreenshot, err = base64.StdEncoding.DecodeString(strings.TrimPrefix(item.Output.ImageURL, prefix))

857 if err != nil {

858 return err

859 }

860 }

861 }

815 case "agent.session.turn.output_text.done":862 case "agent.session.turn.output_text.done":

816 fmt.Println(event.Text)863 fmt.Println(event.Text)

817 case "agent.session.turn.completed":864 case "agent.session.turn.completed":


838```885```

839 886 

840```java887```java

888byte[] lastScreenshot = null;

841var handledRequests = new HashSet<String>();889var handledRequests = new HashSet<String>();

842try (var events = client.beta().agents().sessions().events().streamStreaming(session.id())) {890try (var events = client.beta().agents().sessions().events().streamStreaming(session.id())) {

843 client891 client


874 }922 }

875 }923 }

876 }924 }

925 // Preserve streamed screenshots; retrieved history may omit image bytes.

926 if (event.turnItemDone().isPresent()

927 && event.turnItemDone().get().item().computerUseCall().isPresent()) {

928 var activity = event.turnItemDone().get().item().computerUseCall().get();

929 var output = activity.output();

930 if (output.isPresent()) {

931 String imageUrl = output.get().imageUrl();

932 String prefix = "data:image/jpeg;base64,";

933 if (imageUrl.startsWith(prefix)) {

934 lastScreenshot = Base64.getDecoder().decode(imageUrl.substring(prefix.length()));

935 }

936 }

937 }

877 event.turnOutputTextDone().ifPresent(text -> System.out.println(text.text()));938 event.turnOutputTextDone().ifPresent(text -> System.out.println(text.text()));

878 if (event.turnCompleted().filter(e -> e.turn().subagentId().isEmpty()).isPresent()) {939 if (event.turnCompleted().filter(e -> e.turn().subagentId().isEmpty()).isPresent()) {

879 completed = true;940 completed = true;


897```958```

898 959 

899```csharp960```csharp

961byte[]? lastScreenshot = null;

900HashSet<string> handledRequests = new(StringComparer.Ordinal);962HashSet<string> handledRequests = new(StringComparer.Ordinal);

901await using var events = await client.GetAgentSessionEventsAsync(session.Id);963await using var events = await client.GetAgentSessionEventsAsync(session.Id);

902await client.CreateAgentSessionEventsAsync(964await client.CreateAgentSessionEventsAsync(


932 }994 }

933 }995 }

934 }996 }

997 else if (type == "agent.session.turn.item.done")

998 {

999 // Preserve streamed screenshots; retrieved history may omit image bytes.

1000 JsonElement item = current.GetProperty("item");

1001 if (item.GetProperty("type").GetString() == "computer_use_call"

1002 && item.TryGetProperty("output", out JsonElement output)

1003 && output.ValueKind == JsonValueKind.Object

1004 && output.GetProperty("type").GetString() == "computer_screenshot")

1005 {

1006 const string prefix = "data:image/jpeg;base64,";

1007 string imageUrl = output.GetProperty("image_url").GetString()!;

1008 if (imageUrl.StartsWith(prefix, StringComparison.Ordinal))

1009 {

1010 lastScreenshot = Convert.FromBase64String(imageUrl[prefix.Length..]);

1011 }

1012 }

1013 }

935 else if (type == "agent.session.turn.output_text.done")1014 else if (type == "agent.session.turn.output_text.done")

936 {1015 {

937 Console.WriteLine(current.GetProperty("text").GetString());1016 Console.WriteLine(current.GetProperty("text").GetString());


967```1046```

968 1047 

969```ruby1048```ruby

1049last_screenshot = String.new(encoding: Encoding::BINARY)

970handled_requests = Set.new1050handled_requests = Set.new

971events = client.beta.agents.sessions.events.stream_streaming(session.id)1051events = client.beta.agents.sessions.events.stream_streaming(session.id)

972begin1052begin


1001 handled_requests.add(approval.request_id)1081 handled_requests.add(approval.request_id)

1002 end1082 end

1003 false1083 false

1084 when OpenAI::Beta::AgentSessionTurnItemDoneEvent

1085 # Preserve streamed screenshots; retrieved history may omit image bytes.

1086 item = event.item

1087 if item.is_a?(OpenAI::Beta::AgentOutputItem::ComputerUseCall)

1088 output = item.output

1089 if output&.type.to_s == "computer_screenshot"

1090 prefix = "data:image/jpeg;base64,"

1091 if output.image_url.start_with?(prefix)

1092 last_screenshot.replace(Base64.strict_decode64(output.image_url.delete_prefix(prefix)))

1093 end

1094 end

1095 end

1096 false

1004 when OpenAI::Beta::AgentSessionTurnOutputTextDoneEvent1097 when OpenAI::Beta::AgentSessionTurnOutputTextDoneEvent

1005 puts event.text1098 puts event.text

1006 when OpenAI::Beta::AgentSessionTurnCompletedEvent1099 when OpenAI::Beta::AgentSessionTurnCompletedEvent


1055to `true` on the `computer_use` tool. Screenshots are excluded from API output1148to `true` on the `computer_use` tool. Screenshots are excluded from API output

1056by default; the agent can still observe them.1149by default; the agent can still observe them.

1057 1150 

1058Each browser operation returns its last emitted screenshot in `output`, when1151A completed browser activity event includes its last emitted screenshot in

1059available:1152`item.output`, when available:

1060 1153 

1061```json1154```json

1062{1155{


1072Screenshots can contain sensitive page or account data. Show them only to1165Screenshots can contain sensitive page or account data. Show them only to

1073 authorized users and keep them out of application logs.1166 authorized users and keep them out of application logs.

1074 1167 

1075Retrieve saved browser activity after the turn completes. The SDK examples save1168Capture available screenshots from `agent.session.turn.item.done` events while

1076the latest available screenshot to `browser-screenshot.jpg`.1169consuming the stream. Retrieved history can omit image bytes, so retain the image

1170in your application rather than relying on a later items-list request. After the

1171turn completes, the SDK examples list browser activity and save the latest captured

1172screenshot. Most use `browser-screenshot.jpg`; Java uses a temporary file.

1077 1173 

1078Read browser activity1174Read browser activity

1079 1175 

1080```bash1176```bash

1177# Screenshot bytes are retained in the private event stream file printed in terminal 1.

1178# Keep that file: saved history may omit image bytes.

1081# Save the first page privately; image data stays out of terminal output.1179# Save the first page privately; image data stays out of terminal output.

1082activity_file=$(mktemp)1180activity_file=$(mktemp)

1083curl --silent --show-error --fail-with-body --get \1181curl --silent --show-error --fail-with-body --get \


1098```1196```

1099 1197 

1100```javascript1198```javascript

1101let screenshot;

1102for await (const item of client.beta.agents.sessions.items.list(session.id, {1199for await (const item of client.beta.agents.sessions.items.list(session.id, {

1103 order: "asc",1200 order: "asc",

1104 limit: 100,1201 limit: 100,

1105})) {1202})) {

1106 if (item.type !== "computer_use_call") continue;1203 if (item.type !== "computer_use_call") continue;

1107 console.log(item.title ?? "Browser activity", item.status);1204 console.log(item.title ?? "Browser activity", item.status);

1108 const output = item.output;

1109 if (

1110 output?.type === "computer_screenshot" &&

1111 output.image_url.startsWith("data:image/jpeg;base64,")

1112 ) {

1113 screenshot = Buffer.from(output.image_url.split(",", 2)[1], "base64");

1114 }

1115}1205}

1116if (screenshot) {1206if (screenshot) {

1117 const file = await open("browser-screenshot.jpg", "wx", 0o600);1207 const file = await open("browser-screenshot.jpg", "wx", 0o600);


1127```1217```

1128 1218 

1129```python1219```python

1130last_screenshot = None

1131for item in client.beta.agents.sessions.items.list(1220for item in client.beta.agents.sessions.items.list(

1132 session.id, order="asc", limit=1001221 session.id, order="asc", limit=100

1133):1222):

1134 if item.type != "computer_use_call":1223 if item.type != "computer_use_call":

1135 continue1224 continue

1136 print(item.title or "Browser activity", item.status)1225 print(item.title or "Browser activity", item.status)

1137 output = getattr(item, "output", None)

1138 if output is not None and output.type == "computer_screenshot":

1139 prefix = "data:image/jpeg;base64,"

1140 if output.image_url.startswith(prefix):

1141 last_screenshot = base64.b64decode(

1142 output.image_url[len(prefix) :], validate=True

1143 )

1144 1226 

1145if last_screenshot is not None:1227if last_screenshot is not None:

1146 screenshot_path = Path("browser-screenshot.jpg")1228 screenshot_path = Path("browser-screenshot.jpg")


1156```1238```

1157 1239 

1158```go1240```go

1159var lastScreenshot []byte

1160items := client.Beta.Agents.Sessions.Items.ListAutoPaging(ctx, session.ID, openai.BetaAgentSessionItemListParams{1241items := client.Beta.Agents.Sessions.Items.ListAutoPaging(ctx, session.ID, openai.BetaAgentSessionItemListParams{

1161 Order: "asc", Limit: openai.Int(100),1242 Order: "asc", Limit: openai.Int(100),

1162})1243})


1171 title = "Browser activity"1252 title = "Browser activity"

1172 }1253 }

1173 fmt.Println(title, activity.Status)1254 fmt.Println(title, activity.Status)

1174 if !activity.JSON.Output.Valid() || activity.Output.Type != "computer_screenshot" {

1175 continue

1176 }

1177 const prefix = "data:image/jpeg;base64,"

1178 if strings.HasPrefix(activity.Output.ImageURL, prefix) {

1179 lastScreenshot, err = base64.StdEncoding.DecodeString(strings.TrimPrefix(activity.Output.ImageURL, prefix))

1180 if err != nil {

1181 return err

1182 }

1183 }

1184}1255}

1185if err := items.Err(); err != nil {1256if err := items.Err(); err != nil {

1186 return err1257 return err


1205```1276```

1206 1277 

1207```java1278```java

1208byte[] lastScreenshot = null;

1209var items =1279var items =

1210 client1280 client

1211 .beta()1281 .beta()


1222 if (item.computerUseCall().isEmpty()) continue;1292 if (item.computerUseCall().isEmpty()) continue;

1223 var activity = item.computerUseCall().get();1293 var activity = item.computerUseCall().get();

1224 System.out.println(activity.title().orElse("Browser activity") + " " + activity.status());1294 System.out.println(activity.title().orElse("Browser activity") + " " + activity.status());

1225 var output = activity.output();

1226 if (output.isPresent()) {

1227 String imageUrl = output.get().imageUrl();

1228 String prefix = "data:image/jpeg;base64,";

1229 if (imageUrl.startsWith(prefix)) {

1230 lastScreenshot = Base64.getDecoder().decode(imageUrl.substring(prefix.length()));

1231 }

1232 }

1233}1295}

1234if (lastScreenshot != null) {1296if (lastScreenshot != null) {

1235 var screenshotPath = Files.createTempFile("browser-screenshot-", ".jpg");1297 var screenshotPath = Files.createTempFile("browser-screenshot-", ".jpg");


1241```1303```

1242 1304 

1243```csharp1305```csharp

1244byte[]? lastScreenshot = null;

1245await foreach (AgentSessionItem item in client.GetAgentSessionItemsAsync(1306await foreach (AgentSessionItem item in client.GetAgentSessionItemsAsync(

1246 session.Id, limit: 100, order: AgentSessionItemCollectionOrder.Ascending))1307 session.Id, limit: 100, order: AgentSessionItemCollectionOrder.Ascending))

1247{1308{


1250 continue;1311 continue;

1251 }1312 }

1252 Console.WriteLine($"{activity.Title ?? "Browser activity"}: {activity.Status}");1313 Console.WriteLine($"{activity.Title ?? "Browser activity"}: {activity.Status}");

1253 if (activity.Output is ComputerUseOutputResourceComputerScreenshot screenshot)1314 

1254 {

1255 const string prefix = "data:image/jpeg;base64,";

1256 if (screenshot.ImageUrl.StartsWith(prefix, StringComparison.Ordinal))

1257 {

1258 lastScreenshot = Convert.FromBase64String(screenshot.ImageUrl[prefix.Length..]);

1259 }

1260 }

1261}1315}

1262if (lastScreenshot is not null)1316if (lastScreenshot is not null)

1263{1317{


1286```1340```

1287 1341 

1288```ruby1342```ruby

1289last_screenshot = String.new(encoding: Encoding::BINARY)

1290items = client.beta.agents.sessions.items.list(1343items = client.beta.agents.sessions.items.list(

1291 session.id,1344 session.id,

1292 order: "asc",1345 order: "asc",

1293 limit: 1001346 limit: 100

1294)1347)

1295items.auto_paging_each do |item|1348items.auto_paging_each do |item|

1296 next unless item.is_a?(OpenAI::Beta::AgentComputerUseCallItem)1349 next unless item.is_a?(OpenAI::Beta::AgentSessionItem::ComputerUseCall)

1297 1350 

1298 puts "#{item.title || "Browser activity"}: #{item.status}"1351 puts "#{item.title || "Browser activity"}: #{item.status}"

1299 output = item.output

1300 if output&.type.to_s == "computer_screenshot"

1301 prefix = "data:image/jpeg;base64,"

1302 if output.image_url.start_with?(prefix)

1303 last_screenshot.replace(Base64.strict_decode64(output.image_url.delete_prefix(prefix)))

1304 end

1305 end

1306end1352end

1307 1353 

1308if last_screenshot.empty?1354if last_screenshot.empty?

Details

40![Diagram showing an agent harness running inside sandbox compute with filesystem access and gateway-mediated access to data, APIs, and the web.](<https://developers.openai.com/images/api/agents/harness_with_compute.png>)40![Diagram showing an agent harness running inside sandbox compute with filesystem access and gateway-mediated access to data, APIs, and the web.](<https://developers.openai.com/images/api/agents/harness_with_compute.png>)

41 41 

42 42 

43 <figcaption className="mt-3 text-sm text-gray-600 dark:text-gray-400">43 <figcaption className="mt-3 text-sm text-secondary">

44 Running the harness inside the sandbox can be convenient for prototypes,44 Running the harness inside the sandbox can be convenient for prototypes,

45 but it puts orchestration and model-directed execution in the same compute45 but it puts orchestration and model-directed execution in the same compute

46 boundary.46 boundary.


53![Diagram showing an agent harness separate from sandbox compute, where the harness accesses trusted services and the sandbox executes commands against a filesystem.](<https://developers.openai.com/images/api/agents/harness_separate_from_compute.png>)53![Diagram showing an agent harness separate from sandbox compute, where the harness accesses trusted services and the sandbox executes commands against a filesystem.](<https://developers.openai.com/images/api/agents/harness_separate_from_compute.png>)

54 54 

55 55 

56 <figcaption className="mt-3 text-sm text-gray-600 dark:text-gray-400">56 <figcaption className="mt-3 text-sm text-secondary">

57 The harness can run in your infrastructure while the sandbox handles57 The harness can run in your infrastructure while the sandbox handles

58 provider-specific, stateful execution.58 provider-specific, stateful execution.

59 </figcaption>59 </figcaption>

Details

710```710```

711 711 

712 712 

713In the following example, we ask the model to tell a joke. Separately, we ask the model to explain why it's funny, and the model has all necessary context to deliver a good response.

714 

715 

716 Manually manage conversation state with the Responses API

717 

718```javascript

719import OpenAI from "openai";

720 

721const openai = new OpenAI();

722 

723const response = await openai.responses.create({

724 model: "gpt-6-astra",

725 input: "tell me a joke",

726 store: true,

727});

728 

729console.log(response.output_text);

730 

731const secondResponse = await openai.responses.create({

732 model: "gpt-6-astra",

733 previous_response_id: response.id,

734 input: [{ role: "user", content: "explain why this is funny." }],

735 store: true,

736});

737 

738console.log(secondResponse.output_text);

739```

740 

741```python

742from openai import OpenAI

743 

744client = OpenAI()

745 

746response = client.responses.create(

747 model="gpt-6-astra",

748 input="tell me a joke",

749)

750print(response.output_text)

751 

752second_response = client.responses.create(

753 model="gpt-6-astra",

754 previous_response_id=response.id,

755 input=[{"role": "user", "content": "explain why this is funny."}],

756)

757print(second_response.output_text)

758```

759 

760```go

761package main

762 

763import (

764 "context"

765 "fmt"

766 

767 "github.com/openai/openai-go/v3"

768 "github.com/openai/openai-go/v3/responses"

769)

770 

771func main() {

772 client := openai.NewClient()

773 

774 first, err := client.Responses.New(context.Background(), responses.ResponseNewParams{

775 Model: "gpt-6-astra",

776 Input: responses.ResponseNewParamsInputUnion{

777 OfString: openai.String("Tell me a joke."),

778 },

779 })

780 if err != nil {

781 panic(err)

782 }

783 fmt.Println(first.OutputText())

784 

785 second, err := client.Responses.New(context.Background(), responses.ResponseNewParams{

786 Model: "gpt-6-astra",

787 PreviousResponseID: openai.String(first.ID),

788 Input: responses.ResponseNewParamsInputUnion{

789 OfString: openai.String("Explain why this is funny."),

790 },

791 })

792 if err != nil {

793 panic(err)

794 }

795 fmt.Println(second.OutputText())

796}

797```

798 

799```java

800import com.openai.client.OpenAIClient;

801import com.openai.client.okhttp.OpenAIOkHttpClient;

802import com.openai.models.responses.ResponseCreateParams;

803 

804var first =

805 client

806 .responses()

807 .create(

808 ResponseCreateParams.builder().model("gpt-6-astra").input("Tell me a joke.").build());

809 

810first.output().stream()

811 .flatMap(item -> item.message().stream())

812 .flatMap(message -> message.content().stream())

813 .flatMap(content -> content.outputText().stream())

814 .forEach(text -> System.out.println(text.text()));

815 

816var second =

817 client

818 .responses()

819 .create(

820 ResponseCreateParams.builder()

821 .model("gpt-6-astra")

822 .input("Explain why this is funny.")

823 .previousResponseId(first.id())

824 .build());

825second.output().stream()

826 .flatMap(item -> item.message().stream())

827 .flatMap(message -> message.content().stream())

828 .flatMap(content -> content.outputText().stream())

829 .forEach(text -> System.out.println(text.text()));

830```

831 

832```csharp

833using OpenAI.Responses;

834#pragma warning disable OPENAI001

835 

836string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

837ResponsesClient client = new(key);

838 

839ResponseResult first = await client.CreateResponseAsync(

840 "gpt-6-astra",

841 "Tell me a joke."

842);

843Console.WriteLine(first.GetOutputText());

844 

845ResponseResult second = await client.CreateResponseAsync(

846 "gpt-6-astra",

847 "Explain why this is funny.",

848 previousResponseId: first.Id

849);

850Console.WriteLine(second.GetOutputText());

851```

852 

853```ruby

854require "openai"

855 

856client = OpenAI::Client.new

857 

858first = client.responses.create(

859 model: "gpt-6-astra",

860 input: "Tell me a joke."

861)

862puts(first.output_text)

863 

864second = client.responses.create(

865 model: "gpt-6-astra",

866 previous_response_id: first.id,

867 input: "Explain why this is funny."

868)

869puts(second.output_text)

870```

871 

872 

873#### `previous_response_id` in WebSocket mode713#### `previous_response_id` in WebSocket mode

874 714 

875If you are using [the Responses API WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode), continuation uses the same `previous_response_id` semantics as HTTP mode, but over a persistent socket with repeated `response.create` events.715If you are using [the Responses API WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode), continuation uses the same `previous_response_id` semantics as HTTP mode, but over a persistent socket with repeated `response.create` events.

Details

66 client := openai.NewClient()66 client := openai.NewClient()

67 response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{67 response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{

68 Prompt: responses.ResponsePromptParam{68 Prompt: responses.ResponsePromptParam{

69 // Replace with your published prompt ID.

69 ID: "pmpt_123",70 ID: "pmpt_123",

70 Version: openai.String("1"),71 Version: openai.String("1"),

71 Variables: map[string]responses.ResponsePromptVariableUnionParam{72 Variables: map[string]responses.ResponsePromptVariableUnionParam{