typescript/index.md +31 −0
69console.log(completion.choices[0].message.content);69console.log(completion.choices[0].message.content);
70```70```
71 71
72## Vision
73
74Use the Responses API to analyze images and generate text about visual content.
75
76```ts
77import OpenAI from 'openai';
78
79const client = new OpenAI({
80 apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
81});
82
83const response = await client.responses.create({
84 model: 'gpt-5.5',
85 input: [
86 {
87 role: 'user',
88 content: [
89 { type: 'input_text', text: 'What is in this image?' },
90 {
91 type: 'input_image',
92 image_url:
93 'https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg',
94 },
95 ],
96 },
97 ],
98});
99
100console.log(response.output_text);
101```
102
72## Workload Identity Authentication103## Workload Identity Authentication
73 104
74For secure, automated environments like cloud-managed Kubernetes, Azure, and GCP, you can use workload identity authentication with short-lived tokens from cloud identity providers instead of long-lived API keys.105For secure, automated environments like cloud-managed Kubernetes, Azure, and GCP, you can use workload identity authentication with short-lived tokens from cloud identity providers instead of long-lived API keys.