@@ -36,7 +36,7 @@ client = OpenAI(
3636)
3737
3838response = client.responses.create(
39- model = " gpt-5.2 " ,
39+ model = " gpt-5.5 " ,
4040 instructions = " You are a coding assistant that talks like a pirate." ,
4141 input = " How do I check if a Python object is an instance of a class?" ,
4242)
@@ -52,7 +52,7 @@ from openai import OpenAI
5252client = OpenAI()
5353
5454completion = client.chat.completions.create(
55- model = " gpt-5.2 " ,
55+ model = " gpt-5.5 " ,
5656 messages = [
5757 {" role" : " developer" , " content" : " Talk like a pirate." },
5858 {
@@ -92,7 +92,7 @@ client = OpenAI(
9292)
9393
9494response = client.chat.completions.create(
95- model = " gpt-4 " ,
95+ model = " gpt-5.5 " ,
9696 messages = [{" role" : " user" , " content" : " Hello!" }],
9797)
9898```
@@ -176,7 +176,7 @@ prompt = "What is in this image?"
176176img_url = " https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/1599px-2023_06_08_Raccoon1.jpg"
177177
178178response = client.responses.create(
179- model = " gpt-5.2 " ,
179+ model = " gpt-5.5 " ,
180180 input = [
181181 {
182182 " role" : " user" ,
@@ -202,7 +202,7 @@ with open("path/to/image.png", "rb") as image_file:
202202 b64_image = base64.b64encode(image_file.read()).decode(" utf-8" )
203203
204204response = client.responses.create(
205- model = " gpt-5.2 " ,
205+ model = " gpt-5.5 " ,
206206 input = [
207207 {
208208 " role" : " user" ,
@@ -232,7 +232,7 @@ client = AsyncOpenAI(
232232
233233async def main () -> None :
234234 response = await client.responses.create(
235- model = " gpt-5.2 " , input = " Explain disestablishmentarianism to a smart five year old."
235+ model = " gpt-5.5 " , input = " Explain disestablishmentarianism to a smart five year old."
236236 )
237237 print (response.output_text)
238238
@@ -274,7 +274,7 @@ async def main() -> None:
274274 " content" : " Say this is a test" ,
275275 }
276276 ],
277- model = " gpt-5.2 " ,
277+ model = " gpt-5.5 " ,
278278 )
279279
280280
@@ -291,7 +291,7 @@ from openai import OpenAI
291291client = OpenAI()
292292
293293stream = client.responses.create(
294- model = " gpt-5.2 " ,
294+ model = " gpt-5.5 " ,
295295 input = " Write a one-sentence bedtime story about a unicorn." ,
296296 stream = True ,
297297)
@@ -311,7 +311,7 @@ client = AsyncOpenAI()
311311
312312async def main ():
313313 stream = await client.responses.create(
314- model = " gpt-5.2 " ,
314+ model = " gpt-5.5 " ,
315315 input = " Write a one-sentence bedtime story about a unicorn." ,
316316 stream = True ,
317317 )
@@ -340,7 +340,7 @@ from openai import AsyncOpenAI
340340async def main ():
341341 client = AsyncOpenAI()
342342
343- async with client.realtime.connect(model = " gpt-realtime" ) as connection:
343+ async with client.realtime.connect(model = " gpt-realtime-2 " ) as connection:
344344 await connection.session.update(
345345 session = {" type" : " realtime" , " output_modalities" : [" text" ]}
346346 )
@@ -376,7 +376,7 @@ Whenever an error occurs, the Realtime API will send an [`error` event](https://
376376``` py
377377client = AsyncOpenAI()
378378
379- async with client.realtime.connect(model = " gpt-realtime" ) as connection:
379+ async with client.realtime.connect(model = " gpt-realtime-2 " ) as connection:
380380 ...
381381 async for event in connection:
382382 if event.type == ' error' :
@@ -475,15 +475,15 @@ from openai import OpenAI
475475
476476client = OpenAI()
477477
478- response = client.chat. responses.create(
478+ response = client.responses.create(
479479 input = [
480480 {
481481 " role" : " user" ,
482482 " content" : " How much ?" ,
483483 }
484484 ],
485- model = " gpt-5.2 " ,
486- response_format = {" type" : " json_object" },
485+ model = " gpt-5.5 " ,
486+ text = {" format " : { " type" : " json_object" } },
487487)
488488```
489489
@@ -637,7 +637,7 @@ All object responses in the SDK provide a `_request_id` property which is added
637637
638638``` python
639639response = await client.responses.create(
640- model = " gpt-5.2 " ,
640+ model = " gpt-5.5 " ,
641641 input = " Say 'this is a test'." ,
642642)
643643print (response._request_id) # req_123
@@ -655,7 +655,7 @@ import openai
655655
656656try :
657657 completion = await client.chat.completions.create(
658- messages = [{" role" : " user" , " content" : " Say this is a test" }], model = " gpt-5.2 "
658+ messages = [{" role" : " user" , " content" : " Say this is a test" }], model = " gpt-5.5 "
659659 )
660660except openai.APIStatusError as exc:
661661 print (exc.request_id) # req_123
@@ -687,7 +687,7 @@ client.with_options(max_retries=5).chat.completions.create(
687687 " content" : " How can I get the name of the current day in JavaScript?" ,
688688 }
689689 ],
690- model = " gpt-5.2 " ,
690+ model = " gpt-5.5 " ,
691691)
692692```
693693
@@ -718,7 +718,7 @@ client.with_options(timeout=5.0).chat.completions.create(
718718 " content" : " How can I list all files in a directory using Python?" ,
719719 }
720720 ],
721- model = " gpt-5.2 " ,
721+ model = " gpt-5.5 " ,
722722)
723723```
724724
@@ -765,7 +765,7 @@ response = client.chat.completions.with_raw_response.create(
765765 " role" : " user" ,
766766 " content" : " Say this is a test" ,
767767 }],
768- model = " gpt-5.2 " ,
768+ model = " gpt-5.5 " ,
769769)
770770print (response.headers.get(' X-My-Header' ))
771771
@@ -798,7 +798,7 @@ with client.chat.completions.with_streaming_response.create(
798798 " content" : " Say this is a test" ,
799799 }
800800 ],
801- model = " gpt-5.2 " ,
801+ model = " gpt-5.5 " ,
802802) as response:
803803 print (response.headers.get(" X-My-Header" ))
804804
0 commit comments