「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfrastructure.osscons.jp]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。
-[[戻る>テキスト生成系(Transformer系)]] > [[開発系>テキスト生成系(Transformer系)#cf2e3279]]
--[[OpenAI]]
---[[ChatGPT]]
---OpenAI API
---[[Library>OpenAI#w24acc85]]
---[[Agents SDK>OpenAI Agents SDK]]
--[[Azure OpenAI>https://techinfoofmicrosofttech.osscons.jp/index.php?Azure%20OpenAI%20Service]]
--[[OSSのLLM]]
--[[LLM系ツール]]
*目次 [#o82d3647]
#contents
*概要 [#w2f67522]
大規模言語モデルを利用できる(Web)APIサービス
*詳細 [#va33a5cb]
**準備 [#w2280b16]
ログインして「[[Billing>#b15c0026]]」から課金して、WebAPIキーを取得[[&設定>WSL2 Ubuntu 24.04 LTS 2025/1/21#w5d92061]]するだけで良い。
**実行 [#ra914dbd]
***curl [#q016ccab]
curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4.1",
"input": "Tell me a three sentence bedtime story about a unicorn."
}'
***python [#t825a87f]
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4.1",
input="Tell me a three sentence bedtime story about a unicorn."
)
print(response)
*参考 [#b15c0026]
-https://platform.openai.com
--Playground~
https://platform.openai.com/playground/chat
--Dashboard~
https://platform.openai.com/chat-completions
--Docs~
https://platform.openai.com/docs/overview
--API reference~
https://platform.openai.com/docs/api-reference/introduction
--Settings
---Billing overview - OpenAI API~
https://platform.openai.com/settings/organization/billing/overview
-OpenAIのAPIキー取得方法|2024年7月最新版|料金体系や注意事項 #DALLE - Qiita~
https://qiita.com/kurata04/items/a10bdc44cc0d1e62dad3