https://platform.openai.com/account/
https://platform.openai.com/account/billing/overview
Set up paid account → I'm an individual
https://platform.openai.com/account/billing/limits
https://platform.openai.com/account/api-keys
POST https://api.openai.com/v1/chat/completions
Content-Type: application/json
Authorization: Bearer sk-....
{
"model": "gpt-3.5-turbo",
"messages": [{
"role": "user",
"content": "Please tell me 10 delicious dishes that have been trending in the past year."
}]
}
Response
{
"id": "chatcmpl-6....m",
"object": "chat.completion",
"created": 1678513287,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 32,
"completion_tokens": 483,
"total_tokens": 515
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\n1. Dalgona Coffee - A latte-style drink made by pouring a frothy mixture of coffee, sugar, and water over milk.\n2. Sweet Potato Toast - A sweet dish featuring sweet potato paste, marshmallows, and caramel sauce on toast.\n3. Homemade Yakiniku - A popular dish for home parties and family gatherings, where you can easily make yakiniku at home.\n4. Overnight Oats - A breakfast drink made by mixing oats and almond milk and letting it sit overnight.\n5. Quinoa Balls - A snack made by mixing quinoa and nuts with dates and shaping them into balls.\n6. Tarte aux Fraises - A French tart topped with fruit.\n7. Vegan Seafood - Vegan food designed to mimic seafood.\n8. Marshmallow Brown - A s'mores-style dessert made with chocolate, marshmallows, and graham crackers.\n9. Superfood Smoothie - A smoothie mixed with healthy superfoods.\n10. Hot Pot - A traditional Asian dish where raw meat and vegetables are cooked in hot soup."
},
"finish_reason": "stop",
"index": 0
}
]
}
$0.002 (approximately 0.3 yen) / 1K tokens So, for this one request, it costs about 0.15 yen.
I think it depends on the model, but it is significantly slower than using it on the web.
https://platform.openai.com/docs/api-reference/chat/create
Comments