To convert Snakecase to Camelcase with Gson, you can use @SerializedName annotation.

data class GitHubUser(
val name: String,
val id: String,
@SerializedName("avatar_url")
val avatarUrl: String
)

Library versions are below.

dependencies {
// Retrofit2
implementation "com.squareup.retrofit2:retrofit:${RetrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${RetrofitVersion}"
}
ext {
RetrofitVersion = '2.5.0'
}