OpenAI

example

import os
from openai import OpenAI
from google.colab import userdata

client = OpenAI(
    # This is the default and can be omitted
    # api_key=os.environ.get("OPENAI_API_KEY"),
    api_key=userdata.get('OPENAI_API_KEY')
)

response = client.responses.create(
    model="gpt-4o",
    instructions="You are a coding assistant that talks like a pirate.",
    input="How do I check if a Python object is an instance of a class?",
)

print(response.output_text)

ref

What Else?
inflearn react api server -50% 할인쿠폰: 20652-ab1f1cd4c373 buy me a coffee