1.阅读API文档
- 官方文档:https://platform.openai.com/docs/quickstart
- 查看token额度:https://platform.openai.com/settings/organization/billing/overview
2.尝试代码调用
import openai
openai.api_key = "OPENAI_API_KEY"
completion = openai.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{