如何访问gpt api?
·
www.gpt516.com
https://one.aiskt.com/token
代码:
from openai import OpenAI
api_key = "sk-189I1Oj2NleZ3tbg4d32D3D9E2Ab4525Bd84A492"
api_base = "https://api.aiskt.com/v1"
client = OpenAI(api_key=api_key, base_url=api_base)
completion = client.chat.completions.create(
model="gpt-3.5-turbo-16k-0613",
messages=[
{"role": "system", "content": "你好,你是什么模型,你叫什么名字,你是被谁开发的"},
# {"role": "user", "content": "你好,你是什么模型"}
]
)
print(completion.choices[0].message)
更多推荐

所有评论(0)