Skip to main content
Public DTOs live in AI/Contracts and Core/Models/{ThreadModels,VoteModels,SystemSettingModels}.cs and serialize as camelCase. Admin DTOs live in Core/Models/{AdminModels,ProviderModels}.cs and carry explicit snake_case [JsonProperty] names that match the columns, so the admin API speaks the database’s names.

Public DTOs

Used by chat, chat/stream and dualchat: in C# all three bind the same class. The OpenAPI spec splits it into ChatRequest (single chat) and BattleRequest (battles) so each endpoint only shows the fields it reads.

Admin DTOs

ApiResponse<T> wraps every admin response: success, data, error, message, total, page, pageSize and page_size. AdminFieldRules holds the allowed values the controllers validate: roles admin and user; model statuses active, inactive and maintenance; visibilities private, unlisted and public.
Adding a column? Add it to the DTO with a [JsonProperty("snake_name")], then check the matching UpdateRequest: because PUT serializes the whole DTO, a new nullable field there will be written as null by every client that doesn’t send it yet.
Last modified on October 18, 2026