{
  "openapi": "3.1.0",
  "info": {
    "title": "Gemini Native API - 빠른 시작",
    "description": "Google Gemini Native API를 시작하여 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": {
    "/v1beta/models/gemini-3.5-flash:generateContent": {
      "post": {
        "summary": "gemini-3.5-flash 빠른 채팅",
        "description": "- Google Native API 형식을 사용하여 gemini-3.5-flash 모델 호출\n- 동기 처리 모드, 실시간 응답\n- 최소 매개변수로 빠른 시작\n- 💡 더 많은 기능이 필요하신가요? [전체 API 레퍼런스](./native-api-reference)를 확인하세요",
        "operationId": "generateContentQuick",
        "tags": [
          "콘텐츠 생성"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateContentQuickRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "콘텐츠가 성공적으로 생성되었습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateContentResponse"
                }
              }
            }
          },
          "400": {
            "description": "잘못된 요청 매개변수",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 400,
                    "message": "잘못된 요청 매개변수",
                    "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": "할당량 부족",
                    "type": "insufficient_quota_error",
                    "fallback_suggestion": "https://evolink.ai/dashboard/billing"
                  }
                }
              }
            }
          },
          "403": {
            "description": "접근 거부",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 403,
                    "message": "Access denied for this model",
                    "type": "permission_error"
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스를 찾을 수 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 404,
                    "message": "Model not found",
                    "type": "not_found_error"
                  }
                }
              }
            }
          },
          "429": {
            "description": "랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할 수 있습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 429,
                    "message": "랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할 수 있습니다",
                    "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": "내부 서버 오류",
                    "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 again later"
                  }
                }
              }
            }
          },
          "503": {
            "description": "서비스 일시적으로 사용 불가",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": 503,
                    "message": "서비스 일시적으로 사용 불가",
                    "type": "service_unavailable_error",
                    "fallback_suggestion": "retry after 30 seconds"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GenerateContentQuickRequest": {
        "type": "object",
        "required": [
          "contents"
        ],
        "properties": {
          "contents": {
            "type": "array",
            "description": "대화 내용 목록",
            "items": {
              "$ref": "#/components/schemas/ContentSimple"
            },
            "minItems": 1,
            "example": [
              {
                "role": "user",
                "parts": [
                  {
                    "text": "Hello, please introduce yourself"
                  }
                ]
              }
            ]
          }
        }
      },
      "ContentSimple": {
        "type": "object",
        "required": [
          "role",
          "parts"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "콘텐츠 역할",
            "enum": [
              "user"
            ],
            "example": "user"
          },
          "parts": {
            "type": "array",
            "description": "콘텐츠 파트 목록 (일반 텍스트)",
            "items": {
              "$ref": "#/components/schemas/TextPart"
            },
            "minItems": 1
          }
        }
      },
      "TextPart": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "텍스트 내용",
            "example": "Hello! I'm glad to introduce myself.\n\nI'm a large language model trained and developed by Google..."
          }
        }
      },
      "GenerateContentResponse": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "description": "마지막 프레임 이미지 URL\n\n**참고:**\n- `image_start` (첫 프레임 이미지 URL)와 `image_end` (마지막 프레임 이미지 URL) 중 하나 이상 필요\n- 마지막 프레임은 첫 프레임이 필요합니다\n- 이미지 요구사항은 `image_start`와 동일합니다",
            "items": {
              "$ref": "#/components/schemas/Candidate"
            }
          },
          "promptFeedback": {
            "$ref": "#/components/schemas/PromptFeedback"
          },
          "usageMetadata": {
            "$ref": "#/components/schemas/UsageMetadata"
          }
        }
      },
      "Candidate": {
        "type": "object",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/ContentResponse"
          },
          "finishReason": {
            "type": "string",
            "description": "종료 이유",
            "enum": [
              "STOP",
              "MAX_TOKENS",
              "SAFETY",
              "RECITATION",
              "OTHER"
            ],
            "example": "STOP"
          },
          "index": {
            "type": "integer",
            "description": "후보 인덱스",
            "example": 0
          },
          "safetyRatings": {
            "type": "array",
            "nullable": true,
            "description": "안전 등급",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "ContentResponse": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "응답 역할",
            "enum": [
              "model"
            ],
            "example": "model"
          },
          "parts": {
            "type": "array",
            "description": "응답 콘텐츠 파트",
            "items": {
              "$ref": "#/components/schemas/TextPart"
            }
          }
        }
      },
      "PromptFeedback": {
        "type": "object",
        "properties": {
          "safetyRatings": {
            "type": "array",
            "nullable": true,
            "description": "프롬프트 최적화 기능의 모드를 설정하기 위한 프롬프트 최적화 전략\n\n**옵션:**\n- `standard`: 표준 모드, 더 높은 품질 출력, 더 긴 처리 시간\n- `fast`: 빠른 모드, 더 빠른 생성 속도, 평균 품질",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "UsageMetadata": {
        "type": "object",
        "description": "사용량 통계",
        "properties": {
          "promptTokenCount": {
            "type": "integer",
            "description": "입력 토큰 수",
            "example": 4
          },
          "candidatesTokenCount": {
            "type": "integer",
            "description": "출력 토큰 수",
            "example": 611
          },
          "totalTokenCount": {
            "type": "integer",
            "description": "총 토큰 수",
            "example": 2422
          },
          "thoughtsTokenCount": {
            "type": "integer",
            "description": "추론 토큰 수",
            "example": 1807
          },
          "promptTokensDetails": {
            "type": "array",
            "description": "상세 입력 토큰 정보 (모달리티별)",
            "items": {
              "$ref": "#/components/schemas/TokenDetail"
            }
          }
        }
      },
      "TokenDetail": {
        "type": "object",
        "description": "토큰 상세 정보 (모달리티별)",
        "properties": {
          "modality": {
            "type": "string",
            "description": "콘텐츠 모달리티 유형",
            "enum": [
              "TEXT",
              "IMAGE",
              "AUDIO",
              "VIDEO"
            ],
            "example": "TEXT"
          },
          "tokenCount": {
            "type": "integer",
            "description": "이 모달리티의 토큰 수",
            "example": 4
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer",
                "description": "HTTP 상태 오류 코드"
              },
              "message": {
                "type": "string",
                "description": "오류 설명"
              },
              "type": {
                "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": "Gemini AI 콘텐츠 생성 API"
    }
  ]
}