API Reference
Core.Today API 전체 엔드포인트 레퍼런스
Base URLs
Image/Video:
https://api.core.today/v1LLM (OpenAI):
https://api.core.today/llm/openai/v1LLM (Anthropic):
https://api.core.today/llm/anthropic/v1LLM (Gemini):
https://api.core.today/llm/gemini/v1betaAuthentication
모든 API 요청에는 인증이 필요합니다. 다음 방법 중 하나를 사용하세요:
# X-API-Key 헤더 (권장)
curl -H "X-API-Key: cdt_your_api_key" ...
# Authorization 헤더
curl -H "Authorization: Bearer cdt_your_api_key" ...Endpoints
Predictions
POST
/v1/predictionsAI 모델로 예측(이미지/비디오/오디오 생성) 요청을 생성합니다.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | 모델 ID (예: flux-schnell, kling-v1) |
| input | object | Yes | 모델별 입력 파라미터 |
| is_public | boolean | No | true면 영구 public URL 생성 (기본: false) |
| output_folder | string | No | 결과물 저장 폴더 경로 |
| webhook | string | No | 완료 시 호출할 Webhook URL |
| webhook_events | string[] | No | Webhook 이벤트 타입 (completed, failed) |
Example Request
curl -X POST https://api.core.today/v1/predictions \
-H "Content-Type: application/json" \
-H "X-API-Key: $CORE_API_KEY" \
-d '{
"model": "flux-schnell",
"input": {
"prompt": "A beautiful sunset over mountains",
"aspect_ratio": "16:9"
}
}'Response
{
"id": "pred_abc123xyz",
"status": "pending",
"model": "flux-schnell",
"input": {
"prompt": "A beautiful sunset over mountains",
"aspect_ratio": "16:9"
},
"created_at": "2024-12-28T12:00:00Z"
}GET
/v1/predictions/:id예측 작업의 상태와 결과를 조회합니다.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | 예측 작업 ID |
Response (succeeded)
{
"id": "pred_abc123xyz",
"status": "succeeded",
"model": "flux-schnell",
"output": [
"https://cdn.core.today/outputs/abc123/output.png"
],
"metrics": {
"total_time": 2.5,
"queue_time": 0.1,
"run_time": 2.4
},
"created_at": "2024-12-28T12:00:00Z",
"completed_at": "2024-12-28T12:00:03Z"
}Status Values
pending- 대기 중processing- 처리 중succeeded- 성공failed- 실패canceled- 취소됨
DELETE
/v1/predictions/:id진행 중인 예측 작업을 취소합니다.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | 취소할 예측 작업 ID |
Response
{
"id": "pred_abc123xyz",
"status": "canceled",
"message": "Prediction canceled successfully"
}Files
POST
/v1/files/upload-urlS3 presigned upload URL을 발급받습니다.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | string | Yes | 업로드할 파일 이름 |
| content_type | string | No | MIME 타입 (기본: application/octet-stream) |
| folder | string | No | 저장 폴더 경로 |
Example Request
curl -X POST https://api.core.today/v1/files/upload-url \
-H "Content-Type: application/json" \
-H "X-API-Key: $CORE_API_KEY" \
-d '{
"filename": "input.jpg",
"content_type": "image/jpeg",
"folder": "my-project/inputs"
}'Response
{
"upload_url": "https://s3.amazonaws.com/bucket/...",
"file_url": "https://cdn.core.today/files/abc123/input.jpg",
"expires_at": "2024-12-28T13:00:00Z"
}파일 업로드 방법
발급받은 upload_url로 PUT 요청을 보내 파일을 업로드하세요:
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/jpeg" \
--data-binary @input.jpgGET
/v1/files업로드한 파일 목록을 조회합니다.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| folder | string | No | 폴더 경로 필터 |
| limit | integer | No | 반환할 최대 개수 (기본: 20) |
| cursor | string | No | 페이지네이션 커서 |
Databases
POST
/v1/databases새 데이터베이스를 생성합니다.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | 데이터베이스 이름 |
| description | string | No | 설명 |
| schema | object | Yes | 필드 스키마 정의 |
Example Request
{
"name": "products",
"description": "E-commerce product catalog",
"schema": {
"title": { "type": "text" },
"description": { "type": "text" },
"price": { "type": "float" },
"category": { "type": "keyword" },
"embedding": { "type": "knn_vector", "dimension": 768 }
}
}POST
/v1/databases/:uid/search문서를 검색합니다.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | object | Yes | OpenSearch Query DSL |
| size | integer | No | 반환할 결과 수 (기본: 10) |
| from | integer | No | 오프셋 (페이지네이션) |
Example: 전문 검색
{
"query": {
"multi_match": {
"query": "wireless headphones",
"fields": ["title", "description"]
}
},
"size": 20
}Example: 벡터 검색 (kNN)
{
"query": {
"knn": {
"embedding": {
"vector": [0.1, 0.2, ...],
"k": 10
}
}
}
}Error Responses
API 오류 시 다음 형식의 JSON 응답이 반환됩니다:
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits. Required: 5, Available: 2",
"details": {
"required": 5,
"available": 2
}
}
}| HTTP Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | 잘못된 요청 형식 |
| 401 | unauthorized | API 키 없음 또는 유효하지 않음 |
| 402 | insufficient_credits | 크레딧 부족 |
| 404 | not_found | 리소스를 찾을 수 없음 |
| 429 | rate_limit_exceeded | 요청 한도 초과 |
| 500 | internal_error | 서버 내부 오류 |