{
  "openapi": "3.1.0",
  "info": {
    "title": "Doubao Seed 2.0 빠른 시작",
    "description": "Doubao Seed 2.0 채팅 인터페이스 빠른 시작, 5분 만에 첫 번째 AI 채팅 호출 완료",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://direct.evolink.ai",
      "description": "프로덕션 (권장)"
    },
    {
      "url": "https://api.evolink.ai",
      "description": "대체 URL"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "summary": "Doubao Seed 2.0 빠른 채팅",
        "description": "- OpenAI SDK 형식으로 Doubao Seed 2.0 시리즈 모델 호출\n- 동기 처리 모드, 실시간 응답\n- 최소한의 매개변수로 빠르게 시작\n- 지원 모델: `doubao-seed-2.0-pro`, `doubao-seed-2.0-lite`, `doubao-seed-2.0-mini`, `doubao-seed-2.0-code`\n- 더 많은 기능이 필요하신가요? [전체 API 레퍼런스](/ko/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-reference)를 확인하세요",
        "operationId": "createChatCompletionQuickDoubaoSeed20",
        "tags": [
          "채팅 생성"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionQuickRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "채팅 생성 성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            }
          },
          "400": {
            "description": "요청 매개변수 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 400,
                    "message": "Invalid request parameters",
                    "type": "invalid_request_error"
                  }
                }
              }
            }
          },
          "401": {
            "description": "인증되지 않음, 토큰이 유효하지 않거나 만료됨",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 401,
                    "message": "Invalid or expired token",
                    "type": "authentication_error"
                  }
                }
              }
            }
          },
          "402": {
            "description": "할당량 부족, 충전 필요",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 402,
                    "message": "Insufficient quota",
                    "type": "insufficient_quota_error",
                    "fallback_suggestion": "https://evolink.ai/dashboard/credits"
                  }
                }
              }
            }
          },
          "403": {
            "description": "접근 권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 403,
                    "message": "Access denied for this model",
                    "type": "permission_error",
                    "param": "model"
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스를 찾을 수 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 404,
                    "message": "Specified model not found",
                    "type": "not_found_error",
                    "param": "model",
                    "fallback_suggestion": "doubao-seed-2.0-pro"
                  }
                }
              }
            }
          },
          "429": {
            "description": "요청 빈도 초과",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 429,
                    "message": "Rate limit exceeded",
                    "type": "rate_limit_error",
                    "fallback_suggestion": "retry after 60 seconds"
                  }
                }
              }
            }
          },
          "500": {
            "description": "서버 내부 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 500,
                    "message": "Internal server error",
                    "type": "internal_server_error",
                    "fallback_suggestion": "try again later"
                  }
                }
              }
            }
          },
          "502": {
            "description": "업스트림 서비스 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 502,
                    "message": "Upstream AI service unavailable",
                    "type": "upstream_error",
                    "fallback_suggestion": "try different model"
                  }
                }
              }
            }
          },
          "503": {
            "description": "서비스 일시적으로 사용 불가",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 503,
                    "message": "Service temporarily unavailable",
                    "type": "service_unavailable_error",
                    "fallback_suggestion": "retry after 30 seconds"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChatCompletionQuickRequest": {
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "채팅 모델 이름\n\n- `doubao-seed-2.0-pro`: 플래그십 버전, 종합 능력 최강, 복잡한 추론 및 고품질 생성에 적합\n- `doubao-seed-2.0-lite`: 경량 버전, 더 빠른 속도, 높은 가성비\n- `doubao-seed-2.0-mini`: 초고속 버전, 가장 빠른 응답, 간단한 작업에 적합\n- `doubao-seed-2.0-code`: 코드 전용 버전, 코드 생성 및 이해에 최적화",
            "enum": [
              "doubao-seed-2.0-pro",
              "doubao-seed-2.0-lite",
              "doubao-seed-2.0-mini",
              "doubao-seed-2.0-code"
            ],
            "default": "doubao-seed-2.0-pro",
            "example": "doubao-seed-2.0-pro"
          },
          "messages": {
            "type": "array",
            "description": "채팅 메시지 목록",
            "items": {
              "$ref": "#/components/schemas/MessageSimple"
            },
            "minItems": 1,
            "example": [
              {
                "role": "user",
                "content": "안녕하세요, Doubao Seed 2.0의 새로운 기능을 소개해 주세요"
              }
            ]
          }
        }
      },
      "MessageSimple": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "메시지 역할",
            "enum": [
              "user"
            ]
          },
          "content": {
            "type": "string",
            "description": "메시지 내용 (텍스트)"
          }
        }
      },
      "ChatCompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "채팅 완성의 고유 식별자",
            "example": "0217714854126607f5a9cf8ed5b018c76e4ad3dc2810db57ffb50"
          },
          "model": {
            "type": "string",
            "description": "실제 사용된 모델 이름",
            "example": "doubao-seed-2-0-pro-260215"
          },
          "object": {
            "type": "string",
            "enum": [
              "chat.completion"
            ],
            "description": "응답 유형",
            "example": "chat.completion"
          },
          "created": {
            "type": "integer",
            "description": "생성 타임스탬프",
            "example": 1771485416
          },
          "service_tier": {
            "type": "string",
            "description": "이번 요청의 서비스 등급\n\n- `default`: 기본 서비스 등급\n- `scale`: 보장 패키지 할당량 사용",
            "enum": [
              "default",
              "scale"
            ],
            "example": "default"
          },
          "choices": {
            "type": "array",
            "description": "채팅 생성 선택 목록",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "Choice": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "선택 인덱스",
            "example": 0
          },
          "message": {
            "$ref": "#/components/schemas/AssistantMessage"
          },
          "finish_reason": {
            "type": "string",
            "description": "완료 사유",
            "enum": [
              "stop",
              "length",
              "content_filter"
            ],
            "example": "stop"
          },
          "moderation_hit_type": {
            "type": "string",
            "nullable": true,
            "description": "모델 출력 텍스트에 민감한 정보가 포함된 경우, 해당하는 위험 분류 라벨을 반환합니다\n\n- `severe_violation`: 모델 출력 텍스트가 심각한 위반에 해당\n- `violence`: 모델 출력 텍스트가 폭력적 행위에 해당",
            "enum": [
              "severe_violation",
              "violence"
            ]
          }
        }
      },
      "AssistantMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "메시지 발신자의 역할",
            "enum": [
              "assistant"
            ],
            "example": "assistant"
          },
          "content": {
            "type": "string",
            "description": "AI 응답 메시지 내용",
            "example": "안녕하세요! Doubao Seed 2.0은 바이트댄스가 출시한 차세대 대규모 언어 모델로, 더 강력한 추론, 멀티모달 이해 및 심층 사고 능력을 갖추고 있습니다..."
          }
        }
      },
      "Usage": {
        "type": "object",
        "description": "토큰 사용 통계 정보",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "입력 내용의 토큰 수",
            "example": 15
          },
          "completion_tokens": {
            "type": "integer",
            "description": "출력 내용의 토큰 수",
            "example": 256
          },
          "total_tokens": {
            "type": "integer",
            "description": "총 토큰 수",
            "example": 271
          },
          "prompt_tokens_details": {
            "type": "object",
            "description": "입력 토큰 상세 정보",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "description": "캐시 히트된 토큰 수",
                "example": 0
              }
            }
          },
          "completion_tokens_details": {
            "type": "object",
            "description": "출력 토큰 상세 정보",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "description": "추론/사고 체인 토큰 수",
                "example": 0
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer",
                "description": "HTTP 상태 오류 코드"
              },
              "message": {
                "type": "string",
                "description": "오류 설명"
              },
              "type": {
                "type": "string",
                "description": "오류 유형"
              },
              "param": {
                "type": "string",
                "description": "관련 매개변수 이름"
              },
              "fallback_suggestion": {
                "type": "string",
                "description": "오류 시 제안"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "##모든 API는 Bearer Token 인증이 필요합니다##\n\n**API Key 받기:**\n\n[API Key 관리 페이지](https://evolink.ai/dashboard/keys)를 방문하여 API Key를 받으세요\n\n**요청 헤더에 추가:**\n```\nAuthorization: Bearer YOUR_API_KEY\n```"
      }
    }
  },
  "tags": [
    {
      "name": "채팅 생성",
      "description": "AI 채팅 생성 관련 API"
    }
  ]
}
