创建新的API密钥使用记录的模式。
| 9 | |
| 10 | |
| 11 | class ApiKeyUsageCreate(BaseModel): |
| 12 | """创建新的API密钥使用记录的模式。""" |
| 13 | request_id: str = Field(..., description="此请求的唯一标识符") |
| 14 | api_key: str = Field(..., description="请求中使用的API密钥") |
| 15 | model_name: str = Field(..., description="使用的模型名称") |
| 16 | source_name: str = Field(..., description="接口供应商名称") |
| 17 | prompt_tokens: Optional[int] = Field(None, description="输入令牌数量") |
| 18 | completion_tokens: Optional[int] = Field(None, description="输出令牌数量") |
| 19 | create_time: datetime = Field(..., description="请求开始时间") |
| 20 | finish_time: datetime = Field(..., description="请求完成时间") |
| 21 | execution_time: float = Field(..., description="总执行时间(秒)") |
| 22 | status: bool = Field(..., description="请求是否成功") |
| 23 | remark: Optional[str] = Field("", description="备注信息,用于记录API调用的用途或来源") |
| 24 | |
| 25 | |
| 26 | class ApiKeyResponse(BaseModel): |
nothing calls this directly
no outgoing calls
no test coverage detected