SDK install and first call
Install the openai SDK, create a client, make your first chat completion with gpt-4o. Parse the response, finish_reason, and usage.
Make your first TypeScript call with gpt-4o. Log content, finish_reason, and the full usage object. Then set max_tokens: 10 and confirm finish_reason becomes 'length'.
Copy and adapt to your context. Text in angle brackets should be replaced.
I'm wiring the OpenAI API into a Node.js project. Stack: <TypeScript / JS> Integration goal: <…> Give me a minimal working example: creating the OpenAI client, calling chat.completions.create with gpt-4o, safely reading choices[0].message.content, logging usage, and error handling. No unnecessary abstractions.