---
slug: "how-to-use-open-ai-chat-gpt-api"
title: "Using the ChatGPT API"
description: "Step-by-step guide to the OpenAI ChatGPT API: account, credit card, billing limit, and API key issuance, with screenshots."
url: "https://www.ytyng.com/en/blog/how-to-use-open-ai-chat-gpt-api"
publish_date: "2023-03-11T05:47:49Z"
created: "2023-03-11T05:47:49Z"
updated: "2026-05-11T12:58:13.291Z"
categories: []
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250708/e3aa3b81e88b42d0b75cb808ef84fb1c.png.webp?width=768"
has_video: true
has_music: true
video_urls: ["https://media.ytyng.net/ytyng-blog/275/featured-video-1.mp4", "https://media.ytyng.net/ytyng-blog/275/featured-video-2.mp4", "https://media.ytyng.net/ytyng-blog/275/featured-video-3.mp4"]
music_urls: ["https://media.ytyng.net/ytyng-blog/275/featured-music-275-3.mp3", "https://media.ytyng.net/ytyng-blog/275/featured-music-275-4.mp3"]
lang: "en"
---

# Using the ChatGPT API

## Creating an OpenAI Account
https://platform.openai.com/account/

## Registering a Credit Card
https://platform.openai.com/account/billing/overview

![Image](https://media.ytyng.com/20230311/fb789958c01e47ca9d0f32e299219e2a.png)

Set up paid account → I'm an individual

### Setting a Payment Limit Just in Case
https://platform.openai.com/account/billing/limits

![Image](https://media.ytyng.com/20230311/cc62871df7e14a689d36c241024ee74c.png)

## Creating an API Key
https://platform.openai.com/account/api-keys

![Image](https://media.ytyng.com/20230311/6a34dfc12d1a43be98d7ae3300ffd795.png)

## Making a Request with Rest Client
```http
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
```json
{
  "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
    }
  ]
}
```

## Pricing
$0.002 (approximately 0.3 yen) / 1K tokens
So, for this one request, it costs about 0.15 yen.

## Impressions
I think it depends on the model, but it is significantly slower than using it on the web.

## API Documentation
https://platform.openai.com/docs/api-reference/chat/create
