OpenAI의 플래그십 멀티모달 모델입니다. 추론, 코딩, 창의적 작업에서 업계 최고 성능을 제공하며, 네이티브 비전 기능과 구조화된 출력을 지원합니다.
| 토큰 종류 | 크레딧 | 달러 환산 |
|---|---|---|
| 입력 토큰 | 2,500 | $2.50 |
| 출력 토큰 | 10,000 | $10.00 |
| 캐시된 토큰 | 1,250 | $1.25 |
* 1 크레딧 ≈ $0.001 (실제 요금은 사용량에 따라 달라질 수 있습니다)
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"temperature": 0.7,
"max_tokens": 1000
}
}'| 파라미터 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
messages | array | Yes | - | role과 content를 포함한 메시지 객체 배열 |
model | string | Yes | gpt-4o | 모델 식별자 |
temperature | float | No | 1.0 | 샘플링 온도 (0-2). 낮을수록 집중적, 높을수록 창의적 |
max_tokens | integer | No | 4096 | 응답의 최대 토큰 수 (최대 16384) |
stream | boolean | No | false | Server-Sent Events 스트리밍 활성화 |
response_format | object | No | - | 응답 형식: JSON 모드의 경우 { type: 'json_object' } |
tools | array | No | - | 모델이 호출할 수 있는 도구(함수) 목록 |
top_p | float | No | 1.0 | 핵 샘플링 임계값 (0-1) |
모델과의 간단한 대화
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"temperature": 0.7,
"max_tokens": 1000
}
}'설명과 함께 Python 코드 생성
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are an expert Python developer. Write clean, well-documented code."
},
{
"role": "user",
"content": "Write a Python class for a binary search tree with insert, search, and delete methods."
}
],
"temperature": 0.3,
"max_tokens": 2000
}
}'구조화된 JSON 출력 받기
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a data extraction assistant. Always respond with valid JSON."
},
{
"role": "user",
"content": "Extract the following info from this text: 'John Smith, 35 years old, software engineer at Google, living in San Francisco'. Return as JSON with fields: name, age, job, company, city"
}
],
"response_format": {
"type": "json_object"
},
"max_tokens": 500
}
}'GPT-4o로 이미지 분석
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image? Describe it in detail."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.jpg"
}
}
]
}
],
"max_tokens": 1000
}
}'모델과 함께 도구/함수 사용
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "What's the weather like in Seoul today?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
]
}
}'POST /llm/openai/v1/chat/completions