Skip to content

Commit

Permalink
docs: update files by using obsidian
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSM0518 committed Nov 25, 2024
1 parent 085ab3b commit 301a4b6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions _posts/2024-11-24-openai-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: OpenAI API Documents
date: 2024-11-25 13:00:00 +0900
categories: openai
tags:
- openai
- docs
- api
description: OpenAI의 API를 활용하기 위한 가이드 문서 정리
---
## 1. 빠른 시작

### 1.1. 개발자를 위한 빠른 시작

OpenAI API는 자연어 처리, 이미지 생성, 의미 검색, 음성 인식을 위한 API를 제공한다.

다음 과정을 통해 첫 번째 API 요청을 하는 방법을 알아보자.

1. [Billing 페이지](https://platform.openai.com/settings/organization/billing/overview)에서 카드를 등록한다.
![chatgpt4](/assets/img/chatgpt4.png)
![chatgpt5](/assets/img/chatgpt5.png)
1. [Dashboard 페이지](https://platform.openai.com/api-keys)에서 키를 생성한다.
![chatgpt1](/assets/img/chatgpt1.png)
![chatgpt2](/assets/img/chatgpt2.png)
![chatgpt3](/assets/img/chatgpt3.png)
3. 다음 명령어를 통해 API를 호출한다.
```bash
curl "https://api.openai.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku that explains the concept of recursion."
}
]
}'
```

Binary file added assets/img/chatgpt1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/chatgpt2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/chatgpt3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/chatgpt4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/chatgpt5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 301a4b6

Please sign in to comment.